Skip to content
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
1696 commits
Select commit Hold shift + click to select a range
af08da7
consistent renaming
sstanculeanu Apr 7, 2025
48fa70d
Merge branch 'use_KeyRWMutexHandler_for_proofs' of https://github.com…
sstanculeanu Apr 7, 2025
f33fd50
Merge pull request #6945 from multiversx/update_feat/andromeda-patch2…
sstanculeanu Apr 7, 2025
7441078
Merge branch 'feat/andromeda-patch2' into equivalent_proofs_resolver
sstanculeanu Apr 7, 2025
ddde9ac
Merge branch 'equivalent_proofs_resolver' of https://github.com/multi…
sstanculeanu Apr 7, 2025
3e30a53
Merge pull request #6547 from multiversx/feat/accounts-storage-iterator
BeniaminDrasovean Apr 7, 2025
7857207
test for equivalent proofs + others
cosmatudor Apr 7, 2025
6a01653
small fix
cosmatudor Apr 7, 2025
378e0ee
Merge branch 'feat/andromeda-patch1' into unit-tests-fork-detector
cosmatudor Apr 7, 2025
30cfa37
fixes after review
cosmatudor Apr 8, 2025
6d7ffb5
Merge remote-tracking branch 'origin/unit-tests-fork-detector' into u…
cosmatudor Apr 8, 2025
2e29f38
Merge branch 'rc/barnard' into reserved-functions-activations-flag
sasurobert Apr 9, 2025
6533a85
further integration and fixes
sstanculeanu Apr 9, 2025
8fe945d
added common method
sstanculeanu Apr 9, 2025
c65429b
fixes after review
sstanculeanu Apr 9, 2025
01b0b5a
fix sync process when proof should be requested again
sstanculeanu Apr 9, 2025
70ef180
Merge pull request #6932 from multiversx/reserved-functions-activatio…
sasurobert Apr 9, 2025
4438f85
fixes after review, simplified the logic of eligibleNodesCache
sstanculeanu Apr 9, 2025
1bfc2b0
simplify deletion after review
sstanculeanu Apr 9, 2025
da82c00
Merge pull request #6928 from multiversx/use_KeyRWMutexHandler_for_pr…
sstanculeanu Apr 10, 2025
89bb4f7
Merge branch 'feat/andromeda-patch1' into fix-fields-checker-integrat…
AdoAdoAdo Apr 10, 2025
f1ebdd2
Merge branch 'feat/andromeda-patch1' into unit-tests-fork-detector
AdoAdoAdo Apr 10, 2025
004aec5
Merge pull request #6933 from multiversx/fix-fields-checker-integrati…
AdoAdoAdo Apr 10, 2025
22ce9a3
Merge branch 'feat/andromeda-patch1' into unit-tests-fork-detector
AdoAdoAdo Apr 10, 2025
2247214
Merge pull request #6946 from multiversx/unit-tests-fork-detector
cosmatudor Apr 10, 2025
bf7d791
added custom nodes coordinator
ssd04 Apr 10, 2025
76d0880
fix nodes coordinator wrapper reference
ssd04 Apr 10, 2025
1749780
reuse hdr nonce hash storage instead of a new one for proofs
sstanculeanu Apr 10, 2025
d7e2057
Merge branch 'feat/andromeda-patch1' of https://github.com/multiversx…
sstanculeanu Apr 10, 2025
2d9d123
Merge branch 'equivalent_proofs_resolver' of https://github.com/multi…
sstanculeanu Apr 10, 2025
42137a6
fix tests
sstanculeanu Apr 10, 2025
8f67338
Merge branch 'equivalent_proofs_resolver' of https://github.com/multi…
sstanculeanu Apr 10, 2025
fc02f96
Merge pull request #6949 from multiversx/merge_patch1_into_patch2_202…
sstanculeanu Apr 10, 2025
793c6c7
Merge branch 'feat/andromeda-patch2' into equivalent_proofs_resolver
sstanculeanu Apr 10, 2025
58e8abf
Merge branch 'equivalent_proofs_resolver' of https://github.com/multi…
sstanculeanu Apr 10, 2025
45460c8
added base peers to shard mapper
ssd04 Apr 10, 2025
a6b82c4
revert nodes coordinator changes
ssd04 Apr 10, 2025
059ea31
fix chain simulator mock
ssd04 Apr 10, 2025
e24603f
add missing comments
ssd04 Apr 10, 2025
2fec10d
Merge pull request #6935 from multiversx/equivalent_proofs_resolver
sstanculeanu Apr 10, 2025
7312824
Merge branch 'feat/andromeda-patch2' into no_proof_on_header_integration
sstanculeanu Apr 10, 2025
9443b4f
further sync fixes, added proofs interceptor for epoch start meta block
sstanculeanu Apr 10, 2025
d66bd5c
remove header from pool on revert
AdoAdoAdo Apr 10, 2025
439cdac
remove header from fork detector
AdoAdoAdo Apr 10, 2025
70c3d15
do the epoch activation check before removing from pool
AdoAdoAdo Apr 10, 2025
c35d006
log error when no pool access
AdoAdoAdo Apr 10, 2025
02f404e
log error when no pool access
AdoAdoAdo Apr 10, 2025
4c98cfc
Merge pull request #6951 from multiversx/cleanup-headers-without-cons…
sstanculeanu Apr 11, 2025
49a7909
Merge branch 'feat/andromeda-patch1' into chain-simulator-nodes-coord…
AdoAdoAdo Apr 11, 2025
22ac3c9
fix integration tests
miiu96 Apr 11, 2025
a215f0b
fixes
miiu96 Apr 11, 2025
8773eaf
Merge pull request #6950 from multiversx/chain-simulator-nodes-coordi…
sstanculeanu Apr 11, 2025
f69b82e
remove fixes order in consensus flag
ssd04 Apr 11, 2025
8e3ffa2
remove fixes order in consensus flag - part2
ssd04 Apr 11, 2025
07791c6
Merge branch 'feat/andromeda-patch1' into cs_parallel_execution
sstanculeanu Apr 11, 2025
b850d61
rename equivalent messages flag to andromeda
ssd04 Apr 11, 2025
6131254
Merge pull request #6941 from multiversx/cs_parallel_execution
sstanculeanu Apr 11, 2025
6c9ba57
exclude invalid signers nodes from nonce check
ssd04 Apr 11, 2025
2af2a66
remove temp log level
ssd04 Apr 11, 2025
f78ed2a
fix linter issue
ssd04 Apr 11, 2025
d2287ab
Merge pull request #6943 from multiversx/feat/andromeda-patch1
sstanculeanu Apr 11, 2025
7c10256
Merge pull request #6953 from multiversx/invalid-signers-integration-…
ssd04 Apr 14, 2025
8e7ff88
Merge branch 'feat/andromeda-patch2' into merge-andromeda-activation-…
AdoAdoAdo Apr 14, 2025
3f09b44
fixes after review
sstanculeanu Apr 14, 2025
0e3dca0
Merge branch 'feat/andromeda-patch2' into no_proof_on_header_integration
sstanculeanu Apr 14, 2025
9a56b18
more fixes after review
sstanculeanu Apr 14, 2025
f8a2236
Merge remote-tracking branch 'origin/no_proof_on_header_integration' …
sstanculeanu Apr 14, 2025
53af428
proper hasProof condition
sstanculeanu Apr 15, 2025
0e1bce9
fix tests
sstanculeanu Apr 15, 2025
7142b96
removed one more test
sstanculeanu Apr 15, 2025
1dc4a03
fixes after review
sstanculeanu Apr 15, 2025
37a4edf
refactor to use base function to get header is missing
ssd04 Apr 15, 2025
6056f67
fix unknown storer
sstanculeanu Apr 15, 2025
6843242
refactor getting header by nonce
ssd04 Apr 15, 2025
86a929e
use shard label in log
ssd04 Apr 15, 2025
383c343
remove handle equivalent proof from sync
ssd04 Apr 15, 2025
7c932d2
fix chain simulator
miiu96 Apr 16, 2025
27adee9
added unit test for meta boostrap requesting header and proof
ssd04 Apr 16, 2025
f6d10dc
added unit test for shard boostrap requesting header and proof
ssd04 Apr 16, 2025
8a7d980
fixes after review - refactorings
ssd04 Apr 16, 2025
0c25466
fixes after review - refactoring
ssd04 Apr 16, 2025
4003b18
Merge pull request #6955 from multiversx/fix-failing-test-andromeda
miiu96 Apr 16, 2025
0b0951c
save proofs to storage during bootstrap
sstanculeanu Apr 16, 2025
64ba9a4
rollback variables.sh
sstanculeanu Apr 16, 2025
70a80e3
fix possible panic in tests
sstanculeanu Apr 16, 2025
d62e7cb
Merge branch 'rc/andromeda' of https://github.com/multiversx/mx-chain…
sstanculeanu Apr 16, 2025
32bb578
Merge pull request #6956 from multiversx/merge_rc_andromeda_into_feat…
sstanculeanu Apr 16, 2025
6c1ee04
Merge branch 'feat/andromeda-patch2' of https://github.com/multiversx…
sstanculeanu Apr 16, 2025
fd2b5be
fix after merge
sstanculeanu Apr 16, 2025
779a07a
fix failing test
sstanculeanu Apr 16, 2025
aeb0266
added back updatePeerShardMapper functionality removed after merge
sstanculeanu Apr 16, 2025
83b824f
fix validity test
sstanculeanu Apr 16, 2025
0144379
Merge branch 'no_proof_on_header_integration' into process-sync-paral…
ssd04 Apr 16, 2025
ca60072
fix received headers test
ssd04 Apr 16, 2025
0f745da
fixes after review
sstanculeanu Apr 17, 2025
d65d06d
Merge branch 'no_proof_on_header_integration' into process-sync-paral…
ssd04 Apr 17, 2025
1ff9629
Merge pull request #6937 from multiversx/no_proof_on_header_integration
AdoAdoAdo Apr 17, 2025
5d3bc67
Merge branch 'feat/andromeda-patch2' into process-sync-parallelizatio…
ssd04 Apr 17, 2025
87a69ce
fix linter issue
ssd04 Apr 17, 2025
3ca4996
fix linter issue
ssd04 Apr 17, 2025
70ed339
fix linter issue
ssd04 Apr 17, 2025
b0cfac1
Merge pull request #6954 from multiversx/process-sync-parallelization…
AdoAdoAdo Apr 17, 2025
7046ae5
Merge branch 'feat/andromeda-patch2' into merge-andromeda-activation-…
ssd04 Apr 17, 2025
2f91189
conflicts fixes after merge
ssd04 Apr 17, 2025
29aacda
further fixes on sync
sstanculeanu Apr 17, 2025
9e14cb0
extra comment
sstanculeanu Apr 17, 2025
2a617de
fix linter
sstanculeanu Apr 17, 2025
a8cd460
fix short tests
sstanculeanu Apr 17, 2025
9888a3c
fix after review
sstanculeanu Apr 17, 2025
0143d17
fix test
sstanculeanu Apr 17, 2025
7ceb81d
fixed condition in receivedProof
sstanculeanu Apr 17, 2025
33224dc
removed debug log
sstanculeanu Apr 17, 2025
f4b8052
removed debug log
sstanculeanu Apr 17, 2025
3508983
removed request leading to blacklist
sstanculeanu Apr 22, 2025
d291519
fix tests
sstanculeanu Apr 22, 2025
944eafe
moved saving into storage of proof from interceptor to commitBlock
sstanculeanu Apr 22, 2025
62d719c
fixes after review
sstanculeanu Apr 22, 2025
48f1321
fixes after review, added missing checkNeedsProofByHash
sstanculeanu Apr 22, 2025
dc710f1
fixed typo
sstanculeanu Apr 22, 2025
59b1e10
removed eligibleNodesCache
sstanculeanu Apr 22, 2025
6e828d7
Merge pull request #6957 from multiversx/extra_fix_on_sync
sstanculeanu Apr 22, 2025
f7b65e9
Merge branch 'feat/andromeda-patch2' into remove_ispeereligible_check
sstanculeanu Apr 22, 2025
0e25152
fixes after review
sstanculeanu Apr 22, 2025
d9c481e
Merge remote-tracking branch 'origin/remove_ispeereligible_check' int…
sstanculeanu Apr 22, 2025
c499844
proper epoch usage on requests
sstanculeanu Apr 22, 2025
364099c
handle genesis nonce
ssd04 Apr 23, 2025
6621989
reverted the epoch workaround added for proofs on requestHandler
sstanculeanu Apr 23, 2025
df26228
fixes short tests
sstanculeanu Apr 23, 2025
36db4c3
Merge branch 'remove_ispeereligible_check' into sync-integration-test…
ssd04 Apr 23, 2025
da502b7
fixes after review
sstanculeanu Apr 23, 2025
4053154
update genesis block checks for proofs
ssd04 Apr 23, 2025
5e85958
fixes after review
sstanculeanu Apr 23, 2025
93f3f4b
update genesis block checks for proofs
ssd04 Apr 23, 2025
ac48037
update genesis block check
ssd04 Apr 23, 2025
5d60b15
Merge branch 'remove_ispeereligible_check' into sync-integration-test…
ssd04 Apr 23, 2025
7179322
broadcast block without proof
ssd04 Apr 23, 2025
a4b7a88
broadcast block with proof
ssd04 Apr 23, 2025
fbeb78b
use common flag function when saving proof
ssd04 Apr 23, 2025
2d10c92
cleanup debugging code
ssd04 Apr 23, 2025
0c1d199
add more comments
ssd04 Apr 23, 2025
609174f
Merge pull request #6959 from multiversx/remove_ispeereligible_check
ssd04 Apr 23, 2025
64e67cd
Merge branch 'feat/andromeda-patch2' into sync-integration-test-at-ge…
ssd04 Apr 23, 2025
218a1ca
fixes after review
ssd04 Apr 23, 2025
dfe8d69
Merge pull request #6960 from multiversx/sync-integration-test-at-gen…
sstanculeanu Apr 23, 2025
d306816
Merge branch 'sync-integration-test-at-genesis' into merge-andromeda-…
ssd04 Apr 23, 2025
f58476a
fixes conflicts after merge
ssd04 Apr 23, 2025
fd817af
Merge branch 'feat/andromeda-patch2' into merge-andromeda-activation-…
ssd04 Apr 23, 2025
642451f
remove duplicated test
AdoAdoAdo Apr 23, 2025
685c70d
Update consensus/spos/bls/v1/errors.go
ssd04 Apr 23, 2025
acdce0f
Update node/chainSimulator/configs/configs.go
ssd04 Apr 23, 2025
2cf479c
go fmt run
ssd04 Apr 23, 2025
2da204f
Merge pull request #6952 from multiversx/merge-andromeda-activation-flag
AdoAdoAdo Apr 23, 2025
5c7f7a3
fix shard nodes panicking while requesting epoch start meta proof
sstanculeanu Apr 24, 2025
c411c30
extra early exit
sstanculeanu Apr 24, 2025
a917542
removed extra early exit
sstanculeanu Apr 24, 2025
d052f5c
guard another possible panic
sstanculeanu Apr 25, 2025
570e8a5
use the epoch from header, not the one from epochStartTrigger
sstanculeanu Apr 25, 2025
9a41200
fixes after review
sstanculeanu Apr 25, 2025
f39dfd4
Merge pull request #6962 from multiversx/fix_epoch_start_meta_proof_r…
sstanculeanu Apr 25, 2025
9005f00
fix checking proof by nonce from pool
ssd04 Apr 25, 2025
ca7bdad
Merge pull request #6963 from multiversx/fix-proof-by-nonce-check
sstanculeanu Apr 25, 2025
85b7a05
add configurable epoch change grace period
AdoAdoAdo Apr 29, 2025
f30b815
integrate in core components configurable grace period
AdoAdoAdo Apr 29, 2025
51d8551
integrate configurable grace period
AdoAdoAdo Apr 29, 2025
7e210b6
integrate configurable grace period in base block tracker
AdoAdoAdo Apr 29, 2025
1035766
append shard id for shard hdr nonce hash data unit
sstanculeanu Apr 29, 2025
bcf2539
fix tests
sstanculeanu Apr 29, 2025
a71cbbc
Merge pull request #6969 from multiversx/proper_shrdhdrnoncehashdataunit
sstanculeanu Apr 29, 2025
90f96cc
update tests
AdoAdoAdo Apr 29, 2025
9084c04
update tests 2
AdoAdoAdo Apr 29, 2025
ae0e61e
fix unit tests
AdoAdoAdo Apr 29, 2025
e442f6e
Merge branch 'feat/andromeda-patch2' into configurable-grace-period
AdoAdoAdo Apr 29, 2025
a16e394
fixes after review
AdoAdoAdo Apr 30, 2025
24c43d2
Merge pull request #6970 from multiversx/configurable-grace-period
sstanculeanu Apr 30, 2025
7d3f666
do not request proofs if not needed
AdoAdoAdo May 2, 2025
1bd51bb
remove unused method
AdoAdoAdo May 2, 2025
0220c53
storage equivalentProofsRequester
sstanculeanu May 2, 2025
fac5a51
fix linter
sstanculeanu May 2, 2025
f68ec08
Merge pull request #6971 from multiversx/fix-proofs-request-importb
AdoAdoAdo May 2, 2025
3a5ea74
fixes after review + unittests
sstanculeanu May 2, 2025
43f1f7c
Merge branch 'feat/andromeda-patch2' into storageEquivalentProofsRequ…
sstanculeanu May 2, 2025
8131bfa
Merge pull request #6972 from multiversx/storageEquivalentProofsReque…
sstanculeanu May 2, 2025
5696436
skip proofs request if epoch is not ok
sstanculeanu May 2, 2025
6db7c3b
fix after review, removed epoch+1
sstanculeanu May 2, 2025
a1c15b1
fix after review
sstanculeanu May 2, 2025
fc651f7
Merge pull request #6973 from multiversx/skip-proof-requests
sstanculeanu May 2, 2025
44b81a2
epoch set for start in epoch mode
AdoAdoAdo May 5, 2025
9fb5844
epoch set for shuffle
AdoAdoAdo May 5, 2025
c2c5c56
request also epoch start metablock to force proof request
AdoAdoAdo May 5, 2025
b92de31
add also corresponding shardID for requested hash
AdoAdoAdo May 5, 2025
b40ceae
add also corresponding shardID for requested hash
AdoAdoAdo May 5, 2025
77b3965
skip signature broadcast if proof already received
sstanculeanu May 6, 2025
36a66d5
sort imports
sstanculeanu May 6, 2025
ee2219a
Merge pull request #6975 from multiversx/skip-signature-if-proof-exists
sstanculeanu May 6, 2025
32a9317
Merge branch 'feat/andromeda-patch2' into epoch-start-proof-request-fix
sstanculeanu May 6, 2025
1beed89
add stats for GetForEpoch
ssd04 May 6, 2025
20b3a9c
count every persister get operation, not only when key was found
ssd04 May 6, 2025
79ef574
updated epoch on requester with the one from the header, if header ex…
raduchis May 7, 2025
43d806a
Merge pull request #6978 from multiversx/epoch-start-proof-request-fi…
AdoAdoAdo May 7, 2025
d6869ee
extra checks api block
miiu96 May 8, 2025
ff2371c
fix integration tests
miiu96 May 8, 2025
048ae0f
keep checks of for get block by nonce
miiu96 May 8, 2025
eea032e
check for header shard when received in consensus worker
ssd04 May 8, 2025
0855762
Merge pull request #6980 from multiversx/fix-received-header-on-conse…
ssd04 May 8, 2025
356cd60
fix after review
ssd04 May 8, 2025
11afaf7
Merge pull request #6976 from multiversx/add-get-from-epoch-storage-s…
sstanculeanu May 8, 2025
4cf13b9
Merge branch 'feat/andromeda-patch2' into epoch-start-proof-request-fix
sstanculeanu May 8, 2025
d1916e3
increased BaseMessagesPerInterval
raduchis May 8, 2025
8f5560b
Merge pull request #6979 from multiversx/fix-api-block-endpoint-proofs
AdoAdoAdo May 8, 2025
031b010
Merge pull request #6981 from multiversx/increased-antiflood-baseMess…
AdoAdoAdo May 8, 2025
7fd7a67
fix linter
AdoAdoAdo May 8, 2025
a5eac80
force trigger on Andromeda epoch start
AdoAdoAdo May 9, 2025
57a10c6
force trigger on Andromeda epoch start
AdoAdoAdo May 9, 2025
691ce0c
Merge pull request #6974 from multiversx/epoch-start-proof-request-fix
AdoAdoAdo May 9, 2025
3e1addc
Merge pull request #6938 from multiversx/feat/andromeda-patch2
sstanculeanu May 9, 2025
fd280c6
proper tags on deps
sstanculeanu May 9, 2025
653e73a
Merge pull request #6984 from multiversx/update-tags
sstanculeanu May 9, 2025
8f0fd5f
vm ops
sasurobert May 12, 2025
cb0d2a0
revert go mod
sasurobert May 13, 2025
e40ced2
Merge pull request #6986 from multiversx/impr-vm-ops
sstanculeanu May 14, 2025
bf50e6c
proper tags on vm-go
sstanculeanu May 14, 2025
e0d255e
Merge pull request #6988 from multiversx/update-vm-go-tag
sstanculeanu May 14, 2025
04cca37
merge vm andromeda
sasurobert May 14, 2025
a90f2b0
merge vm andromeda
sasurobert May 14, 2025
c937e2c
merge vm andromeda
sasurobert May 14, 2025
77830a1
skip on short
sasurobert May 14, 2025
4e357f7
fixes after review and proper tag
sasurobert May 15, 2025
3c3b06f
fixes after review and proper tag
sasurobert May 15, 2025
24219b2
Merge pull request #6989 from multiversx/merge-vm-andromeda
miiu96 May 15, 2025
acdc30f
remove double rlock
AdoAdoAdo May 15, 2025
9f2444e
Merge pull request #6992 from multiversx/fix-recursive-lock
ssd04 May 16, 2025
6a33482
Merge branch 'rc/andromeda' into andromeda-to-barnard
sasurobert May 20, 2025
03ac168
initial go mod commit
sasurobert May 20, 2025
7f5bc80
fixes after merge
sasurobert May 20, 2025
ad5d275
fixes after merge
sasurobert May 20, 2025
f642fb6
fixes after merge
sasurobert May 20, 2025
5fa83fa
fixes after merge
sasurobert May 20, 2025
3e1c190
linter fixes
sasurobert May 20, 2025
0747c01
test fixes
sasurobert May 20, 2025
ebb1fd4
Merge pull request #6747 from multiversx/rc/andromeda
sstanculeanu May 21, 2025
86cf558
compressed flags
sstanculeanu May 21, 2025
1c1eb57
Merge pull request #7003 from multiversx/v1.9.6-dev-config
sstanculeanu May 22, 2025
10bc969
Merge branch 'master' into andromeda-to-barnard
sasurobert May 22, 2025
c742e86
fixes andromeda to barnard merge
AdoAdoAdo May 23, 2025
4fe7f21
fix unlock
AdoAdoAdo May 23, 2025
00ea571
fix unlock
AdoAdoAdo May 23, 2025
e30c379
Merge pull request #7006 from multiversx/fixes-andromeda-to-barnard
AdoAdoAdo May 29, 2025
50585fb
fix concurrent write in epoch start test
laurci May 29, 2025
022bfbc
Merge branch 'andromeda-to-barnard' into andromeda-to-governance
sasurobert May 29, 2025
9f3845d
fix
sasurobert May 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,27 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// Get the latest comment
// Get all comments
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const lastComment = comments.data.pop(); // Get the last comment
// Find the last comment that contains 'Run Tests:'
let lastTestComment = null;
for (let i = comments.data.length - 1; i >= 0; i--) {
if (comments.data[i].body.includes('Run Tests:')) {
lastTestComment = comments.data[i];
break;
}
}

if (lastComment && lastComment.body.includes('Run Tests:')) {
const body = lastComment.body.trim();
if (lastTestComment) {
const body = lastTestComment.body.trim();
core.setOutput('latest_comment', body);

// Parse the branches from the last comment
// Parse the branches from the last test comment
const simulatorBranchMatch = body.match(/mx-chain-simulator-go:\s*(\S+)/);
const testingSuiteBranchMatch = body.match(/mx-chain-testing-suite:\s*(\S+)/);

Expand All @@ -86,8 +93,11 @@ jobs:
if (testingSuiteBranchMatch) {
core.exportVariable('MX_CHAIN_TESTING_SUITE_TARGET_BRANCH', testingSuiteBranchMatch[1]);
}

// Log which comment was used for configuration
core.info(`Found 'Run Tests:' comment from ${lastTestComment.user.login} at ${lastTestComment.created_at}`);
} else {
core.info('The last comment does not contain "Run Tests:". Skipping branch override.');
core.info('No comment containing "Run Tests:" was found. Using default branch settings.');
}


Expand Down Expand Up @@ -146,6 +156,82 @@ jobs:
go build
echo "CHAIN_SIMULATOR_BUILD_PATH=$(pwd)" >> $GITHUB_ENV

- name: Initialize Chain Simulator
run: |
cd mx-chain-simulator-go/cmd/chainsimulator

# Start ChainSimulator with minimal args to initialize configs
INIT_LOG_FILE="/tmp/chainsim_init.log"
echo "Starting ChainSimulator initialization process..."
./chainsimulator > $INIT_LOG_FILE 2>&1 &
INIT_PROCESS_PID=$!

# Verify the process is running
if ! ps -p $INIT_PROCESS_PID > /dev/null; then
echo "Failed to start ChainSimulator process"
cat $INIT_LOG_FILE
exit 1
fi

# Wait for the initialization to complete - look for multiple possible success patterns
INIT_COMPLETED=false
RETRY_COUNT=0
MAX_RETRIES=60 # Increase timeout to 60 seconds

echo "Waiting for ChainSimulator initialization..."
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
# Check for any of these success patterns
if grep -q "starting as observer node" $INIT_LOG_FILE || \
grep -q "ChainSimulator started successfully" $INIT_LOG_FILE || \
grep -q "initialized the node" $INIT_LOG_FILE || \
grep -q "Node is running" $INIT_LOG_FILE; then
INIT_COMPLETED=true
echo "ChainSimulator initialization completed successfully"
break
fi

# If there's a known fatal error, exit early
if grep -q "fatal error" $INIT_LOG_FILE || grep -q "panic:" $INIT_LOG_FILE; then
echo "Fatal error detected during initialization:"
grep -A 10 -E "fatal error|panic:" $INIT_LOG_FILE
break
fi

# Print progress every 10 seconds
if [ $((RETRY_COUNT % 10)) -eq 0 ]; then
echo "Still waiting for initialization... ($RETRY_COUNT seconds elapsed)"
tail -5 $INIT_LOG_FILE
fi

RETRY_COUNT=$((RETRY_COUNT+1))
sleep 1
done

# Kill the initialization process - try graceful shutdown first
echo "Stopping initialization process (PID: $INIT_PROCESS_PID)..."
kill -TERM $INIT_PROCESS_PID 2>/dev/null || true
sleep 3

# Check if process still exists and force kill if needed
if ps -p $INIT_PROCESS_PID > /dev/null 2>&1; then
echo "Process still running, forcing kill..."
kill -9 $INIT_PROCESS_PID 2>/dev/null || true
sleep 1
fi

if [ "$INIT_COMPLETED" != "true" ]; then
echo "ChainSimulator initialization failed after $MAX_RETRIES seconds"
echo "Last 20 lines of log:"
tail -20 $INIT_LOG_FILE
exit 1
fi

# Create a marker file to indicate successful initialization
touch /tmp/chain_simulator_initialized.lock
echo "Chain Simulator successfully initialized"

echo "Initialization log stored at: $INIT_LOG_FILE"

- name: Checkout mx-chain-testing-suite
uses: actions/checkout@v4
with:
Expand Down
9 changes: 9 additions & 0 deletions api/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ var ErrGetValueForKey = errors.New("get value for key error")
// ErrGetKeyValuePairs signals an error in getting the key-value pairs of a key for an account
var ErrGetKeyValuePairs = errors.New("get key-value pairs error")

// ErrIterateKeys signals an error in iterating over the keys of an account
var ErrIterateKeys = errors.New("iterate keys error")

// ErrGetESDTBalance signals an error in getting esdt balance for given address
var ErrGetESDTBalance = errors.New("get esdt balance for account error")

Expand All @@ -43,6 +46,12 @@ var ErrGetESDTNFTData = errors.New("get esdt nft data for account error")
// ErrEmptyAddress signals that an empty address was provided
var ErrEmptyAddress = errors.New("address is empty")

// ErrEmptyNumKeys signals that an empty numKeys was provided
var ErrEmptyNumKeys = errors.New("numKeys is empty")

// ErrEmptyCheckpointId signals that an empty checkpointId was provided
var ErrEmptyCheckpointId = errors.New("checkpointId is empty")

// ErrEmptyKey signals that an empty key was provided
var ErrEmptyKey = errors.New("key is empty")

Expand Down
50 changes: 49 additions & 1 deletion api/groups/addressGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
getRegisteredNFTsPath = "/:address/registered-nfts"
getESDTNFTDataPath = "/:address/nft/:tokenIdentifier/nonce/:nonce"
getGuardianData = "/:address/guardian-data"
iterateKeysPath = "/iterate-keys"
urlParamOnFinalBlock = "onFinalBlock"
urlParamOnStartOfEpoch = "onStartOfEpoch"
urlParamBlockNonce = "blockNonce"
Expand All @@ -55,6 +56,7 @@ type addressFacadeHandler interface {
GetESDTsWithRole(address string, role string, options api.AccountQueryOptions) ([]string, api.BlockInfo, error)
GetAllESDTTokens(address string, options api.AccountQueryOptions) (map[string]*esdt.ESDigitalToken, api.BlockInfo, error)
GetKeyValuePairs(address string, options api.AccountQueryOptions) (map[string]string, api.BlockInfo, error)
IterateKeys(address string, numKeys uint, iteratorState [][]byte, options api.AccountQueryOptions) (map[string]string, [][]byte, api.BlockInfo, error)
GetGuardianData(address string, options api.AccountQueryOptions) (api.GuardianData, api.BlockInfo, error)
IsDataTrieMigrated(address string, options api.AccountQueryOptions) (bool, error)
IsInterfaceNil() bool
Expand Down Expand Up @@ -134,6 +136,11 @@ func NewAddressGroup(facade addressFacadeHandler) (*addressGroup, error) {
Method: http.MethodGet,
Handler: ag.getKeyValuePairs,
},
{
Path: iterateKeysPath,
Method: http.MethodPost,
Handler: ag.iterateKeys,
},
{
Path: getESDTBalancePath,
Method: http.MethodGet,
Expand Down Expand Up @@ -327,7 +334,7 @@ func (ag *addressGroup) getGuardianData(c *gin.Context) {
shared.RespondWithSuccess(c, gin.H{"guardianData": guardianData, "blockInfo": blockInfo})
}

// addressGroup returns all the key-value pairs for the given address
// getKeyValuePairs returns all the key-value pairs for the given address
func (ag *addressGroup) getKeyValuePairs(c *gin.Context) {
addr, options, err := extractBaseParams(c)
if err != nil {
Expand All @@ -344,6 +351,47 @@ func (ag *addressGroup) getKeyValuePairs(c *gin.Context) {
shared.RespondWithSuccess(c, gin.H{"pairs": value, "blockInfo": blockInfo})
}

// IterateKeysRequest defines the request structure for iterating keys
type IterateKeysRequest struct {
Address string `json:"address"`
NumKeys uint `json:"numKeys"`
IteratorState [][]byte `json:"iteratorState"`
}

// iterateKeys iterates keys for the given address
func (ag *addressGroup) iterateKeys(c *gin.Context) {
var iterateKeysRequest = &IterateKeysRequest{}
err := c.ShouldBindJSON(&iterateKeysRequest)
if err != nil {
shared.RespondWithValidationError(c, errors.ErrValidation, err)
return
}

if len(iterateKeysRequest.Address) == 0 {
shared.RespondWithValidationError(c, errors.ErrValidation, errors.ErrEmptyAddress)
return
}

options, err := extractAccountQueryOptions(c)
if err != nil {
shared.RespondWithValidationError(c, errors.ErrIterateKeys, err)
return
}

value, newIteratorState, blockInfo, err := ag.getFacade().IterateKeys(
iterateKeysRequest.Address,
iterateKeysRequest.NumKeys,
iterateKeysRequest.IteratorState,
options,
)
if err != nil {
shared.RespondWithInternalError(c, errors.ErrIterateKeys, err)
return
}

shared.RespondWithSuccess(c, gin.H{"pairs": value, "newIteratorState": newIteratorState, "blockInfo": blockInfo})
}

// getESDTBalance returns the balance for the given address and esdt token
func (ag *addressGroup) getESDTBalance(c *gin.Context) {
addr, tokenIdentifier, options, err := extractGetESDTBalanceParams(c)
Expand Down
117 changes: 114 additions & 3 deletions api/groups/addressGroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ type esdtTokensCompleteResponseData struct {
type esdtTokensCompleteResponse struct {
Data esdtTokensCompleteResponseData `json:"data"`
Error string `json:"error"`
Code string
Code string `json:"code"`
}

type keyValuePairsResponseData struct {
Expand All @@ -122,7 +122,17 @@ type keyValuePairsResponseData struct {
type keyValuePairsResponse struct {
Data keyValuePairsResponseData `json:"data"`
Error string `json:"error"`
Code string
Code string `json:"code"`
}

type iterateKeysResponseData struct {
Pairs map[string]string `json:"pairs"`
NewIteratorState [][]byte `json:"newIteratorState"`
}
type iterateKeysResponse struct {
Data iterateKeysResponseData `json:"data"`
Error string `json:"error"`
Code string `json:"code"`
}

type esdtRolesResponseData struct {
Expand All @@ -132,7 +142,7 @@ type esdtRolesResponseData struct {
type esdtRolesResponse struct {
Data esdtRolesResponseData `json:"data"`
Error string `json:"error"`
Code string
Code string `json:"code"`
}

type usernameResponseData struct {
Expand Down Expand Up @@ -662,6 +672,106 @@ func TestAddressGroup_getKeyValuePairs(t *testing.T) {
})
}

func TestAddressGroup_iterateKeys(t *testing.T) {
t.Parallel()

t.Run("invalid body should error",
testErrorScenario("/address/iterate-keys", "POST", bytes.NewBuffer([]byte("invalid body")),
formatExpectedErr(apiErrors.ErrValidation, errors.New("invalid character 'i' looking for beginning of value"))))
t.Run("empty address should error", func(t *testing.T) {
t.Parallel()

body := &groups.IterateKeysRequest{
Address: "",
}
bodyBytes, _ := json.Marshal(body)
testAddressGroup(
t,
&mock.FacadeStub{},
"/address/iterate-keys",
"POST",
bytes.NewBuffer(bodyBytes),
http.StatusBadRequest,
formatExpectedErr(apiErrors.ErrValidation, apiErrors.ErrEmptyAddress),
)
})
t.Run("invalid query options should error", func(t *testing.T) {
t.Parallel()

body := &groups.IterateKeysRequest{
Address: "erd1",
}
bodyBytes, _ := json.Marshal(body)
testAddressGroup(
t,
&mock.FacadeStub{},
"/address/iterate-keys?blockNonce=not-uint64",
"POST",
bytes.NewBuffer(bodyBytes),
http.StatusBadRequest,
formatExpectedErr(apiErrors.ErrIterateKeys, apiErrors.ErrBadUrlParams),
)
})
t.Run("with node fail should err", func(t *testing.T) {
t.Parallel()

body := &groups.IterateKeysRequest{
Address: "erd1",
}
bodyBytes, _ := json.Marshal(body)
facade := &mock.FacadeStub{
IterateKeysCalled: func(address string, numKeys uint, iteratorState [][]byte, options api.AccountQueryOptions) (map[string]string, [][]byte, api.BlockInfo, error) {
return nil, nil, api.BlockInfo{}, expectedErr
},
}
testAddressGroup(
t,
facade,
"/address/iterate-keys",
"POST",
bytes.NewBuffer(bodyBytes),
http.StatusInternalServerError,
formatExpectedErr(apiErrors.ErrIterateKeys, expectedErr),
)
})
t.Run("should work", func(t *testing.T) {
t.Parallel()

pairs := map[string]string{
"k1": "v1",
"k2": "v2",
}

body := &groups.IterateKeysRequest{
Address: "erd1",
NumKeys: 10,
IteratorState: [][]byte{[]byte("starting"), []byte("state")},
}
newIteratorState := [][]byte{[]byte("new"), []byte("state")}
bodyBytes, _ := json.Marshal(body)
facade := &mock.FacadeStub{
IterateKeysCalled: func(address string, numKeys uint, iteratorState [][]byte, options api.AccountQueryOptions) (map[string]string, [][]byte, api.BlockInfo, error) {
assert.Equal(t, body.Address, address)
assert.Equal(t, body.NumKeys, numKeys)
assert.Equal(t, body.IteratorState, iteratorState)
return pairs, newIteratorState, api.BlockInfo{}, nil
},
}

response := &iterateKeysResponse{}
loadAddressGroupResponse(
t,
facade,
"/address/iterate-keys",
"POST",
bytes.NewBuffer(bodyBytes),
response,
)
assert.Equal(t, pairs, response.Data.Pairs)
assert.Equal(t, newIteratorState, response.Data.NewIteratorState)
})
}

func TestAddressGroup_getESDTBalance(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1143,6 +1253,7 @@ func getAddressRoutesConfig() config.ApiRoutesConfig {
{Name: "/:address/username", Open: true},
{Name: "/:address/code-hash", Open: true},
{Name: "/:address/keys", Open: true},
{Name: "/iterate-keys", Open: true},
{Name: "/:address/key/:key", Open: true},
{Name: "/:address/esdt", Open: true},
{Name: "/:address/esdts/roles", Open: true},
Expand Down
Loading
Loading