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

Feat/HeartbeatV2 #3736

Merged
merged 273 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
a8df99f
added heartbeatInterceptorProcessor
sstanculeanu Feb 7, 2022
0945fde
removed test method
sstanculeanu Feb 7, 2022
8131c1e
Merge pull request #3745 from ElrondNetwork/interceptors-factories
sstanculeanu Feb 7, 2022
8e75c02
Merge branch 'feat/heartbeat-v2' into resolvers
sstanculeanu Feb 7, 2022
4f600d7
Merge branch 'resolvers' of https://github.com/ElrondNetwork/elrond-g…
sstanculeanu Feb 7, 2022
6a36170
fixes after review
sstanculeanu Feb 7, 2022
d6fb1a2
fixes after review
sstanculeanu Feb 8, 2022
19833ce
Merge branch 'resolvers' of https://github.com/ElrondNetwork/elrond-g…
sstanculeanu Feb 8, 2022
ac2b174
small tests fixes
sstanculeanu Feb 8, 2022
caaf55d
Merge pull request #3749 from ElrondNetwork/resolvers
iulianpascalau Feb 8, 2022
0088926
fixed race condition
sstanculeanu Feb 8, 2022
67ea969
Merge branch 'feat/heartbeat-v2' into processor
sstanculeanu Feb 8, 2022
eacc631
fixed multiple data races and tests fixes
sstanculeanu Feb 8, 2022
9938e67
Merge remote-tracking branch 'origin/processor' into processor
sstanculeanu Feb 8, 2022
997856e
added generate methods to create multi data interceptors
sstanculeanu Feb 8, 2022
a6d6b7d
fixes after review: unexported structs + fixed casts
sstanculeanu Feb 8, 2022
d2154f5
Merge branch 'processor' of https://github.com/ElrondNetwork/elrond-g…
sstanculeanu Feb 8, 2022
d0557bb
removed calls which were moved to other tests
sstanculeanu Feb 8, 2022
c041125
removed calls which were moved to other tests
sstanculeanu Feb 8, 2022
0964d56
fixed typos
sstanculeanu Feb 8, 2022
04cc1e1
Merge branch 'processor' of https://github.com/ElrondNetwork/elrond-g…
sstanculeanu Feb 8, 2022
428b592
Merge branch 'development' into update-dev-2022.02.08
iulianpascalau Feb 8, 2022
9d0a8f9
Merge pull request #3769 from ElrondNetwork/update-dev-2022.02.08
iulianpascalau Feb 8, 2022
84709d8
Merge branch 'feat/heartbeat-v2' into processor
sstanculeanu Feb 8, 2022
a1d2250
Merge pull request #3759 from ElrondNetwork/processor
sstanculeanu Feb 8, 2022
b64c25f
Merge branch 'feat/heartbeat-v2' into processors-integration
sstanculeanu Feb 8, 2022
43e687b
- added peer authentication sender
iulianpascalau Feb 8, 2022
ff554a6
- fixes
iulianpascalau Feb 8, 2022
d65f11f
Merge branch 'feat/heartbeat-v2' into peer-authentication-sender
iulianpascalau Feb 8, 2022
6050918
- fix after review: add t.Run for test checks
iulianpascalau Feb 9, 2022
5ad2e13
added mapTimeCache and SweepHandler interface
sstanculeanu Feb 9, 2022
cde736d
new line at eof
sstanculeanu Feb 9, 2022
edcb245
fixes after review
sstanculeanu Feb 10, 2022
8ff363f
added missing error handling
sstanculeanu Feb 10, 2022
b2e66e2
fixed config and call to Close
sstanculeanu Feb 10, 2022
6ddcb1e
- fixed comment
iulianpascalau Feb 11, 2022
1096f24
fixed maxint issue
sstanculeanu Feb 11, 2022
7a9617d
Merge pull request #3771 from ElrondNetwork/peer-authentication-sender
sstanculeanu Feb 11, 2022
156aaf5
Merge branch 'feat/heartbeat-v2' into processors-integration
sstanculeanu Feb 11, 2022
99c8caa
fixes after review
sstanculeanu Feb 11, 2022
5f674d4
added Close to dataPool in order to properly close the components
sstanculeanu Feb 11, 2022
a2028b8
fix after review
sstanculeanu Feb 11, 2022
14f0732
fix after review
sstanculeanu Feb 11, 2022
6cc6bbe
integrated few heartbeatv2 components
sstanculeanu Feb 11, 2022
12d3610
updated arg type
sstanculeanu Feb 11, 2022
ec9e1dd
Merge pull request #3765 from ElrondNetwork/processors-integration
iulianpascalau Feb 11, 2022
e64fdf5
Merge branch 'feat/heartbeat-v2' into components-integration
sstanculeanu Feb 11, 2022
6ec82de
Merge pull request #3786 from ElrondNetwork/components-integration
iulianpascalau Feb 14, 2022
548569a
Merge branch 'development' into update-dev-hb-2022.02.14
iulianpascalau Feb 14, 2022
91772bb
Merge pull request #3788 from ElrondNetwork/update-dev-hb-2022.02.14
iulianpascalau Feb 14, 2022
fd30e01
added heartbeat sender
sstanculeanu Feb 14, 2022
07bdd46
fixes after self review
sstanculeanu Feb 14, 2022
ebe9d4b
fixed small typo in routineHandler
sstanculeanu Feb 14, 2022
ca4e24d
added Sender component which creates the internal routine handler wit…
sstanculeanu Feb 14, 2022
a9040c9
added heartbeatV2Components + handler
sstanculeanu Feb 14, 2022
a423efc
fix indentation
sstanculeanu Feb 14, 2022
3323641
fix after review
sstanculeanu Feb 15, 2022
4518e18
Merge branch 'heartbeat-sender' of https://github.com/ElrondNetwork/e…
sstanculeanu Feb 15, 2022
c80fd0a
integrated heartbeatV2Components into node runner
sstanculeanu Feb 15, 2022
91ccb8d
integrated peer authentication resolver
sstanculeanu Feb 15, 2022
ec38a05
fix after review: renamed ShouldExecute to ExecutionReadyChannel
sstanculeanu Feb 15, 2022
630a005
Merge remote-tracking branch 'origin/heartbeat-sender' into heartbeat…
sstanculeanu Feb 15, 2022
0116621
Merge pull request #3790 from ElrondNetwork/heartbeat-sender
iulianpascalau Feb 16, 2022
914d6af
Merge branch 'feat/heartbeat-v2' into senders-integration
sstanculeanu Feb 16, 2022
926d9da
added randomness to duration between sends
sstanculeanu Feb 16, 2022
88d3f2a
added missing baseSender_test file
sstanculeanu Feb 16, 2022
2d80691
Merge branch 'feat/heartbeat-v2' into resolver-integration
sstanculeanu Feb 16, 2022
9f80545
integrated peer auth resolver into request handler
sstanculeanu Feb 16, 2022
ee5fa54
fix after review
sstanculeanu Feb 17, 2022
8c9a7bb
added PeerAuthenticationRequestsProcessor
sstanculeanu Feb 17, 2022
064e33f
fixed typo and tests data races
sstanculeanu Feb 17, 2022
d7c5f8f
added extra check
sstanculeanu Feb 17, 2022
aed4339
fixes after review
sstanculeanu Feb 17, 2022
850396f
Merge pull request #3794 from ElrondNetwork/senders-integration
sstanculeanu Feb 18, 2022
1191e2d
Merge branch 'feat/heartbeat-v2' into resolver-integration
sstanculeanu Feb 18, 2022
44b1588
fixed indentation
sstanculeanu Feb 18, 2022
4f719d8
Merge branch 'resolver-integration' of https://github.com/ElrondNetwo…
sstanculeanu Feb 18, 2022
c7d7999
added getRandMaxMissingKeys in order to return only some missing keys
sstanculeanu Feb 18, 2022
15191af
added integration to heartbeatV2Components
sstanculeanu Feb 18, 2022
d4ea334
moved randomizer to constructor
sstanculeanu Feb 18, 2022
b4a21d2
Merge remote-tracking branch 'origin/peer-auth-processor' into peer-a…
sstanculeanu Feb 18, 2022
bc32339
updated to MaxMissingKeysInRequest in all occurences
sstanculeanu Feb 18, 2022
27bc2d9
fixed tests
sstanculeanu Feb 18, 2022
1374678
create topics
sstanculeanu Feb 18, 2022
6772b82
Merge pull request #3802 from ElrondNetwork/resolver-integration
sstanculeanu Feb 21, 2022
3b771fd
Merge branch 'feat/heartbeat-v2' into peer-auth-processor
sstanculeanu Feb 21, 2022
d1524a6
Merge pull request #3816 from ElrondNetwork/peer-auth-processor
sstanculeanu Feb 21, 2022
90530f3
added integration test where all peers send messages
sstanculeanu Feb 21, 2022
a36a770
added new integration test with node connecting late and requesting m…
sstanculeanu Feb 22, 2022
fd3f103
small code cleanup + improved checks on tests
sstanculeanu Feb 22, 2022
38e029c
extra test with 8 nodes
sstanculeanu Feb 22, 2022
9359d35
added extra delayed node
sstanculeanu Feb 22, 2022
f30da53
first draft of the monitor
sstanculeanu Feb 24, 2022
868edd4
removed unused param
sstanculeanu Feb 24, 2022
1c7adc2
finished heartbeatV2Monitor implementation
sstanculeanu Feb 25, 2022
4b1c01e
modified integration tests for heartbeat as per code review suggestions
sstanculeanu Mar 1, 2022
fbb90c2
fixes after review
sstanculeanu Mar 2, 2022
52899d4
Update dataRetriever/resolvers/peerAuthenticationResolver.go
sstanculeanu Mar 2, 2022
db10b3d
Merge pull request #3823 from ElrondNetwork/integrationtests
iulianpascalau Mar 2, 2022
3590a77
fixes after review
sstanculeanu Mar 2, 2022
88f3911
Merge branch 'feat/heartbeat-v2' into heartbeatV2-api
sstanculeanu Mar 2, 2022
5975a51
added extra test cases
sstanculeanu Mar 2, 2022
f82de92
- new network sharding integration tests & fixes
iulianpascalau Mar 3, 2022
bc6d3b7
Merge branch 'feat/heartbeat-v2' into network-sharding-new-integratio…
sstanculeanu Mar 3, 2022
30260ae
tests on GetLastKnownPeerID + fix tests on pidQueue
sstanculeanu Mar 3, 2022
59ea8ea
added new constructor for testHeartbeatNode and use it in networkShar…
sstanculeanu Mar 3, 2022
8d0f98c
exported the init method for TestHeartbeatNode in order to be called …
sstanculeanu Mar 3, 2022
0d933e2
added crossShardStatusProcessor which should synchronize the peerShar…
sstanculeanu Mar 7, 2022
82b8b21
updated peerShardMapperStub
sstanculeanu Mar 7, 2022
f8e01d6
small fixes and debugging logs
sstanculeanu Mar 8, 2022
72869ca
fixed crossShardStatusProcessor_test
sstanculeanu Mar 9, 2022
21da95c
fixed logs and added todos
sstanculeanu Mar 10, 2022
5e92cbd
removed extra prints
sstanculeanu Mar 10, 2022
f77a3f3
added flag for disabling heartbeat
sstanculeanu Mar 10, 2022
603a640
fix indentation in toml
sstanculeanu Mar 10, 2022
dd9bf7f
fixes after review
sstanculeanu Mar 10, 2022
bdfe504
fixes after review
sstanculeanu Mar 10, 2022
58a45f2
fixed tests
sstanculeanu Mar 10, 2022
d0a2240
Merge pull request #3868 from ElrondNetwork/network-sharding-new-inte…
sstanculeanu Mar 10, 2022
ea1ca7b
Merge branch 'feat/heartbeat-v2' into heartbeat-flag
sstanculeanu Mar 10, 2022
e59dfc0
- added the possibility to send to a newly connected peer some extra …
iulianpascalau Mar 10, 2022
8596610
Merge branch 'feat/heartbeat-v2' into message-at-connect-time
iulianpascalau Mar 10, 2022
0397133
added integration test to cover the deactivation of heartbeat v1
sstanculeanu Mar 10, 2022
b6b1dda
Merge remote-tracking branch 'origin/heartbeat-flag' into heartbeat-flag
sstanculeanu Mar 10, 2022
735499e
fixes after review
sstanculeanu Mar 11, 2022
4bbe31e
added MetricHeartbeatDisableEpoch as well
sstanculeanu Mar 11, 2022
07cf37c
fixed tests
sstanculeanu Mar 11, 2022
6480e67
- fixes after review: refactored code, renaming
iulianpascalau Mar 14, 2022
540f93f
- renamed print
iulianpascalau Mar 14, 2022
f7db819
Merge pull request #3896 from ElrondNetwork/message-at-connect-time
iulianpascalau Mar 14, 2022
220c30b
fix after review
sstanculeanu Mar 14, 2022
fa59738
Merge branch 'development' into merge-dev-feat-hb-v2-2022.03.14
iulianpascalau Mar 14, 2022
c07171b
- fixes after merge
iulianpascalau Mar 14, 2022
dae8c81
updated times to wait for messages to be broadcasted
sstanculeanu Mar 14, 2022
678c21b
Merge branch 'feat/heartbeat-v2' into heartbeat-flag
iulianpascalau Mar 15, 2022
c4d8d1e
Merge pull request #3895 from ElrondNetwork/heartbeat-flag
iulianpascalau Mar 15, 2022
9948956
Merge branch 'feat/heartbeat-v2' into merge-dev-feat-hb-v2-2022.03.14
iulianpascalau Mar 15, 2022
6ca1408
Merge pull request #3902 from ElrondNetwork/merge-dev-feat-hb-v2-2022…
iulianpascalau Mar 15, 2022
9d64aab
Merge branch 'feat/heartbeat-v2' of https://github.com/ElrondNetwork/…
sstanculeanu Mar 21, 2022
47cc52e
fixed conflicts
sstanculeanu Mar 21, 2022
54ab169
added new interceptor for shardValidatorInfo
sstanculeanu Mar 21, 2022
2287582
replaced crossShardStatusProcessor with connectionsProcessor and remo…
sstanculeanu Mar 22, 2022
d0605a7
added unittests on connectionsProcessor
sstanculeanu Mar 23, 2022
ec98872
node integration
sstanculeanu Mar 23, 2022
4501c72
fixes after review
sstanculeanu Mar 23, 2022
7750384
missing renamings
sstanculeanu Mar 23, 2022
f233584
fixes after review
sstanculeanu Mar 24, 2022
d1f3cc0
Merge pull request #3842 from ElrondNetwork/heartbeatV2-api
iulianpascalau Mar 24, 2022
ff5e796
Merge branch 'feat/heartbeat-v2' into connection-interceptor
sstanculeanu Mar 24, 2022
03dcbbd
fixes after merge + fixes after review
sstanculeanu Mar 24, 2022
cdacbda
fixes after review - modified file name and comment
sstanculeanu Mar 24, 2022
4fc1c4e
Merge pull request #3927 from ElrondNetwork/connection-interceptor
sstanculeanu Mar 24, 2022
583cfea
renamed all occurences of shardValidatorInfo to validatorInfo
sstanculeanu Mar 24, 2022
31bfb46
Merge pull request #3936 from ElrondNetwork/renaming
sstanculeanu Mar 24, 2022
b976460
Merge remote-tracking branch 'origin/development' into merge-dev-feat…
sstanculeanu Mar 24, 2022
2578396
Merge pull request #3937 from ElrondNetwork/merge-dev-feat-hb-v2-2022…
sstanculeanu Mar 24, 2022
c75bf3d
fixed lint issues
sstanculeanu Mar 24, 2022
4a504ba
Merge pull request #3938 from ElrondNetwork/fix-lint
sstanculeanu Mar 25, 2022
4ad018c
added check for validator on peerAuthenticationSender which handles a…
sstanculeanu Mar 25, 2022
8997b8c
added extra test on peerAuthenticationSender to simulate epoch changes
sstanculeanu Mar 25, 2022
16b966d
removed checks and updated isValidator check on peerAuthenticationSender
sstanculeanu Mar 25, 2022
354f994
Merge pull request #3939 from ElrondNetwork/check-validator-on-sender
sstanculeanu Mar 28, 2022
5f7dac8
Merge remote-tracking branch 'origin/development' into merge-dev-into…
sstanculeanu Mar 28, 2022
ab909aa
fixes after merge
sstanculeanu Mar 28, 2022
7a9b3f6
Merge pull request #3941 from ElrondNetwork/merge-dev-into-feat-hb-v2…
sstanculeanu Mar 28, 2022
a1d4fb4
removed nodesCoordinatorStub and use the one from testscommon instead
sstanculeanu Mar 28, 2022
7f67662
use as many testscommon mocks as possible
sstanculeanu Mar 28, 2022
fd41eac
Merge branch 'feat/heartbeat-v2' into use-sharding-mocks-testscommon
sstanculeanu Mar 28, 2022
0791b2c
use marshalizer mocks from testscommon as well
sstanculeanu Mar 28, 2022
977d6f9
Merge remote-tracking branch 'origin/use-sharding-mocks-testscommon' …
sstanculeanu Mar 28, 2022
291fe1e
fixed tests
sstanculeanu Mar 28, 2022
c76dd0b
fixed missing usage of testscommon mocks
sstanculeanu Mar 28, 2022
43bf013
Merge pull request #3942 from ElrondNetwork/use-sharding-mocks-testsc…
sstanculeanu Mar 28, 2022
ced1ab7
fix serialization errors on senders
sstanculeanu Mar 28, 2022
f54d5f2
Merge pull request #3945 from ElrondNetwork/fix-serialization
sstanculeanu Mar 28, 2022
f4b8875
added more checks for connection topic on messenger
sstanculeanu Mar 29, 2022
49896c0
simply skip the topic
sstanculeanu Mar 29, 2022
82eca69
simply skip the topic
sstanculeanu Mar 29, 2022
7f1d55e
added unittests un netMessenger, connection topic and fixed test from…
sstanculeanu Mar 30, 2022
54e1bbe
Merge pull request #3948 from ElrondNetwork/fix-topic-error
sstanculeanu Mar 30, 2022
984f839
integrated hardfork into heartbeat v2
sstanculeanu Mar 31, 2022
3e5029d
added missing tests + small cleanup
sstanculeanu Mar 31, 2022
ffb54ea
fixed tests
sstanculeanu Mar 31, 2022
9114117
fixed long tests and removed WithHardforkTrigger option from node as …
sstanculeanu Apr 1, 2022
ade18e5
integrated new flow for hardfork into hardfork integration test
sstanculeanu Apr 4, 2022
46cf6c1
fixes after review, added exception for hardfork initiator
sstanculeanu Apr 5, 2022
46c6e59
fix tests
sstanculeanu Apr 5, 2022
df555d3
fixes after review - moved hardfork trigger pub key to core components
sstanculeanu Apr 6, 2022
a380ac7
moved peersHolder from elrond-go-core and updated it for heartbeatV2
sstanculeanu Apr 6, 2022
bfc9274
updated comment in prefs.toml
sstanculeanu Apr 6, 2022
a03e13d
fixes after review
sstanculeanu Apr 7, 2022
dfa11f4
fixed hardfork integration test
sstanculeanu Apr 7, 2022
43a566b
Merge pull request #3956 from ElrondNetwork/hardfork-integration
sstanculeanu Apr 8, 2022
4d8dc35
Merge branch 'feat/heartbeat-v2' into preferred-peers-refactor
sstanculeanu Apr 8, 2022
a7c8a45
fixes from review on #3956
sstanculeanu Apr 8, 2022
bebf25b
fixes after review
sstanculeanu Apr 11, 2022
54aeee9
fixes after review + fixed tests
sstanculeanu Apr 11, 2022
c7e7aab
fix after review: remove data from map only when available
sstanculeanu Apr 12, 2022
38275dd
Merge pull request #3974 from ElrondNetwork/preferred-peers-refactor
sstanculeanu Apr 12, 2022
08ccd4a
Merge remote-tracking branch 'origin/development' into merge-dev-into…
sstanculeanu Apr 12, 2022
57b897f
fix after merge
sstanculeanu Apr 12, 2022
49a44f2
Merge pull request #3981 from ElrondNetwork/merge-dev-into-feat-heart…
sstanculeanu Apr 12, 2022
e469d32
fix prefs.toml PreferredConnections comment
sstanculeanu Apr 14, 2022
f3445b7
Merge pull request #3989 from ElrondNetwork/fix-comments
sstanculeanu Apr 14, 2022
8ad9020
added missing check on MinPeersThreshold which does not allow values …
sstanculeanu Apr 26, 2022
1c849ff
Merge pull request #4018 from ElrondNetwork/missing_arg_check
sstanculeanu Apr 26, 2022
4842629
Merge remote-tracking branch 'origin/development' into merge-dev-into…
sstanculeanu Apr 26, 2022
f7ac7c4
fixes after merge
sstanculeanu Apr 26, 2022
a571f07
Merge pull request #4021 from ElrondNetwork/merge-dev-into-feat-heart…
sstanculeanu Apr 27, 2022
6f99e5d
fixed reference issue
sstanculeanu May 2, 2022
b08519a
fixed logs and other marshal issues
sstanculeanu May 2, 2022
32040fc
skip min size check on heartbeat messages as this may cause messages …
sstanculeanu May 2, 2022
7641a33
fix after review
sstanculeanu May 3, 2022
9a5ec2b
Merge pull request #4042 from ElrondNetwork/bugfix_heartbeatv2
sstanculeanu May 3, 2022
bd8bd88
Merge remote-tracking branch 'origin/development' into merge-dev-into…
sstanculeanu May 3, 2022
3e9491c
fixes after merge
sstanculeanu May 3, 2022
86b0619
Merge pull request #4046 from ElrondNetwork/merge-dev-into-feat-heart…
sstanculeanu May 3, 2022
062e10a
Merge remote-tracking branch 'origin/development' into merge-dev-into…
sstanculeanu May 3, 2022
d51ef43
Merge pull request #4048 from ElrondNetwork/merge-dev-into-heartbeat-…
sstanculeanu May 3, 2022
b35daf4
fix after merge - fix tests
sstanculeanu May 3, 2022
2b5d7bb
Merge pull request #4051 from ElrondNetwork/fix-tests
sstanculeanu May 3, 2022
ca1cd5e
renamed ShardValidatorInfo to DirectConnectionInfo as it collides to …
sstanculeanu May 9, 2022
1e69d73
added dataPacker on peerAuthenticationResolver
sstanculeanu May 9, 2022
b8a58f3
added counter of requested hashes on RequestPeerAuthenticationsByHash…
sstanculeanu May 9, 2022
0f8deae
fixes some small issues incompatible with gogoprotomarshalizer
sstanculeanu May 9, 2022
e4db1f6
fixed typo after self review
sstanculeanu May 9, 2022
05472a0
fixed missing renaming
sstanculeanu May 9, 2022
ead06db
minimized the time between requests
sstanculeanu May 9, 2022
245dc25
removed whitelist mechanism on peer authentications as the hashes are…
sstanculeanu May 10, 2022
30d3761
send heartbeat messages on proper topic
sstanculeanu May 10, 2022
cb7b1b5
itoa to fmt.sprintf
sstanculeanu May 10, 2022
6325523
use pid from peer auth message, not the one from the peer received
sstanculeanu May 12, 2022
8d96dfb
added new topics to antiflood in order to allow messages after restart
sstanculeanu May 12, 2022
87455ea
Merge remote-tracking branch 'origin/development' into merge-dev-into…
sstanculeanu May 12, 2022
81b8dcc
Merge pull request #4074 from ElrondNetwork/merge-dev-into-feat-heart…
sstanculeanu May 12, 2022
46c2372
Merge branch 'feat/heartbeat-v2' into improvements
sstanculeanu May 12, 2022
1ee6e3c
fixed cast issue on heartbeat v2 monitor
sstanculeanu May 13, 2022
29d1ea8
Merge remote-tracking branch 'origin/improvements' into improvements
sstanculeanu May 13, 2022
dcc9938
fix parse int issue on meta shard
sstanculeanu May 16, 2022
67c68d6
no need to use ParseInt for shard
sstanculeanu May 16, 2022
72794ec
fixed monitor tests
sstanculeanu May 16, 2022
84ed722
fixes after review
sstanculeanu May 17, 2022
1e6dc85
Merge pull request #4064 from ElrondNetwork/improvements
sstanculeanu May 17, 2022
5647c83
Merge remote-tracking branch 'origin/development' into merge-dev-into…
sstanculeanu May 17, 2022
bd18484
Merge pull request #4084 from ElrondNetwork/merge-dev-into-feat-heart…
sstanculeanu May 17, 2022
d26088a
fixed long tests
sstanculeanu May 17, 2022
d7d0a63
Merge branch 'feat/heartbeat-v2' into fix-heartbeat-long-tests
sstanculeanu May 17, 2022
5390f5e
Merge pull request #4085 from ElrondNetwork/fix-heartbeat-long-tests
sstanculeanu May 17, 2022
feb3a93
Merge remote-tracking branch 'origin/development' into merge-dev-into…
sstanculeanu May 20, 2022
4ae38dd
Merge pull request #4092 from ElrondNetwork/merge-dev-into-heartbeat-…
sstanculeanu May 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions cmd/node/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -896,3 +896,29 @@
NumCrossShardPeers = 2
NumIntraShardPeers = 1
NumFullHistoryPeers = 3

[HeartbeatV2]
PeerAuthenticationTimeBetweenSendsInSec = 7200 # 2h
PeerAuthenticationTimeBetweenSendsWhenErrorInSec = 60 # 1min
PeerAuthenticationThresholdBetweenSends = 0.1 # 10%
HeartbeatTimeBetweenSendsInSec = 60 # 1min
HeartbeatTimeBetweenSendsWhenErrorInSec = 60 # 1min
HeartbeatThresholdBetweenSends = 0.1 # 10%
MaxNumOfPeerAuthenticationInResponse = 10
HeartbeatExpiryTimespanInSec = 3600 # 1h
MinPeersThreshold = 0.8 # 80%
DelayBetweenRequestsInSec = 10 # 10sec
MaxTimeoutInSec = 7200 # 2h
DelayBetweenConnectionNotificationsInSec = 60 # 1min
MaxMissingKeysInRequest = 1000
MaxDurationPeerUnresponsiveInSec = 900 # 15min
HideInactiveValidatorIntervalInSec = 3600 # 1h
HardforkTimeBetweenSendsInSec = 10 # 10sec
[HeartbeatV2.PeerAuthenticationPool]
DefaultSpanInSec = 3600 # 1h
CacheExpiryInSec = 3600 # 1h
[HeartbeatV2.HeartbeatPool]
Name = "HeartbeatPool"
Capacity = 1000
Type = "SizeLRU"
SizeInBytes = 314572800 #300MB
3 changes: 3 additions & 0 deletions cmd/node/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@
{ EpochEnable = 1, MaxNumNodes = 56, NodesToShufflePerShard = 2 }
]

# HeartbeatDisableEpoch represents the epoch when heartbeat v1 messages stop being sent and processed
HeartbeatDisableEpoch = 2

[GasSchedule]
GasScheduleByEpochs = [
{ StartEpoch = 0, FileName = "gasScheduleV1.toml" },
Expand Down
6 changes: 3 additions & 3 deletions cmd/node/config/prefs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
# It is highly recommended to enable this flag on an observer (not on a validator node)
FullArchive = false

# PreferredConnections holds an array containing the public keys of the nodes to connect with (in top of other connections)
# PreferredConnections holds an array containing valid ips or peer ids from nodes to connect with (in top of other connections)
# Example:
# PreferredConnections = [
# "eb2a13ec773924df2c7d1e92ff1c08d1c3b14218dc6a780b269ef12b9c098971f71851c212103720d40f92380c306a0c1a5e606f043f034188c3fcb95170112158730e2c53cd6c79331ce73df921675d71488f6287aa1ddca297756a98239584",
# "eb2a13ec773924df2c7d1e92ff1c08d1c3b14218dc6a780b269ef12b9c098971f71851c212103720d40f92380c306a0c1a5e606f043f034188c3fcb95170112158730e2c53cd6c79331ce73df921675d71488f6287aa1ddca297756a98239584"
# "127.0.0.10",
# "16Uiu2HAm6yvbp1oZ6zjnWsn9FdRqBSaQkbhELyaThuq48ybdorrr"
# ]

PreferredConnections = []
12 changes: 12 additions & 0 deletions common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ const GenesisTxSignatureString = "GENESISGENESISGENESISGENESISGENESISGENESISGENE
// HeartbeatTopic is the topic used for heartbeat signaling
const HeartbeatTopic = "heartbeat"

// HeartbeatV2Topic is the topic used for heartbeatV2 signaling
const HeartbeatV2Topic = "heartbeatV2"

// PeerAuthenticationTopic is the topic used for peer authentication signaling
const PeerAuthenticationTopic = "peerAuthentication"

// ConnectionTopic represents the topic used when sending the new connection message data
const ConnectionTopic = "connection"

// PathShardPlaceholder represents the placeholder for the shard ID in paths
const PathShardPlaceholder = "[S]"

Expand Down Expand Up @@ -485,6 +494,9 @@ const (
// MetricWaitingListFixEnableEpoch represents the epoch when the waiting list fix is enabled
MetricWaitingListFixEnableEpoch = "erd_waiting_list_fix_enable_epoch"

// MetricHeartbeatDisableEpoch represents the epoch when heartbeat v1 messages stop being sent and processed
MetricHeartbeatDisableEpoch = "erd_heartbeat_disable_epoch"

// MetricMaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch
MetricMaxNodesChangeEnableEpoch = "erd_max_nodes_change_enable_epoch"

Expand Down
29 changes: 29 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,34 @@ type SoftwareVersionConfig struct {
PollingIntervalInMinutes int
}

// HeartbeatV2Config will hold the configuration for heartbeat v2
type HeartbeatV2Config struct {
PeerAuthenticationTimeBetweenSendsInSec int64
PeerAuthenticationTimeBetweenSendsWhenErrorInSec int64
PeerAuthenticationThresholdBetweenSends float64
HeartbeatTimeBetweenSendsInSec int64
HeartbeatTimeBetweenSendsWhenErrorInSec int64
HeartbeatThresholdBetweenSends float64
MaxNumOfPeerAuthenticationInResponse int
HeartbeatExpiryTimespanInSec int64
MinPeersThreshold float32
DelayBetweenRequestsInSec int64
MaxTimeoutInSec int64
DelayBetweenConnectionNotificationsInSec int64
MaxMissingKeysInRequest uint32
MaxDurationPeerUnresponsiveInSec int64
HideInactiveValidatorIntervalInSec int64
PeerAuthenticationPool PeerAuthenticationPoolConfig
HeartbeatPool CacheConfig
HardforkTimeBetweenSendsInSec int64
}

// PeerAuthenticationPoolConfig will hold the configuration for peer authentication pool
type PeerAuthenticationPoolConfig struct {
DefaultSpanInSec int
CacheExpiryInSec int
}

// Config will hold the entire application configuration parameters
type Config struct {
MiniBlocksStorage StorageConfig
Expand Down Expand Up @@ -162,6 +190,7 @@ type Config struct {
Antiflood AntifloodConfig
ResourceStats ResourceStatsConfig
Heartbeat HeartbeatConfig
HeartbeatV2 HeartbeatV2Config
ValidatorStatistics ValidatorStatisticsConfig
GeneralSettings GeneralSettingsConfig
Consensus ConsensusConfig
Expand Down
1 change: 1 addition & 0 deletions config/epochConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ type EnableEpochs struct {
SCRSizeInvariantOnBuiltInResultEnableEpoch uint32
CheckCorrectTokenIDForTransferRoleEnableEpoch uint32
FailExecutionOnEveryAPIErrorEnableEpoch uint32
HeartbeatDisableEpoch uint32
}

// GasScheduleByEpochs represents a gas schedule toml entry that will be applied from the provided epoch
Expand Down
4 changes: 4 additions & 0 deletions config/tomlConfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ func TestEnableEpochConfig(t *testing.T) {
# FailExecutionOnEveryAPIErrorEnableEpoch represent the epoch when new protection in VM is enabled to fail all wrong API calls
FailExecutionOnEveryAPIErrorEnableEpoch = 53

# HeartbeatDisableEpoch represents the epoch when heartbeat v1 messages stop being sent and processed
HeartbeatDisableEpoch = 54

# MaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch
MaxNodesChangeEnableEpoch = [
{ EpochEnable = 44, MaxNumNodes = 2169, NodesToShufflePerShard = 80 },
Expand Down Expand Up @@ -734,6 +737,7 @@ func TestEnableEpochConfig(t *testing.T) {
TransformToMultiShardCreateEnableEpoch: 51,
ESDTRegisterAndSetAllRolesEnableEpoch: 52,
FailExecutionOnEveryAPIErrorEnableEpoch: 53,
HeartbeatDisableEpoch: 54,
},
GasSchedule: GasScheduleConfig{
GasScheduleByEpochs: []GasScheduleByEpochs{
Expand Down
2 changes: 1 addition & 1 deletion consensus/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type P2PMessenger interface {
// The interface assures that the collected data will be used by the p2p network sharding components
type NetworkShardingCollector interface {
UpdatePeerIDInfo(pid core.PeerID, pk []byte, shardID uint32)
UpdatePeerIdSubType(pid core.PeerID, peerSubType core.P2PPeerSubType)
PutPeerIdSubType(pid core.PeerID, peerSubType core.P2PPeerSubType)
GetPeerInfo(pid core.PeerID) core.P2PPeerInfo
IsInterfaceNil() bool
}
Expand Down
97 changes: 44 additions & 53 deletions consensus/spos/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ type Worker struct {
headerIntegrityVerifier process.HeaderIntegrityVerifier
appStatusHandler core.AppStatusHandler

networkShardingCollector consensus.NetworkShardingCollector

receivedMessages map[consensus.MessageType][]*consensus.Message
receivedMessagesCalls map[consensus.MessageType]func(ctx context.Context, msg *consensus.Message) bool

Expand All @@ -79,30 +77,29 @@ type Worker struct {

// WorkerArgs holds the consensus worker arguments
type WorkerArgs struct {
ConsensusService ConsensusService
BlockChain data.ChainHandler
BlockProcessor process.BlockProcessor
ScheduledProcessor consensus.ScheduledProcessor
Bootstrapper process.Bootstrapper
BroadcastMessenger consensus.BroadcastMessenger
ConsensusState *ConsensusState
ForkDetector process.ForkDetector
Marshalizer marshal.Marshalizer
Hasher hashing.Hasher
RoundHandler consensus.RoundHandler
ShardCoordinator sharding.Coordinator
PeerSignatureHandler crypto.PeerSignatureHandler
SyncTimer ntp.SyncTimer
HeaderSigVerifier HeaderSigVerifier
HeaderIntegrityVerifier process.HeaderIntegrityVerifier
ChainID []byte
NetworkShardingCollector consensus.NetworkShardingCollector
AntifloodHandler consensus.P2PAntifloodHandler
PoolAdder PoolAdder
SignatureSize int
PublicKeySize int
AppStatusHandler core.AppStatusHandler
NodeRedundancyHandler consensus.NodeRedundancyHandler
ConsensusService ConsensusService
BlockChain data.ChainHandler
BlockProcessor process.BlockProcessor
ScheduledProcessor consensus.ScheduledProcessor
Bootstrapper process.Bootstrapper
BroadcastMessenger consensus.BroadcastMessenger
ConsensusState *ConsensusState
ForkDetector process.ForkDetector
Marshalizer marshal.Marshalizer
Hasher hashing.Hasher
RoundHandler consensus.RoundHandler
ShardCoordinator sharding.Coordinator
PeerSignatureHandler crypto.PeerSignatureHandler
SyncTimer ntp.SyncTimer
HeaderSigVerifier HeaderSigVerifier
HeaderIntegrityVerifier process.HeaderIntegrityVerifier
ChainID []byte
AntifloodHandler consensus.P2PAntifloodHandler
PoolAdder PoolAdder
SignatureSize int
PublicKeySize int
AppStatusHandler core.AppStatusHandler
NodeRedundancyHandler consensus.NodeRedundancyHandler
}

// NewWorker creates a new Worker object
Expand All @@ -128,28 +125,27 @@ func NewWorker(args *WorkerArgs) (*Worker, error) {
}

wrk := Worker{
consensusService: args.ConsensusService,
blockChain: args.BlockChain,
blockProcessor: args.BlockProcessor,
scheduledProcessor: args.ScheduledProcessor,
bootstrapper: args.Bootstrapper,
broadcastMessenger: args.BroadcastMessenger,
consensusState: args.ConsensusState,
forkDetector: args.ForkDetector,
marshalizer: args.Marshalizer,
hasher: args.Hasher,
roundHandler: args.RoundHandler,
shardCoordinator: args.ShardCoordinator,
peerSignatureHandler: args.PeerSignatureHandler,
syncTimer: args.SyncTimer,
headerSigVerifier: args.HeaderSigVerifier,
headerIntegrityVerifier: args.HeaderIntegrityVerifier,
appStatusHandler: args.AppStatusHandler,
networkShardingCollector: args.NetworkShardingCollector,
antifloodHandler: args.AntifloodHandler,
poolAdder: args.PoolAdder,
nodeRedundancyHandler: args.NodeRedundancyHandler,
closer: closing.NewSafeChanCloser(),
consensusService: args.ConsensusService,
blockChain: args.BlockChain,
blockProcessor: args.BlockProcessor,
scheduledProcessor: args.ScheduledProcessor,
bootstrapper: args.Bootstrapper,
broadcastMessenger: args.BroadcastMessenger,
consensusState: args.ConsensusState,
forkDetector: args.ForkDetector,
marshalizer: args.Marshalizer,
hasher: args.Hasher,
roundHandler: args.RoundHandler,
shardCoordinator: args.ShardCoordinator,
peerSignatureHandler: args.PeerSignatureHandler,
syncTimer: args.SyncTimer,
headerSigVerifier: args.HeaderSigVerifier,
headerIntegrityVerifier: args.HeaderIntegrityVerifier,
appStatusHandler: args.AppStatusHandler,
antifloodHandler: args.AntifloodHandler,
poolAdder: args.PoolAdder,
nodeRedundancyHandler: args.NodeRedundancyHandler,
closer: closing.NewSafeChanCloser(),
}

wrk.consensusMessageValidator = consensusMessageValidatorObj
Expand Down Expand Up @@ -232,9 +228,6 @@ func checkNewWorkerParams(args *WorkerArgs) error {
if len(args.ChainID) == 0 {
return ErrInvalidChainID
}
if check.IfNil(args.NetworkShardingCollector) {
return ErrNilNetworkShardingCollector
}
if check.IfNil(args.AntifloodHandler) {
return ErrNilAntifloodHandler
}
Expand Down Expand Up @@ -381,8 +374,6 @@ func (wrk *Worker) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedP
return err
}

wrk.networkShardingCollector.UpdatePeerIDInfo(message.Peer(), cnsMsg.PubKey, wrk.shardCoordinator.SelfId())

isMessageWithBlockBody := wrk.consensusService.IsMessageWithBlockBody(msgType)
isMessageWithBlockHeader := wrk.consensusService.IsMessageWithBlockHeader(msgType)
isMessageWithBlockBodyAndHeader := wrk.consensusService.IsMessageWithBlockBodyAndHeader(msgType)
Expand Down
59 changes: 23 additions & 36 deletions consensus/spos/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/ElrondNetwork/elrond-go/process"
"github.com/ElrondNetwork/elrond-go/testscommon"
"github.com/ElrondNetwork/elrond-go/testscommon/hashingMocks"
"github.com/ElrondNetwork/elrond-go/testscommon/p2pmocks"
statusHandlerMock "github.com/ElrondNetwork/elrond-go/testscommon/statusHandler"
"github.com/stretchr/testify/assert"
)
Expand Down Expand Up @@ -86,30 +85,29 @@ func createDefaultWorkerArgs(appStatusHandler core.AppStatusHandler) *spos.Worke

peerSigHandler := &mock.PeerSignatureHandler{Signer: singleSignerMock, KeyGen: keyGeneratorMock}
workerArgs := &spos.WorkerArgs{
ConsensusService: blsService,
BlockChain: blockchainMock,
BlockProcessor: blockProcessor,
ScheduledProcessor: scheduledProcessor,
Bootstrapper: bootstrapperMock,
BroadcastMessenger: broadcastMessengerMock,
ConsensusState: consensusState,
ForkDetector: forkDetectorMock,
Marshalizer: marshalizerMock,
Hasher: hasher,
RoundHandler: roundHandlerMock,
ShardCoordinator: shardCoordinatorMock,
PeerSignatureHandler: peerSigHandler,
SyncTimer: syncTimerMock,
HeaderSigVerifier: &mock.HeaderSigVerifierStub{},
HeaderIntegrityVerifier: &mock.HeaderIntegrityVerifierStub{},
ChainID: chainID,
NetworkShardingCollector: &p2pmocks.NetworkShardingCollectorStub{},
AntifloodHandler: createMockP2PAntifloodHandler(),
PoolAdder: poolAdder,
SignatureSize: SignatureSize,
PublicKeySize: PublicKeySize,
AppStatusHandler: appStatusHandler,
NodeRedundancyHandler: &mock.NodeRedundancyHandlerStub{},
ConsensusService: blsService,
BlockChain: blockchainMock,
BlockProcessor: blockProcessor,
ScheduledProcessor: scheduledProcessor,
Bootstrapper: bootstrapperMock,
BroadcastMessenger: broadcastMessengerMock,
ConsensusState: consensusState,
ForkDetector: forkDetectorMock,
Marshalizer: marshalizerMock,
Hasher: hasher,
RoundHandler: roundHandlerMock,
ShardCoordinator: shardCoordinatorMock,
PeerSignatureHandler: peerSigHandler,
SyncTimer: syncTimerMock,
HeaderSigVerifier: &mock.HeaderSigVerifierStub{},
HeaderIntegrityVerifier: &mock.HeaderIntegrityVerifierStub{},
ChainID: chainID,
AntifloodHandler: createMockP2PAntifloodHandler(),
PoolAdder: poolAdder,
SignatureSize: SignatureSize,
PublicKeySize: PublicKeySize,
AppStatusHandler: appStatusHandler,
NodeRedundancyHandler: &mock.NodeRedundancyHandlerStub{},
}

return workerArgs
Expand Down Expand Up @@ -320,17 +318,6 @@ func TestWorker_NewWorkerEmptyChainIDShouldFail(t *testing.T) {
assert.Equal(t, spos.ErrInvalidChainID, err)
}

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

workerArgs := createDefaultWorkerArgs(&statusHandlerMock.AppStatusHandlerStub{})
workerArgs.NetworkShardingCollector = nil
wrk, err := spos.NewWorker(workerArgs)

assert.Nil(t, wrk)
assert.Equal(t, spos.ErrNilNetworkShardingCollector, err)
}

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

Expand Down
Loading