Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge rc1.4 feat elrond go storage #4473

Merged
merged 498 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
498 commits
Select commit Hold shift + click to select a range
bf20a6a
- do not send peer connection messages if the node is a validator
iulianpascalau Aug 22, 2022
430fbad
Sketch possible fix (workaround) for loading a node using GetFromEpoc…
andreibancioiu Aug 22, 2022
e15520a
Merge pull request #4386 from ElrondNetwork/historical-lookup-past-ep…
gabi-vuls Aug 23, 2022
15656d7
- fixed log message
iulianpascalau Aug 23, 2022
06f36fa
create trieStorageManagerInEpoch and use it on recreateFromEpoch
BeniaminDrasovean Aug 23, 2022
2e3f69f
* Fixed set of indexes for processed txs in pending mini blocks, rece…
SebastianMarian Aug 23, 2022
c30baae
Merge branch 'rc/2022-july' into open-more-dbs-if-necessary
BeniaminDrasovean Aug 23, 2022
87258ac
* Added info about num txs in log
SebastianMarian Aug 23, 2022
142ed54
type assertion fix
BeniaminDrasovean Aug 23, 2022
290294f
When node is not available in epoch N, try in epoch N-1.
andreibancioiu Aug 23, 2022
c2cf66e
Add explanatory comment.
andreibancioiu Aug 23, 2022
8a1b090
Adjust "scheduledSCRsUnit" to use a fullHistoryPersister if appropria…
andreibancioiu Aug 23, 2022
c1c9e6e
Merge branch 'rc/2022-july' into recreate-trie-from-epoch-08-22
andreibancioiu Aug 23, 2022
efa4deb
refactor trieStorageManagerInEpoch Get()
BeniaminDrasovean Aug 23, 2022
853db46
* Added unit tests
SebastianMarian Aug 23, 2022
f18d4ea
* Temporary changed activation epoch for MiniBlockPartialExecution to…
SebastianMarian Aug 23, 2022
8560096
* Restored activation epoch for MiniBlockPartialExecution to 3
SebastianMarian Aug 23, 2022
76c005b
remove destroy persisters calls
bogdan-rosianu Aug 23, 2022
114aa02
refactor fullHistoryTriePruningStorer
BeniaminDrasovean Aug 23, 2022
6fb11aa
Merge branch 'rc/2022-july' into fix-direct-connections-processor
gabi-vuls Aug 24, 2022
5357e61
Merge pull request #4390 from ElrondNetwork/fix-direct-connections-pr…
gabi-vuls Aug 24, 2022
754bc60
Merge branch 'rc/2022-july' into hbv2_single_data_interceptor
sstanculeanu Aug 24, 2022
424f9be
Merge branch 'rc/2022-july' into fix-set-of-indexes-for-processed-txs…
gabi-vuls Aug 24, 2022
df68515
Merge pull request #4385 from ElrondNetwork/hbv2_single_data_interceptor
gabi-vuls Aug 24, 2022
7de4aaf
Add code-hash endpoint to address group
lcswillems Aug 24, 2022
94db8ef
Merge branch 'rc/2022-july' into fix-set-of-indexes-for-processed-txs…
gabi-vuls Aug 24, 2022
068a2f5
Merge pull request #4392 from ElrondNetwork/fix-set-of-indexes-for-pr…
gabi-vuls Aug 24, 2022
dec3608
Merge branch 'rc/2022-july' into remove-destroy-persisters-calls
iulianpascalau Aug 24, 2022
2410a1a
latest indexer commit
miiu96 Aug 24, 2022
9fc1655
Merge branch 'rc/2022-july' into indexer-with-fixes
miiu96 Aug 24, 2022
04e3e85
fix after review
BeniaminDrasovean Aug 24, 2022
ec5c6e2
Merge pull request #4393 from ElrondNetwork/remove-destroy-persisters…
gabi-vuls Aug 24, 2022
7e0acd1
modified config to allow multiple Crawler Addresses
raduchis Aug 24, 2022
73a3726
* Added unit tests for metaProcessor in metaBlock.go
SebastianMarian Aug 24, 2022
e3dad2c
Move encoding in addressGroup
lcswillems Aug 24, 2022
a1eaba8
added unit tests for GetAllowedAddress
raduchis Aug 24, 2022
f12be12
Merge branch 'rc/2022-july' into EN-12987-add-multiple-allowed-addresses
raduchis Aug 24, 2022
b5b01e4
reused shard 0 address from rc-july
raduchis Aug 24, 2022
2abfa77
updated vm-common
raduchis Aug 24, 2022
73b812f
Fix two failing tests
lcswillems Aug 24, 2022
108359b
Merge branch 'rc/2022-july' into recreate-trie-from-epoch-08-22
andreibancioiu Aug 24, 2022
a61086e
undo new vm-common
raduchis Aug 24, 2022
d0b9b98
Merge branch 'rc/2022-july' into open-more-dbs-if-necessary
BeniaminDrasovean Aug 25, 2022
b96da3b
ordered imports
raduchis Aug 25, 2022
c8f5a7d
Merge branch 'rc/2022-july' into update-dev-rc-july-2022.08.25
iulianpascalau Aug 25, 2022
835801f
- fixes after merge
iulianpascalau Aug 25, 2022
8ebcc31
fix after review
raduchis Aug 25, 2022
b6f7cb5
fix unit test
raduchis Aug 25, 2022
5f981f5
readded new vm-common
raduchis Aug 25, 2022
071afe2
fix after review
BeniaminDrasovean Aug 25, 2022
c139434
fix integration test
bogdan-rosianu Aug 25, 2022
323942e
fix typo
BeniaminDrasovean Aug 25, 2022
d262520
Merge branch 'rc/2022-july' into indexer-with-fixes
miiu96 Aug 25, 2022
fccc51f
fix case in which on bootstrap the triePruningStorer opens dbs until …
BeniaminDrasovean Aug 25, 2022
f87fe4c
Remove useless encoding
lcswillems Aug 25, 2022
2f9c331
undo vm-common version + vm-common integration test fix
raduchis Aug 25, 2022
8896a79
Merge pull request #4388 from ElrondNetwork/recreate-trie-from-epoch-…
gabi-vuls Aug 26, 2022
4bef3de
Merge branch 'rc/2022-july' into EN-12987-add-multiple-allowed-addresses
AdoAdoAdo Aug 26, 2022
d617e9e
reference vm common with fixes
bogdan-rosianu Aug 26, 2022
65ccced
Merge pull request #4396 from ElrondNetwork/update-dev-rc-july-2022.0…
gabi-vuls Aug 26, 2022
73a5aba
latest indexer
miiu96 Aug 26, 2022
09bac7a
fix after review
BeniaminDrasovean Aug 26, 2022
8e84954
fix integration test
bogdan-rosianu Aug 26, 2022
f7dfc7a
Merge branch 'rc/2022-july' into indexer-with-fixes
miiu96 Aug 26, 2022
296f7f9
add isSnapshotInProgress flag and remove duplicated code
BeniaminDrasovean Aug 26, 2022
14ed86a
proper release
miiu96 Aug 26, 2022
31029ab
use proper release
bogdan-rosianu Aug 26, 2022
41eeb85
use proper release
bogdan-rosianu Aug 26, 2022
7c6d380
* Fixed after reviews
SebastianMarian Aug 26, 2022
0f19bf6
Merge pull request #4389 from ElrondNetwork/indexer-with-fixes
gabi-vuls Aug 27, 2022
0a14c78
Merge branch 'rc/2022-july' into EN-12987-add-multiple-allowed-addresses
gabi-vuls Aug 27, 2022
cdcf7e0
Merge pull request #4395 from ElrondNetwork/EN-12987-add-multiple-all…
bogdan-rosianu Aug 28, 2022
1e7c4c2
Merge branch 'rc/2022-july' into EN-12995-liq-cleanup-fixes
bogdan-rosianu Aug 28, 2022
f1564dd
Merge pull request #4399 from ElrondNetwork/EN-12995-liq-cleanup-fixes
gabi-vuls Aug 28, 2022
e973bfd
Merge branch 'rc/2022-july' into update-dev-rc-july-2022.08.29
iulianpascalau Aug 29, 2022
1fce7a8
- new compatible vm-common v1.3.16
iulianpascalau Aug 29, 2022
99dd450
Merge branch 'development' into development
bogdan-rosianu Aug 29, 2022
7afd536
Merge pull request #4391 from lcswillems/development
bogdan-rosianu Aug 29, 2022
08bb77b
Merge branch 'rc/2022-july' into skip-snapshot-if-snapshot-in-progress
BeniaminDrasovean Aug 29, 2022
a57334e
* Fixed after self review
SebastianMarian Aug 29, 2022
b7481d0
Merge branch 'refactor-peers-mbs-on-meta-proposer-side' into unit-tes…
SebastianMarian Aug 29, 2022
23d28bf
* Fixed after merge
SebastianMarian Aug 29, 2022
eb8a79d
Merge pull request #4035 from ElrondNetwork/refactor-peers-mbs-on-met…
SebastianMarian Aug 29, 2022
b5d0a28
Merge branch 'feat/refactor-peers-mbs' into unit-tests-for-feat-refac…
SebastianMarian Aug 29, 2022
b1c21ab
fix after review
BeniaminDrasovean Aug 29, 2022
a156759
- linter fixes
iulianpascalau Aug 29, 2022
e20b790
- remove unnecessary call to mutDebugHandler.RLock() in single data i…
iulianpascalau Aug 30, 2022
616e2c2
* Fixed after review
SebastianMarian Aug 30, 2022
db2fbff
* Refactored test methods name
SebastianMarian Aug 30, 2022
ae87e01
Merge pull request #4402 from ElrondNetwork/update-dev-rc-july-2022.0…
gabi-vuls Aug 30, 2022
d5cd600
Bump github.com/gin-contrib/pprof from 1.3.0 to 1.4.0
dependabot[bot] Aug 30, 2022
b31f222
* Added some nil checks in shardedDataStub.go
SebastianMarian Aug 30, 2022
71978ff
added peerTypeProvider into heartbeat v2 monitor to properly set peer…
sstanculeanu Aug 30, 2022
89d6fbd
Merge pull request #4377 from ElrondNetwork/unit-tests-for-feat-refac…
SebastianMarian Aug 30, 2022
80f6fce
Merge branch 'rc/v1.4.0' into feat/refactor-peers-mbs
SebastianMarian Aug 30, 2022
60dc80c
Merge branch 'development' into external-codehash-endpoint
gabi-vuls Aug 30, 2022
7d3761c
Merge pull request #4406 from ElrondNetwork/linter-fixes
gabi-vuls Aug 30, 2022
48de2a3
Merge branch 'rc/2022-july' into remove-mutex-use-in-interceptor
gabi-vuls Aug 30, 2022
6c99e25
Merge branch 'rc/2022-july' into fix_heartbeats_api_peer_type
sstanculeanu Aug 30, 2022
c7b60f4
check http error code on post request
ssd04 Aug 30, 2022
afd0d66
Merge pull request #4403 from ElrondNetwork/external-codehash-endpoint
gabi-vuls Aug 30, 2022
3496b82
Merge branch 'rc/2022-july' into notifier-client-fix-http-error-handling
ssd04 Aug 30, 2022
908169d
Merge pull request #4411 from ElrondNetwork/merge-v1.4.0-into-feat-re…
SebastianMarian Aug 30, 2022
56a24c6
notifier http client: added warn message on non-200 http response
ssd04 Aug 30, 2022
39e1d70
* Fixed linter issue
SebastianMarian Aug 30, 2022
ea57eb4
Merge pull request #4413 from ElrondNetwork/fix-linter-issue-in-feat-…
SebastianMarian Aug 30, 2022
b08e740
Merge branch 'rc/v1.4.0' into stub_generator
sstanculeanu Aug 31, 2022
8683eb6
Merge pull request #4407 from ElrondNetwork/remove-mutex-use-in-inter…
gabi-vuls Aug 31, 2022
41d0824
Merge branch 'rc/2022-july' into fix_heartbeats_api_peer_type
gabi-vuls Aug 31, 2022
2bd74ce
Merge pull request #4410 from ElrondNetwork/fix_heartbeats_api_peer_type
sstanculeanu Aug 31, 2022
39c8f2c
Merge branch 'rc/2022-july' into notifier-client-fix-http-error-handling
iulianpascalau Aug 31, 2022
dd4089e
Merge pull request #4024 from ElrondNetwork/feat/refactor-peers-mbs
bogdan-rosianu Aug 31, 2022
0fca8a1
Merge branch 'rc/v1.4.0' into stub_generator
sstanculeanu Aug 31, 2022
e3d6c57
- optimized peer authentication messages management
iulianpascalau Aug 31, 2022
424fbee
Merge pull request #4368 from ElrondNetwork/stub_generator
sstanculeanu Aug 31, 2022
5d02a5e
send pk on heartbeatv2 message
sstanculeanu Aug 31, 2022
409531a
fix meta genesis block
miiu96 Aug 31, 2022
c609920
request txs only from data store with id = shard and exclude the ones…
sstanculeanu Aug 31, 2022
7a815f6
- added prints
iulianpascalau Aug 31, 2022
c65295e
fix tests as well
sstanculeanu Aug 31, 2022
6c65afe
-fixed existing print
iulianpascalau Aug 31, 2022
7805682
fix after review, replaced assert condition
sstanculeanu Aug 31, 2022
e71d3d9
- fixed tests
iulianpascalau Aug 31, 2022
a07521c
- simplified interceptedHeartbeat.go
iulianpascalau Aug 31, 2022
db41f5c
- fixed timeCacher.go to properly use a put function not upsert
iulianpascalau Aug 31, 2022
5243547
- fixed condition
iulianpascalau Aug 31, 2022
7752f8c
- simplified peerShardMapper
iulianpascalau Aug 31, 2022
8816bd7
Merge pull request #4424 from ElrondNetwork/fix_duplicates_on_txpool_api
gabi-vuls Aug 31, 2022
809d9c7
Merge branch 'rc/2022-july' into optimize-peer-auth-messages-management
sstanculeanu Aug 31, 2022
36d9af2
Merge branch 'rc/2022-july' into fix-indexing-part-of-genesis-block
miiu96 Aug 31, 2022
81024e1
- fix after review: minir refactoring + added more unit tests
iulianpascalau Aug 31, 2022
e4dc56e
- fix after review
iulianpascalau Aug 31, 2022
cd22164
Merge branch 'rc/2022-july' into pk_on_hbv2
sstanculeanu Aug 31, 2022
440f0ac
- fix after review: fixed comment
iulianpascalau Aug 31, 2022
1690b1e
- added peerAuthenticationPayloadValidator component and integrated i…
iulianpascalau Aug 31, 2022
5653c7a
- added integration test for the peer authentication message expiry e…
iulianpascalau Sep 1, 2022
8f960bd
Merge pull request #4421 from ElrondNetwork/pk_on_hbv2
gabi-vuls Sep 1, 2022
3b74080
Merge branch 'rc/2022-july' into optimize-peer-auth-messages-management
iulianpascalau Sep 1, 2022
53ab920
Merge branch 'rc/2022-july' into fix-indexing-part-of-genesis-block
miiu96 Sep 1, 2022
341ab3d
Merge pull request #4420 from ElrondNetwork/optimize-peer-auth-messag…
gabi-vuls Sep 1, 2022
c7d35ff
Merge branch 'rc/2022-july' into peer-auth-validator-in-resolver
iulianpascalau Sep 1, 2022
4251fcf
Merge branch 'rc/2022-july' into fix-indexing-part-of-genesis-block
iulianpascalau Sep 1, 2022
0158930
Merge branch 'rc/2022-july' into notifier-client-fix-http-error-handling
iulianpascalau Sep 1, 2022
c07cdd8
Merge pull request #4412 from ElrondNetwork/notifier-client-fix-http-…
bogdan-rosianu Sep 1, 2022
e6db88b
Merge branch 'rc/2022-july' into peer-auth-validator-in-resolver
iulianpascalau Sep 1, 2022
2e6c553
Merge branch 'rc/2022-july' into fix-indexing-part-of-genesis-block
iulianpascalau Sep 1, 2022
1f8fac0
Merge pull request #4422 from ElrondNetwork/fix-indexing-part-of-gene…
gabi-vuls Sep 1, 2022
cfd4a5a
Merge branch 'rc/2022-july' into peer-auth-validator-in-resolver
gabi-vuls Sep 1, 2022
99efab3
Merge pull request #4427 from ElrondNetwork/peer-auth-validator-in-re…
gabi-vuls Sep 1, 2022
6c072af
- fixed integration tests by correctly setting the heartbeatExpiryTim…
iulianpascalau Sep 2, 2022
b5c57c4
Merge pull request #4432 from ElrondNetwork/fixed-integration-tests
iulianpascalau Sep 2, 2022
97fd589
Merge branch 'rc/2022-july' into merge-rc-july-rc-v1.4.0-2022.09.02
iulianpascalau Sep 2, 2022
52a1ce5
- fixed timing in one unit test
iulianpascalau Sep 2, 2022
77cbb4b
- fixed more timings in integration tests
iulianpascalau Sep 2, 2022
949f96b
- fixed removal condition in heartbeat v2 monitor struct
iulianpascalau Sep 2, 2022
ea9df2b
- adjusted configs
iulianpascalau Sep 2, 2022
1aafa8e
update metrics from heartbeat v2 monitor
sstanculeanu Sep 2, 2022
bfec02a
actually pass AppStatusHandler to monitor
sstanculeanu Sep 2, 2022
23d8ef1
fix data race
sstanculeanu Sep 2, 2022
f652567
Merge branch 'rc/2022-july' into fix_hbv2_metrics_update
sstanculeanu Sep 2, 2022
c329054
Merge pull request #4433 from ElrondNetwork/merge-rc-july-rc-v1.4.0-2…
gabi-vuls Sep 2, 2022
fa3851a
- fixed heartbeat message timestamp
iulianpascalau Sep 2, 2022
108686d
fix after review - added go routine which periodically updates the co…
sstanculeanu Sep 2, 2022
17de6df
fixed mock deadlock + cover Close in tests
sstanculeanu Sep 2, 2022
bb12a7b
added missing metrics update on hbv2 sender + simplified test
sstanculeanu Sep 2, 2022
821ff0a
Merge pull request #4437 from ElrondNetwork/fix_hbv2_metrics_update
iulianpascalau Sep 3, 2022
59b1290
- reverted config
iulianpascalau Sep 3, 2022
9104dbc
- removed the "request in chunks peer authentication messages" feature
iulianpascalau Sep 3, 2022
f4737cf
- termui interface changes to reflect the new data returned
iulianpascalau Sep 3, 2022
079d415
- stop the hb v1 monitor's go routine at the disabled epoch
iulianpascalau Sep 3, 2022
5c7b585
- added & integrated heartbeat metrics updater
iulianpascalau Sep 3, 2022
916181a
- refactored the timerCacher implementation to notify "adding" handle…
iulianpascalau Sep 3, 2022
989a494
Temporarily (sandbox) pause processing while snapshotting is on.
andreibancioiu Sep 3, 2022
7a9f4af
Merge pull request #4436 from ElrondNetwork/fix-hb-v2-monitor
iulianpascalau Sep 3, 2022
2acf1fa
Merge branch 'feat/heartbeat-fixes' into further-hb-v2-fixes
iulianpascalau Sep 3, 2022
fd2280a
- fixed race condition in unit tests
iulianpascalau Sep 4, 2022
7202560
- fixed tests
iulianpascalau Sep 4, 2022
d518723
Merge remote-tracking branch 'origin/further-hb-v2-fixes' into furthe…
iulianpascalau Sep 4, 2022
ebd29c0
- more tests fixes
iulianpascalau Sep 4, 2022
984d9bf
Bump github.com/urfave/cli from 1.22.9 to 1.22.10
dependabot[bot] Sep 5, 2022
d25ca74
Sketch new flag: --disable-consensus-watchdog.
andreibancioiu Sep 5, 2022
a5c9280
Add new flag: --serialize-snapshots.
andreibancioiu Sep 5, 2022
96320c3
Fix tests.
andreibancioiu Sep 5, 2022
2e3240b
Merge pull request #4440 from ElrondNetwork/sandbox-snapshotting
gabi-vuls Sep 7, 2022
48b16f9
Merge branch 'development' into dev-to-rc-v1.4.0-2022.09.07
iulianpascalau Sep 7, 2022
57326eb
Merge remote-tracking branch 'origin/development' into open-more-dbs-…
BeniaminDrasovean Sep 7, 2022
d4b5983
fix after merge
BeniaminDrasovean Sep 7, 2022
c6101b4
Merge pull request #4443 from ElrondNetwork/dev-to-rc-v1.4.0-2022.09.07
iulianpascalau Sep 7, 2022
d1d7d2f
Merge branch 'rc/v1.4.0' into dependabot/go_modules/development/githu…
iulianpascalau Sep 7, 2022
675c3e3
Merge branch 'rc/v1.4.0' into open-more-dbs-if-necessary
BeniaminDrasovean Sep 7, 2022
2e2cb37
- fixes after review
iulianpascalau Sep 7, 2022
b6df88b
Merge pull request #4439 from ElrondNetwork/further-hb-v2-fixes
iulianpascalau Sep 7, 2022
fd58f9b
Merge branch 'rc/2022-july' into update-hb-fixes-2022.09.07
iulianpascalau Sep 7, 2022
36ce3f7
Merge pull request #4444 from ElrondNetwork/update-hb-fixes-2022.09.07
iulianpascalau Sep 7, 2022
e4efa09
Merge branch 'rc/v1.4.0' into dependabot/go_modules/development/githu…
iulianpascalau Sep 9, 2022
8f73599
Merge branch 'rc/v1.4.0' into process-debug-handler
iulianpascalau Sep 9, 2022
5b0ac6f
Merge branch 'rc/v1.4.0' into skip-snapshot-if-snapshot-in-progress
BeniaminDrasovean Sep 9, 2022
662828d
Merge pull request #4441 from ElrondNetwork/feat/heartbeat-fixes
gabi-vuls Sep 9, 2022
9db5645
Merge branch 'rc/2022-july' into update-rc-v1.4.0-2022.09.09
iulianpascalau Sep 9, 2022
2ae01ab
Merge pull request #4366 from ElrondNetwork/open-more-dbs-if-necessary
BeniaminDrasovean Sep 9, 2022
1ec174d
Merge branch 'rc/v1.4.0' into update-rc-v1.4.0-2022.09.09
iulianpascalau Sep 9, 2022
57c84e2
Merge branch 'rc/v1.4.0' into dependabot/go_modules/development/githu…
iulianpascalau Sep 9, 2022
7c60ea6
- integration fixes and changes in heartbeat v2 components
iulianpascalau Sep 9, 2022
09612ca
Merge branch 'rc/v1.4.0' into skip-snapshot-if-snapshot-in-progress
BeniaminDrasovean Sep 9, 2022
f6f82ab
- race fixes
iulianpascalau Sep 9, 2022
b88b98e
- fixed test
iulianpascalau Sep 9, 2022
f92e704
added missing epoch on requestData while requesting peer authenticati…
sstanculeanu Sep 9, 2022
4226112
Merge pull request #4442 from ElrondNetwork/dependabot/go_modules/dev…
gabi-vuls Sep 9, 2022
78ae97a
Merge branch 'rc/v1.4.0' into update-rc-v1.4.0-2022.09.09
gabi-vuls Sep 9, 2022
b68f53d
Merge pull request #4447 from ElrondNetwork/update-rc-v1.4.0-2022.09.09
iulianpascalau Sep 9, 2022
131e878
Merge pull request #4450 from ElrondNetwork/fix_missing_epoch_on_peer…
gabi-vuls Sep 10, 2022
0fac6b4
Merge remote-tracking branch 'origin/rc/2022-july' into rc/v1.4.0
sstanculeanu Sep 11, 2022
35d49b9
- added log prints whenever an outport driver gets stuck
iulianpascalau Sep 12, 2022
846ff81
- added new unit test
iulianpascalau Sep 12, 2022
9edf78e
Merge branch 'rc/v1.4.0' into dependabot/go_modules/development/githu…
iulianpascalau Sep 12, 2022
b1a9140
Merge branch 'rc/v1.4.0' into process-debug-handler
iulianpascalau Sep 12, 2022
3040213
log txhash as well for too long sc calls
bogdan-rosianu Sep 12, 2022
ba9bcb2
fix after review: remove sanity checks
bogdan-rosianu Sep 12, 2022
ff936b2
Merge pull request #4451 from ElrondNetwork/merge_rc_july_into_rc_1.4…
gabi-vuls Sep 12, 2022
e50fe5e
save trie node to previous storer if missing
BeniaminDrasovean Sep 13, 2022
e60e6ca
Merge branch 'rc/v1.4.0' into snapshot-improvement
BeniaminDrasovean Sep 13, 2022
0ddd82b
Merge remote-tracking branch 'origin/rc/v1.4.0' into skip-snapshot-if…
BeniaminDrasovean Sep 13, 2022
8e84a1d
fix after merge
BeniaminDrasovean Sep 13, 2022
fd20734
Merge branch 'rc/v1.4.0' into skip-snapshot-if-snapshot-in-progress
BeniaminDrasovean Sep 13, 2022
55a1dfc
fix epoch underflow
BeniaminDrasovean Sep 13, 2022
d6d9bc8
Merge branch 'rc/v1.4.0' into outport-driver-stuck-prints
iulianpascalau Sep 13, 2022
dfbf79f
fix after review: log txhash in more places
bogdan-rosianu Sep 13, 2022
0e4f225
add log.Trace for missing hash Put
BeniaminDrasovean Sep 13, 2022
8c37efd
Merge branch 'rc/v1.4.0' into log-txhash-for-too-long-sc-calls
bogdan-rosianu Sep 13, 2022
7888a44
Merge branch 'rc/v1.4.0' into dependabot/go_modules/development/githu…
gabi-vuls Sep 13, 2022
9f0c489
- added message counter
iulianpascalau Sep 13, 2022
791ea86
- switched log level to warn
iulianpascalau Sep 13, 2022
66e6f53
Merge branch 'rc/v1.4.0' into process-debug-handler
iulianpascalau Sep 14, 2022
fa98e7c
Merge pull request #4456 from ElrondNetwork/log-txhash-for-too-long-s…
gabi-vuls Sep 14, 2022
5b11a82
Merge branch 'rc/v1.4.0' into snapshot-improvement
gabi-vuls Sep 14, 2022
90bd65a
Merge pull request #4459 from ElrondNetwork/snapshot-improvement
BeniaminDrasovean Sep 14, 2022
dc680b2
Merge branch 'rc/v1.4.0' into process-debug-handler
iulianpascalau Sep 14, 2022
ed4d26e
Merge branch 'rc/v1.4.0' into skip-snapshot-if-snapshot-in-progress
BeniaminDrasovean Sep 14, 2022
99e11bb
Merge branch 'rc/v1.4.0' into outport-driver-stuck-prints
gabi-vuls Sep 14, 2022
326726a
Merge pull request #4288 from ElrondNetwork/process-debug-handler
iulianpascalau Sep 14, 2022
731530c
Merge branch 'rc/v1.4.0' into skip-snapshot-if-snapshot-in-progress
BeniaminDrasovean Sep 14, 2022
d76bffb
Merge branch 'rc/v1.4.0' into outport-driver-stuck-prints
iulianpascalau Sep 14, 2022
a72b09a
Merge pull request #4404 from ElrondNetwork/skip-snapshot-if-snapshot…
BeniaminDrasovean Sep 14, 2022
7d806e2
Merge branch 'rc/v1.4.0' into outport-driver-stuck-prints
iulianpascalau Sep 14, 2022
27567a0
Merge pull request #4452 from ElrondNetwork/outport-driver-stuck-prints
iulianpascalau Sep 14, 2022
95e5203
Merge branch 'rc/v1.4.0' into dependabot/go_modules/development/githu…
iulianpascalau Sep 14, 2022
05f6f1d
Merge pull request #4271 from ElrondNetwork/dependabot/go_modules/dev…
iulianpascalau Sep 14, 2022
52da3a3
Merge branch 'rc/v1.4.0' into merge-rc1.4-feat-elrond-go-storage
AdoAdoAdo Sep 15, 2022
06f259e
updated elrond-go-storage version with some fixes
AdoAdoAdo Sep 16, 2022
28a9823
reference new elrond-go-storage version
AdoAdoAdo Sep 16, 2022
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
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions api/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ var ErrGetBalance = errors.New("get balance error")
// ErrGetUsername signals an error in getting the username for an account
var ErrGetUsername = errors.New("get username error")

// ErrGetCodeHash signals an error in getting the code hash for an account
var ErrGetCodeHash = errors.New("get code hash error")

// ErrGetValueForKey signals an error in getting the value of a key for an account
var ErrGetValueForKey = errors.New("get value for key error")

Expand Down
93 changes: 56 additions & 37 deletions api/groups/addressGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const (
getAccountPath = "/:address"
getBalancePath = "/:address/balance"
getUsernamePath = "/:address/username"
getCodeHashPath = "/:address/code-hash"
getKeysPath = "/:address/keys"
getKeyPath = "/:address/key/:key"
getESDTTokensPath = "/:address/esdt"
Expand All @@ -30,12 +31,17 @@ const (
getESDTNFTDataPath = "/:address/nft/:tokenIdentifier/nonce/:nonce"
urlParamOnFinalBlock = "onFinalBlock"
urlParamOnStartOfEpoch = "onStartOfEpoch"
urlParamBlockNonce = "blockNonce"
urlParamBlockHash = "blockHash"
urlParamBlockRootHash = "blockRootHash"
urlParamHintEpoch = "hintEpoch"
)

// addressFacadeHandler defines the methods to be implemented by a facade for handling address requests
type addressFacadeHandler interface {
GetBalance(address string, options api.AccountQueryOptions) (*big.Int, api.BlockInfo, error)
GetUsername(address string, options api.AccountQueryOptions) (string, api.BlockInfo, error)
GetCodeHash(address string, options api.AccountQueryOptions) ([]byte, api.BlockInfo, error)
GetValueForKey(address string, key string, options api.AccountQueryOptions) (string, api.BlockInfo, error)
GetAccount(address string, options api.AccountQueryOptions) (api.AccountResponse, api.BlockInfo, error)
GetESDTData(address string, key string, nonce uint64, options api.AccountQueryOptions) (*esdt.ESDigitalToken, api.BlockInfo, error)
Expand Down Expand Up @@ -99,6 +105,11 @@ func NewAddressGroup(facade addressFacadeHandler) (*addressGroup, error) {
Method: http.MethodGet,
Handler: ag.getUsername,
},
{
Path: getCodeHashPath,
Method: http.MethodGet,
Handler: ag.getCodeHash,
},
{
Path: getKeyPath,
Method: http.MethodGet,
Expand Down Expand Up @@ -153,9 +164,9 @@ func (ag *addressGroup) getAccount(c *gin.Context) {
return
}

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

Expand All @@ -177,9 +188,9 @@ func (ag *addressGroup) getBalance(c *gin.Context) {
return
}

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

Expand All @@ -200,9 +211,9 @@ func (ag *addressGroup) getUsername(c *gin.Context) {
return
}

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

Expand All @@ -215,6 +226,29 @@ func (ag *addressGroup) getUsername(c *gin.Context) {
shared.RespondWithSuccess(c, gin.H{"username": userName, "blockInfo": blockInfo})
}

// getCodeHash returns the code hash for the address parameter
func (ag *addressGroup) getCodeHash(c *gin.Context) {
addr := c.Param("address")
if addr == "" {
shared.RespondWithValidationError(c, errors.ErrGetCodeHash, errors.ErrEmptyAddress)
return
}

options, err := parseAccountQueryOptions(c)
if err != nil {
shared.RespondWithValidationError(c, errors.ErrGetCodeHash, errors.ErrBadUrlParams)
return
}

codeHash, blockInfo, err := ag.getFacade().GetCodeHash(addr, options)
if err != nil {
shared.RespondWithInternalError(c, errors.ErrGetCodeHash, err)
return
}

shared.RespondWithSuccess(c, gin.H{"codeHash": codeHash, "blockInfo": blockInfo})
}

// getValueForKey returns the value for the given address and key
func (ag *addressGroup) getValueForKey(c *gin.Context) {
addr := c.Param("address")
Expand All @@ -223,9 +257,9 @@ func (ag *addressGroup) getValueForKey(c *gin.Context) {
return
}

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

Expand All @@ -252,9 +286,9 @@ func (ag *addressGroup) getKeyValuePairs(c *gin.Context) {
return
}

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

Expand All @@ -275,9 +309,9 @@ func (ag *addressGroup) getESDTBalance(c *gin.Context) {
return
}

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

Expand Down Expand Up @@ -310,9 +344,9 @@ func (ag *addressGroup) getESDTsRoles(c *gin.Context) {
return
}

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

Expand All @@ -333,9 +367,9 @@ func (ag *addressGroup) getESDTTokensWithRole(c *gin.Context) {
return
}

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

Expand Down Expand Up @@ -367,9 +401,9 @@ func (ag *addressGroup) getNFTTokenIDsRegisteredByAddress(c *gin.Context) {
return
}

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

Expand All @@ -390,9 +424,9 @@ func (ag *addressGroup) getESDTNFTData(c *gin.Context) {
return
}

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

Expand Down Expand Up @@ -432,9 +466,9 @@ func (ag *addressGroup) getAllESDTData(c *gin.Context) {
return
}

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

Expand Down Expand Up @@ -501,18 +535,3 @@ func (ag *addressGroup) UpdateFacade(newFacade interface{}) error {
func (ag *addressGroup) IsInterfaceNil() bool {
return ag == nil
}

func parseAccountQueryOptions(c *gin.Context) (api.AccountQueryOptions, error) {
onFinalBlock, err := parseBoolUrlParam(c, urlParamOnFinalBlock)
if err != nil {
return api.AccountQueryOptions{}, err
}

onStartOfEpoch, err := parseUintUrlParam(c, urlParamOnStartOfEpoch)
if err != nil {
return api.AccountQueryOptions{}, err
}

options := api.AccountQueryOptions{OnFinalBlock: onFinalBlock, OnStartOfEpoch: uint32(onStartOfEpoch)}
return options, nil
}
95 changes: 95 additions & 0 deletions api/groups/addressGroupOptions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package groups

import (
"errors"
"fmt"

"github.com/ElrondNetwork/elrond-go-core/data/api"
customErrors "github.com/ElrondNetwork/elrond-go/api/errors"
"github.com/gin-gonic/gin"
)

func extractAccountQueryOptions(c *gin.Context) (api.AccountQueryOptions, error) {
options, err := parseAccountQueryOptions(c)
if err != nil {
return api.AccountQueryOptions{}, fmt.Errorf("%w: %v", customErrors.ErrBadUrlParams, err)
}

err = checkAccountQueryOptions(options)
if err != nil {
return api.AccountQueryOptions{}, fmt.Errorf("%w: %v", customErrors.ErrBadUrlParams, err)
}

return options, nil
}

func parseAccountQueryOptions(c *gin.Context) (api.AccountQueryOptions, error) {
onFinalBlock, err := parseBoolUrlParam(c, urlParamOnFinalBlock)
if err != nil {
return api.AccountQueryOptions{}, err
}

onStartOfEpoch, err := parseUint32UrlParam(c, urlParamOnStartOfEpoch)
if err != nil {
return api.AccountQueryOptions{}, err
}

blockNonce, err := parseUint64UrlParam(c, urlParamBlockNonce)
if err != nil {
return api.AccountQueryOptions{}, err
}

blockHash, err := parseHexBytesUrlParam(c, urlParamBlockHash)
if err != nil {
return api.AccountQueryOptions{}, err
}

blockRootHash, err := parseHexBytesUrlParam(c, urlParamBlockRootHash)
if err != nil {
return api.AccountQueryOptions{}, err
}

hintEpoch, err := parseUint32UrlParam(c, urlParamHintEpoch)
if err != nil {
return api.AccountQueryOptions{}, err
}

options := api.AccountQueryOptions{
OnFinalBlock: onFinalBlock,
OnStartOfEpoch: onStartOfEpoch,
BlockNonce: blockNonce,
BlockHash: blockHash,
BlockRootHash: blockRootHash,
HintEpoch: hintEpoch,
}
return options, nil
}

func checkAccountQueryOptions(options api.AccountQueryOptions) error {
numSpecifiedBlockCoordinates := 0

if options.BlockNonce.HasValue {
numSpecifiedBlockCoordinates++
}
if len(options.BlockHash) > 0 {
numSpecifiedBlockCoordinates++
}
if len(options.BlockRootHash) > 0 {
numSpecifiedBlockCoordinates++
}

if numSpecifiedBlockCoordinates > 1 {
return errors.New("only one block coordinate (blockNonce vs. blockHash vs. blockRootHash) can be specified at a time")
}
if options.OnFinalBlock && numSpecifiedBlockCoordinates > 0 {
return errors.New("onFinalBlock is not compatible with any other block coordinates")
}
if options.OnStartOfEpoch.HasValue && numSpecifiedBlockCoordinates > 0 {
return errors.New("onStartOfEpoch is not compatible with any other block coordinates")
}
if options.HintEpoch.HasValue && len(options.BlockRootHash) == 0 {
return errors.New("hintEpoch is optional, but only compatible with blockRootHash")
}

return nil
}
66 changes: 66 additions & 0 deletions api/groups/addressGroupOptions_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package groups

import (
"testing"

"github.com/ElrondNetwork/elrond-go-core/core"
"github.com/ElrondNetwork/elrond-go-core/data/api"
"github.com/ElrondNetwork/elrond-go/testscommon"
"github.com/stretchr/testify/require"
)

func TestExtractAccountQueryOptions(t *testing.T) {
t.Run("good options", func(t *testing.T) {
options, err := extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("onFinalBlock=true"))
require.Nil(t, err)
require.True(t, options.OnFinalBlock)

options, err = extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("onStartOfEpoch=7"))
require.Nil(t, err)
require.Equal(t, core.OptionalUint32{Value: 7, HasValue: true}, options.OnStartOfEpoch)

options, err = extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("blockNonce=42"))
require.Nil(t, err)
require.Equal(t, core.OptionalUint64{Value: 42, HasValue: true}, options.BlockNonce)

options, err = extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("blockHash=aaaa"))
require.Nil(t, err)
require.Equal(t, []byte{0xaa, 0xaa}, options.BlockHash)

options, err = extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("blockHash=aaaa"))
require.Nil(t, err)
require.Equal(t, []byte{0xaa, 0xaa}, options.BlockHash)

options, err = extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("blockRootHash=bbbb&hintEpoch=7"))
require.Nil(t, err)
require.Equal(t, []byte{0xbb, 0xbb}, options.BlockRootHash)
require.Equal(t, uint32(7), options.HintEpoch.Value)
})

t.Run("bad options", func(t *testing.T) {
options, err := extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("blockNonce=42&blockHash=aaaa"))
require.ErrorContains(t, err, "only one block coordinate")
require.Equal(t, api.AccountQueryOptions{}, options)

options, err = extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("blockHash=aaaa&blockRootHash=bbbb"))
require.ErrorContains(t, err, "only one block coordinate")
require.Equal(t, api.AccountQueryOptions{}, options)

options, err = extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("onFinalBlock=true&blockHash=aaaa"))
require.ErrorContains(t, err, "onFinalBlock is not compatible")
require.Equal(t, api.AccountQueryOptions{}, options)

options, err = extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("onStartOfEpoch=7&blockRootHash=bbbb"))
require.ErrorContains(t, err, "onStartOfEpoch is not compatible")
require.Equal(t, api.AccountQueryOptions{}, options)

options, err = extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("onFinalBlock=true&hintEpoch=7"))
require.ErrorContains(t, err, "hintEpoch is optional, but only compatible with blockRootHash")
require.Equal(t, api.AccountQueryOptions{}, options)

options, err = extractAccountQueryOptions(testscommon.CreateGinContextWithRawQuery("blockHash=aaaa&hintEpoch=7"))
require.ErrorContains(t, err, "hintEpoch is optional, but only compatible with blockRootHash")
require.Equal(t, api.AccountQueryOptions{}, options)

})
}
Loading