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/equivalent messages #5786

Draft
wants to merge 592 commits into
base: feat/consensus-size-changes
Choose a base branch
from
Draft
Changes from 33 commits
Commits
Show all changes
592 commits
Select commit Hold shift + click to select a range
ebb8b72
Removed pointer when calling function for initiating SubroundEndRound.
ilincaseby Sep 13, 2024
473bba9
Moved test error into a separate file of package bls_test.
ilincaseby Sep 13, 2024
6631b4f
Put test error into the function and removed the file errors_test.go.
ilincaseby Sep 13, 2024
aaa9d4b
added test for processing message.
cristure Sep 13, 2024
41cf564
fixes after review: removed equivalent messages handling from worker
ssd04 Sep 13, 2024
2b78568
Merge branch 'feat/equivalent-messages' into header_broadcast_on_comm…
sstanculeanu Sep 13, 2024
2f08abe
Merge branch 'feat/equivalent-messages' into refactor-single-multi-key
ssd04 Sep 13, 2024
2a6e05b
fix factory and integration tests
ssd04 Sep 13, 2024
340b17f
fix linter issues
ssd04 Sep 13, 2024
48cd21d
fix arguments in tests
ssd04 Sep 13, 2024
2ed3b1a
fix peer shard resolver mock
ssd04 Sep 13, 2024
6e8b0bc
Merge pull request #6408 from multiversx/refactor-single-multi-key
AdoAdoAdo Sep 13, 2024
c97c852
Merge branch 'feat/equivalent-messages' into equivalent_proofs_interc…
sstanculeanu Sep 13, 2024
f0ed35b
Merge branch 'feat/equivalent-messages' into header_broadcast_on_comm…
sstanculeanu Sep 13, 2024
b9ac52c
Refactor error name.
ilincaseby Sep 15, 2024
0b8bb75
Refactor error name.
ilincaseby Sep 16, 2024
a37a2ae
Merge branch 'feat/equivalent-messages' into benchmark_signature_veri…
sstanculeanu Sep 16, 2024
603bd69
added message validation cache.
cristure Sep 16, 2024
57f009e
fix some tests.
cristure Sep 16, 2024
7c71f27
Merge pull request #6424 from multiversx/benchmark_signature_verifica…
AdoAdoAdo Sep 16, 2024
7cb6795
Merge branch 'feat/equivalent-messages' into header_broadcast_on_comm…
sstanculeanu Sep 16, 2024
26d4940
Merge branch 'feat/equivalent-messages' into equivalent_proofs_interc…
sstanculeanu Sep 16, 2024
e92f7a8
fix after review
sstanculeanu Sep 16, 2024
f5a6f2e
fixed missing topic.
cristure Sep 16, 2024
8eec330
fix some more tests.
cristure Sep 17, 2024
a733097
fix nil pointer dereferences in tests.
cristure Sep 17, 2024
bab3b05
more tests fixed.
cristure Sep 17, 2024
c3f7120
add map for cacher in more unit tests.
cristure Sep 17, 2024
b62e37b
fix nil map for more tests.
cristure Sep 17, 2024
7b8110c
Merge pull request #6437 from multiversx/header_broadcast_on_common_t…
AdoAdoAdo Sep 17, 2024
4a3cdee
Merge branch 'feat/equivalent-messages' into equivalent_proofs_interc…
sstanculeanu Sep 17, 2024
c00f8ee
fix process tests.
cristure Sep 17, 2024
514b62f
fix after review
sstanculeanu Sep 17, 2024
94a64c1
Merge branch 'feat/equivalent-messages' into message_validation_optim…
cristure Sep 17, 2024
4ab66b6
Merge pull request #6457 from multiversx/equivalent_proofs_interceptor
sstanculeanu Sep 18, 2024
d77e367
Merge remote-tracking branch 'origin/feat/equivalent-messages' into m…
cristure Sep 18, 2024
7095589
Merge branch 'feat/equivalent-messages' into equivalent-proofs-tracker
ssd04 Sep 18, 2024
d59c5bd
fix conflicts with target branch.
cristure Sep 18, 2024
e292002
Update consensus/spos/worker.go
ssd04 Sep 18, 2024
4354927
Update dataRetriever/dataPool/proofsCache/proofsPool.go
ssd04 Sep 18, 2024
61cd94f
fixes after review
ssd04 Sep 18, 2024
245e22c
added handler for received block on subroundBlock, registered to the …
sstanculeanu Sep 18, 2024
dd4e4d4
Merge pull request #6456 from multiversx/equivalent-proofs-tracker
AdoAdoAdo Sep 19, 2024
4eaa900
Merge branch 'feat/equivalent-messages' into register_header_received…
sstanculeanu Sep 19, 2024
771eff8
Merge pull request #6479 from multiversx/register_header_received_han…
ssd04 Sep 19, 2024
9f2f0cf
versioning for consensus with and without equivalent messages
AdoAdoAdo Sep 19, 2024
396cd8e
refactored message validation to a different component.
cristure Sep 19, 2024
a44129f
cosmetic changes.
cristure Sep 20, 2024
afdceb1
added intercepted data verifier stub in multi data tests.
cristure Sep 20, 2024
d8d8113
fix single data interceptor tests.
cristure Sep 20, 2024
fe2082c
commit debug strings for CI.
cristure Sep 20, 2024
d20c0e2
fixes for consensus v1 - after initial split
AdoAdoAdo Sep 20, 2024
c6b7a0f
moved map of cachers in node processor.
cristure Sep 20, 2024
f59fc85
cosmetic changes.
cristure Sep 20, 2024
d00c7ab
fix integration tests.
cristure Sep 20, 2024
f21e24f
fix some more tests.
cristure Sep 20, 2024
c815841
extract exported constants
AdoAdoAdo Sep 20, 2024
5f82c80
adapt v2
AdoAdoAdo Sep 20, 2024
9ec2d11
fix start round reset
AdoAdoAdo Sep 20, 2024
ba61a2d
tests fixes
AdoAdoAdo Sep 20, 2024
f40d222
fix some unit tests.
cristure Sep 23, 2024
3a327c4
fix nil map in tests.
cristure Sep 23, 2024
a756a1f
Merge branch 'feat/equivalent-messages' into message_validation_optim…
cristure Sep 23, 2024
f474f14
cleanup and v1 unit tests fixes
AdoAdoAdo Sep 23, 2024
4246b29
fix v1 consensus package unit tests
AdoAdoAdo Sep 23, 2024
b8ca228
extract common worker for v1 and v2
AdoAdoAdo Sep 23, 2024
ff8eaa9
Merge remote-tracking branch 'origin/feat/equivalent-messages' into m…
cristure Sep 25, 2024
cde6c80
cosmetic changes.
cristure Sep 25, 2024
e0cf24b
Merge remote-tracking branch 'origin/message_validation_optimization'…
cristure Sep 25, 2024
9504263
refactored map of caches for intercepted data into a new component.
cristure Sep 25, 2024
1c6f59a
add handler for consensus subrounds stm
AdoAdoAdo Sep 25, 2024
29b083d
fix cyclic import
AdoAdoAdo Sep 25, 2024
299bc50
fix unit tests
AdoAdoAdo Sep 25, 2024
85dca04
add proof signature check in header check
ssd04 Sep 25, 2024
712e0da
wait for confirmation block in epoch start block syncer
ssd04 Sep 25, 2024
4bddfce
fix epoch start meta block syncer tests
ssd04 Sep 25, 2024
b622085
added mock for interceptedDataVerifierFactory and injected into tests.
cristure Sep 26, 2024
f0b34ef
more test fixes.
cristure Sep 26, 2024
b05c650
increase wait time for CI run.
cristure Sep 26, 2024
5dc6bba
bring back rw mutex on interceptedDataVerifier.
cristure Sep 26, 2024
357d2c2
fix missing proofs pool in unit tests
AdoAdoAdo Sep 26, 2024
19fcca2
fix linter
AdoAdoAdo Sep 26, 2024
381e376
register subrounds handler on epoch trigger
AdoAdoAdo Sep 27, 2024
308a952
remove unused method
AdoAdoAdo Sep 27, 2024
27dbc82
renaming import aliases
AdoAdoAdo Sep 27, 2024
9f14328
extract interfaces for consensus state
AdoAdoAdo Sep 27, 2024
488dd06
adapt to use interface instead of struct pointer
AdoAdoAdo Sep 27, 2024
ae7f18a
fixes
AdoAdoAdo Sep 27, 2024
1b85621
fixes unit tests
AdoAdoAdo Sep 27, 2024
30df93e
fixes unit tests - part 2
AdoAdoAdo Sep 27, 2024
07c6afe
fixes unit tests - part 3
AdoAdoAdo Sep 27, 2024
c7b4ef7
add constructor tests
AdoAdoAdo Sep 27, 2024
351c118
fix cyclic import
AdoAdoAdo Sep 27, 2024
7052ecb
update consensusStateMock
AdoAdoAdo Sep 30, 2024
d214027
fixes after review.
cristure Sep 30, 2024
9edc7c7
add initSubroundsForEpoch tests
AdoAdoAdo Sep 30, 2024
c8648e7
add more unit tests for the consensus proxy
AdoAdoAdo Sep 30, 2024
899b04d
split test and improved lock mechanism.
cristure Oct 1, 2024
492041c
fixes after review
AdoAdoAdo Oct 1, 2024
450a389
fix data race issues
ssd04 Oct 2, 2024
782078f
fix proofs pool init
ssd04 Oct 2, 2024
959e037
Update node/nodeRunner.go
cristure Oct 2, 2024
7762f62
addressed some comments.
cristure Oct 2, 2024
3163799
add outport handler on factory constructor
AdoAdoAdo Oct 2, 2024
1eae0e9
now metachain notarizez based on equivalent proofs
sstanculeanu Oct 2, 2024
23dbb5a
more fixes.
cristure Oct 3, 2024
b9eb2a5
fix unit tests.
cristure Oct 3, 2024
5624d0c
Merge pull request #6483 from multiversx/refactor-consensus
AdoAdoAdo Oct 3, 2024
0deeb37
Merge branch 'feat/equivalent-messages' into message_validation_optim…
sstanculeanu Oct 3, 2024
4197d2b
Merge branch 'feat/equivalent-messages' into adapt_notarization
sstanculeanu Oct 3, 2024
74789b1
added trace logs in proofs pool
ssd04 Oct 3, 2024
01455b2
Revert "fix proofs pool init"
ssd04 Oct 3, 2024
9c0fa4e
Revert "Revert "fix proofs pool init""
ssd04 Oct 3, 2024
0619c19
Revert "fix data race issues"
ssd04 Oct 3, 2024
17e1bfc
Merge branch 'feat/equivalent-messages' into fix-integration-tests
ssd04 Oct 3, 2024
627b941
fix data race issues
ssd04 Oct 3, 2024
8f6977e
final proof is now sent on the common topic with META
sstanculeanu Oct 3, 2024
504d932
fixes after self review
sstanculeanu Oct 3, 2024
a5c2cba
fix test
sstanculeanu Oct 3, 2024
2c43c21
fixes after review
sstanculeanu Oct 3, 2024
125aed4
proper topics
sstanculeanu Oct 3, 2024
1ca0a01
fixes after second review
sstanculeanu Oct 3, 2024
8451f62
added close to intercepted data cacher and a few unit tests on nil ch…
cristure Oct 3, 2024
130e115
Merge remote-tracking branch 'origin/message_validation_optimization'…
cristure Oct 3, 2024
eccd1bf
Merge pull request #6516 from multiversx/send_proofs_on_topic
sstanculeanu Oct 3, 2024
71187d1
Merge branch 'feat/equivalent-messages' into adapt_notarization
sstanculeanu Oct 3, 2024
087a5eb
Merge branch 'feat/equivalent-messages' into fix-integration-tests
sstanculeanu Oct 3, 2024
d398385
Merge branch 'feat/equivalent-messages' into integrate-proof-check-on…
ssd04 Oct 3, 2024
754fae3
Merge branch 'feat/equivalent-messages' into message_validation_optim…
sstanculeanu Oct 3, 2024
8dd18b8
cosmetic changes.
cristure Oct 3, 2024
1b11cb8
Merge remote-tracking branch 'origin/message_validation_optimization'…
cristure Oct 3, 2024
bb31c75
Update process/block/baseProcess.go
ssd04 Oct 3, 2024
c908cb2
Update process/block/baseProcess.go
ssd04 Oct 3, 2024
66316b2
added proofs pool in process sync
ssd04 Oct 3, 2024
5c24692
Merge pull request #6515 from multiversx/fix-integration-tests
AdoAdoAdo Oct 4, 2024
111fdb1
Merge branch 'feat/equivalent-messages' into message_validation_optim…
AdoAdoAdo Oct 4, 2024
c49cde8
Merge pull request #6462 from multiversx/message_validation_optimization
AdoAdoAdo Oct 4, 2024
225945f
integrate proofs pool in interceptors factory
ssd04 Oct 4, 2024
1cc05a0
Merge branch 'feat/equivalent-messages' into integrate-proof-check-on…
ssd04 Oct 4, 2024
c244eca
fix epoch start bootstrap process tests
ssd04 Oct 4, 2024
d2598ff
refactor to use flag activation in epoch start meta block processor
ssd04 Oct 5, 2024
d4886f4
add todo for meta block sync duplicated code
ssd04 Oct 5, 2024
58eeb1e
unit tests for flow with equivalent proofs
ssd04 Oct 7, 2024
3813ce8
process block only if there is a proof
ssd04 Oct 7, 2024
68f9ff7
unit tests
AdoAdoAdo Oct 7, 2024
367d1d1
Merge branch 'feat/equivalent-messages' of https://github.com/multive…
sstanculeanu Oct 10, 2024
3df3761
Merge remote-tracking branch 'origin/adapt_notarization' into adapt_n…
sstanculeanu Oct 10, 2024
ed9fbba
fix comment
ssd04 Oct 14, 2024
3db36eb
update factory
AdoAdoAdo Oct 14, 2024
d8a0c22
update start round subround
AdoAdoAdo Oct 14, 2024
c20513f
update subround block
AdoAdoAdo Oct 14, 2024
ce631d6
add leader signature on proposed block
AdoAdoAdo Oct 14, 2024
cbbfe95
add checks for correct block in consensus
AdoAdoAdo Oct 14, 2024
7f70d95
fixes subround block
AdoAdoAdo Oct 14, 2024
a691159
fixes tests
AdoAdoAdo Oct 15, 2024
a2e84fb
fixes tests
AdoAdoAdo Oct 15, 2024
812852b
linter fix
AdoAdoAdo Oct 15, 2024
32f29a0
cleanup consensus v2 signature subround
AdoAdoAdo Oct 15, 2024
8236823
fixes after review
sstanculeanu Oct 15, 2024
8a19d0b
fix unit tests
AdoAdoAdo Oct 15, 2024
21febee
Merge pull request #6535 from multiversx/refactor-v2-subround-block
AdoAdoAdo Oct 15, 2024
2cade4b
Merge branch 'feat/equivalent-messages' into refactor-v2-subround-sig…
AdoAdoAdo Oct 15, 2024
9c978a7
fixes signature subround
AdoAdoAdo Oct 15, 2024
7a9c78d
some more fixes unit tests for signature subround
AdoAdoAdo Oct 16, 2024
1e43a57
cleanup and adapting
AdoAdoAdo Oct 16, 2024
b8afd0c
fixes v2 EndRound subround
AdoAdoAdo Oct 16, 2024
d96462a
fixed more tests
sstanculeanu Oct 17, 2024
e970b06
Merge branch 'feat/equivalent-messages' of https://github.com/multive…
sstanculeanu Oct 17, 2024
2e1b145
fix after merge
sstanculeanu Oct 17, 2024
47f4742
fixes v2 EndRound subround
AdoAdoAdo Oct 17, 2024
425cd65
fixes after review
AdoAdoAdo Oct 17, 2024
e3e0cde
Merge pull request #6537 from multiversx/refactor-v2-subround-signature
AdoAdoAdo Oct 17, 2024
f34b5cf
Merge branch 'feat/equivalent-messages' into adapt_notarization
sstanculeanu Oct 17, 2024
a5f105e
Merge branch 'feat/equivalent-messages' into refactor-v2-subround-end…
AdoAdoAdo Oct 17, 2024
6aad53b
fix tests
sstanculeanu Oct 17, 2024
4b03649
add log trace check on display
ssd04 Oct 21, 2024
33c5aaa
subround end round refactoring
AdoAdoAdo Oct 21, 2024
72431c3
refactor commit block in consensus
AdoAdoAdo Oct 21, 2024
80f1ca3
remove debug prints
ssd04 Oct 21, 2024
47746d5
Merge branch 'feat/equivalent-messages' into integrate-proof-check-on…
ssd04 Oct 21, 2024
50ba8a1
subround block fixes
sstanculeanu Oct 22, 2024
3fb045b
removed tests for after equivalent messages as they are not valid any…
sstanculeanu Oct 22, 2024
93afc4e
fix linter
sstanculeanu Oct 22, 2024
1158d33
remove one more test
sstanculeanu Oct 22, 2024
bc8fc7b
cleanup tests and adapt worker mock
AdoAdoAdo Oct 23, 2024
450d335
proper proofs verification on notarization
sstanculeanu Oct 23, 2024
12d156a
add proofs pool subscribers
ssd04 Oct 24, 2024
176e9a9
fix linter issue
ssd04 Oct 24, 2024
fd736e6
added nil check unit tests
ssd04 Oct 24, 2024
8334c57
some fixes
AdoAdoAdo Oct 28, 2024
10030d4
remove old tests
ssd04 Nov 12, 2024
81f3225
added unit tests
ssd04 Nov 13, 2024
f283bb3
add worker received proof
ssd04 Nov 13, 2024
94a2069
fix invalid signers broadcast
ssd04 Nov 13, 2024
49f67f6
small refactoring and comments
ssd04 Nov 13, 2024
644d8be
fixes after review
sstanculeanu Nov 14, 2024
d9e38c4
fixes after review
sstanculeanu Nov 21, 2024
20ea2ff
handle equivalent proof separatelly
ssd04 Nov 22, 2024
ba15d49
integration test for sync with equivalent proofs
ssd04 Nov 22, 2024
50b7ecb
fixed IsFlagEnabledAfterEpochsStartBlock
sstanculeanu Nov 22, 2024
d7d94ab
update check on sync with equivalent proofs test
ssd04 Nov 25, 2024
a389ce3
fix linter issue
ssd04 Nov 25, 2024
12bdda4
fixes after review
sstanculeanu Nov 26, 2024
c87d855
added more unit tests for handling equivalent proof
ssd04 Nov 26, 2024
7ce8e27
fixes after review
sstanculeanu Dec 3, 2024
f334d9d
early exit for nil proof
sstanculeanu Dec 4, 2024
10c8d22
more fixes after review
sstanculeanu Dec 4, 2024
0f169a5
fixed header verification after equivalent proofs
sstanculeanu Dec 6, 2024
b110475
fixes after review
sstanculeanu Dec 9, 2024
3facbdf
Merge pull request #6513 from multiversx/adapt_notarization
sstanculeanu Dec 9, 2024
38f273b
Merge branch 'feat/equivalent-messages' into integrate-proof-check-on…
ssd04 Dec 9, 2024
20af59a
added todo for invalid signers propagation
ssd04 Dec 9, 2024
f1ed476
Merge pull request #6601 from multiversx/subround-endround-v2-tests
ssd04 Dec 9, 2024
f213ec8
Merge branch 'feat/equivalent-messages' into refactor-v2-subround-end…
AdoAdoAdo Dec 9, 2024
47279c4
Merge pull request #6540 from multiversx/refactor-v2-subround-endround
ssd04 Dec 9, 2024
d5b069f
Merge branch 'feat/equivalent-messages' into integrate-proof-check-on…
AdoAdoAdo Dec 10, 2024
6933285
Merge branch 'feat/equivalent-messages' into fix_header_verification
AdoAdoAdo Dec 10, 2024
c0a0080
adapt header checks
AdoAdoAdo Dec 10, 2024
eea9c9b
fix stub
AdoAdoAdo Dec 10, 2024
77c0cf7
fixes tests and mocks
AdoAdoAdo Dec 10, 2024
a8e7a8e
fixes proof checks in consensus message
AdoAdoAdo Dec 11, 2024
d0ec90f
Merge pull request #6659 from multiversx/fix_header_verification
AdoAdoAdo Dec 11, 2024
93f1a71
fixes proofs nil checks
AdoAdoAdo Dec 11, 2024
d663d3c
Merge branch 'feat/equivalent-messages' into fixes-header-sig-verific…
AdoAdoAdo Dec 12, 2024
1e09723
fixes proof verification - use correct consensus group
AdoAdoAdo Dec 12, 2024
071f008
Merge branch 'fixes-header-sig-verification' of github.com:multiversx…
AdoAdoAdo Dec 12, 2024
18bc9c0
fix linter
AdoAdoAdo Dec 12, 2024
8528bf2
fixes unit tests
AdoAdoAdo Dec 13, 2024
6228e44
fixes unit tests for new checks
AdoAdoAdo Dec 13, 2024
ca5f851
add flag check for proof verification
AdoAdoAdo Dec 16, 2024
9724125
add consensus header interceptor check for v1
AdoAdoAdo Dec 16, 2024
dd70b0d
Merge branch 'feat/equivalent-messages' into integrate-proof-check-on…
ssd04 Dec 16, 2024
893302e
fixes after review
AdoAdoAdo Dec 16, 2024
d7089a9
Merge pull request #6665 from multiversx/fixes-header-sig-verification
ssd04 Dec 16, 2024
1715ed0
Merge branch 'feat/equivalent-messages' into integrate-proof-check-on…
ssd04 Dec 17, 2024
8a95e05
fix conflicts
ssd04 Dec 17, 2024
89a246e
added flag for proofs check in header intercetor
ssd04 Dec 17, 2024
cb82037
remove todo in sync process for proofs
ssd04 Dec 17, 2024
87a635e
remove accumulation maps for epoch start confirmation block
ssd04 Dec 17, 2024
44ab7fa
rename chan
ssd04 Dec 17, 2024
555ea3d
more fixes after review
ssd04 Dec 17, 2024
ebb3fc3
added more unit tests on handling equivalent proofs on sync
ssd04 Dec 17, 2024
39af8f1
check for already existing equivalent proof
ssd04 Dec 17, 2024
7b02128
Merge pull request #6501 from multiversx/integrate-proof-check-on-sync
sstanculeanu Dec 18, 2024
5b4a098
subround endround fixes
ssd04 Dec 18, 2024
537eb34
nil proof check in worker
ssd04 Dec 18, 2024
2f56ebd
remove debug logs
ssd04 Dec 18, 2024
f9527f6
return true if subround already finished
ssd04 Dec 18, 2024
5d2773f
remove extra empty line
ssd04 Dec 18, 2024
7e35a87
Merge pull request #6683 from multiversx/subround-endround-v2-fixes
AdoAdoAdo Dec 19, 2024
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
6 changes: 4 additions & 2 deletions common/constants.go
Original file line number Diff line number Diff line change
@@ -843,8 +843,10 @@ const (
ChainParametersOrder
// NodesCoordinatorOrder defines the order in which NodesCoordinator is notified of a start of epoch event
NodesCoordinatorOrder
// ConsensusOrder defines the order in which Consensus is notified of a start of epoch event
ConsensusOrder
// ConsensusHandlerOrder defines the order in which ConsensusHandler is notified of a start of epoch event
ConsensusHandlerOrder
// ConsensusStartRoundOrder defines the order in which Consensus StartRound subround is notified of a start of epoch event
ConsensusStartRoundOrder
// NetworkShardingOrder defines the order in which the network sharding subsystem is notified of a start of epoch event
NetworkShardingOrder
// IndexerOrder defines the order in which indexer is notified of a start of epoch event
19 changes: 10 additions & 9 deletions consensus/chronology/chronology_test.go
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import (
"github.com/multiversx/mx-chain-go/consensus"
"github.com/multiversx/mx-chain-go/consensus/chronology"
"github.com/multiversx/mx-chain-go/consensus/mock"
consensusMocks "github.com/multiversx/mx-chain-go/testscommon/consensus"
statusHandlerMock "github.com/multiversx/mx-chain-go/testscommon/statusHandler"
)

@@ -117,7 +118,7 @@ func TestChronology_StartRoundShouldReturnWhenRoundIndexIsNegative(t *testing.T)
t.Parallel()

arg := getDefaultChronologyArg()
roundHandlerMock := &mock.RoundHandlerMock{}
roundHandlerMock := &consensusMocks.RoundHandlerMock{}
roundHandlerMock.IndexCalled = func() int64 {
return -1
}
@@ -151,7 +152,7 @@ func TestChronology_StartRoundShouldReturnWhenDoWorkReturnsFalse(t *testing.T) {
t.Parallel()

arg := getDefaultChronologyArg()
roundHandlerMock := &mock.RoundHandlerMock{}
roundHandlerMock := &consensusMocks.RoundHandlerMock{}
roundHandlerMock.UpdateRound(roundHandlerMock.TimeStamp(), roundHandlerMock.TimeStamp().Add(roundHandlerMock.TimeDuration()))
arg.RoundHandler = roundHandlerMock
chr, _ := chronology.NewChronology(arg)
@@ -168,7 +169,7 @@ func TestChronology_StartRoundShouldWork(t *testing.T) {
t.Parallel()

arg := getDefaultChronologyArg()
roundHandlerMock := &mock.RoundHandlerMock{}
roundHandlerMock := &consensusMocks.RoundHandlerMock{}
roundHandlerMock.UpdateRound(roundHandlerMock.TimeStamp(), roundHandlerMock.TimeStamp().Add(roundHandlerMock.TimeDuration()))
arg.RoundHandler = roundHandlerMock
chr, _ := chronology.NewChronology(arg)
@@ -221,7 +222,7 @@ func TestChronology_InitRoundShouldNotSetSubroundWhenRoundIndexIsNegative(t *tes
t.Parallel()

arg := getDefaultChronologyArg()
roundHandlerMock := &mock.RoundHandlerMock{}
roundHandlerMock := &consensusMocks.RoundHandlerMock{}
arg.RoundHandler = roundHandlerMock
arg.GenesisTime = arg.SyncTimer.CurrentTime()
chr, _ := chronology.NewChronology(arg)
@@ -242,7 +243,7 @@ func TestChronology_InitRoundShouldSetSubroundWhenRoundIndexIsPositive(t *testin
t.Parallel()

arg := getDefaultChronologyArg()
roundHandlerMock := &mock.RoundHandlerMock{}
roundHandlerMock := &consensusMocks.RoundHandlerMock{}
roundHandlerMock.UpdateRound(roundHandlerMock.TimeStamp(), roundHandlerMock.TimeStamp().Add(roundHandlerMock.TimeDuration()))
arg.RoundHandler = roundHandlerMock
arg.GenesisTime = arg.SyncTimer.CurrentTime()
@@ -259,7 +260,7 @@ func TestChronology_StartRoundShouldNotUpdateRoundWhenCurrentRoundIsNotFinished(
t.Parallel()

arg := getDefaultChronologyArg()
roundHandlerMock := &mock.RoundHandlerMock{}
roundHandlerMock := &consensusMocks.RoundHandlerMock{}
arg.RoundHandler = roundHandlerMock
arg.GenesisTime = arg.SyncTimer.CurrentTime()
chr, _ := chronology.NewChronology(arg)
@@ -273,7 +274,7 @@ func TestChronology_StartRoundShouldNotUpdateRoundWhenCurrentRoundIsNotFinished(
func TestChronology_StartRoundShouldUpdateRoundWhenCurrentRoundIsFinished(t *testing.T) {
t.Parallel()
arg := getDefaultChronologyArg()
roundHandlerMock := &mock.RoundHandlerMock{}
roundHandlerMock := &consensusMocks.RoundHandlerMock{}
arg.RoundHandler = roundHandlerMock
arg.GenesisTime = arg.SyncTimer.CurrentTime()
chr, _ := chronology.NewChronology(arg)
@@ -317,8 +318,8 @@ func TestChronology_CheckIfStatusHandlerWorks(t *testing.T) {
func getDefaultChronologyArg() chronology.ArgChronology {
return chronology.ArgChronology{
GenesisTime: time.Now(),
RoundHandler: &mock.RoundHandlerMock{},
SyncTimer: &mock.SyncTimerMock{},
RoundHandler: &consensusMocks.RoundHandlerMock{},
SyncTimer: &consensusMocks.SyncTimerMock{},
AppStatusHandler: statusHandlerMock.NewAppStatusHandlerMock(),
Watchdog: &mock.WatchdogMock{},
}
1 change: 1 addition & 0 deletions consensus/interface.go
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import (
"github.com/multiversx/mx-chain-core-go/core"
"github.com/multiversx/mx-chain-core-go/data"
crypto "github.com/multiversx/mx-chain-crypto-go"

"github.com/multiversx/mx-chain-go/p2p"
)

20 changes: 11 additions & 9 deletions consensus/round/round_test.go
Original file line number Diff line number Diff line change
@@ -5,8 +5,10 @@ import (
"time"

"github.com/multiversx/mx-chain-core-go/core/check"
"github.com/multiversx/mx-chain-go/consensus/mock"

"github.com/multiversx/mx-chain-go/consensus/round"
consensusMocks "github.com/multiversx/mx-chain-go/testscommon/consensus"

"github.com/stretchr/testify/assert"
)

@@ -28,7 +30,7 @@ func TestRound_NewRoundShouldWork(t *testing.T) {

genesisTime := time.Now()

syncTimerMock := &mock.SyncTimerMock{}
syncTimerMock := &consensusMocks.SyncTimerMock{}

rnd, err := round.NewRound(genesisTime, genesisTime, roundTimeDuration, syncTimerMock, 0)

@@ -41,7 +43,7 @@ func TestRound_UpdateRoundShouldNotChangeAnything(t *testing.T) {

genesisTime := time.Now()

syncTimerMock := &mock.SyncTimerMock{}
syncTimerMock := &consensusMocks.SyncTimerMock{}

rnd, _ := round.NewRound(genesisTime, genesisTime, roundTimeDuration, syncTimerMock, 0)
oldIndex := rnd.Index()
@@ -61,7 +63,7 @@ func TestRound_UpdateRoundShouldAdvanceOneRound(t *testing.T) {

genesisTime := time.Now()

syncTimerMock := &mock.SyncTimerMock{}
syncTimerMock := &consensusMocks.SyncTimerMock{}

rnd, _ := round.NewRound(genesisTime, genesisTime, roundTimeDuration, syncTimerMock, 0)
oldIndex := rnd.Index()
@@ -76,7 +78,7 @@ func TestRound_IndexShouldReturnFirstIndex(t *testing.T) {

genesisTime := time.Now()

syncTimerMock := &mock.SyncTimerMock{}
syncTimerMock := &consensusMocks.SyncTimerMock{}

rnd, _ := round.NewRound(genesisTime, genesisTime, roundTimeDuration, syncTimerMock, 0)
rnd.UpdateRound(genesisTime, genesisTime.Add(roundTimeDuration/2))
@@ -90,7 +92,7 @@ func TestRound_TimeStampShouldReturnTimeStampOfTheNextRound(t *testing.T) {

genesisTime := time.Now()

syncTimerMock := &mock.SyncTimerMock{}
syncTimerMock := &consensusMocks.SyncTimerMock{}

rnd, _ := round.NewRound(genesisTime, genesisTime, roundTimeDuration, syncTimerMock, 0)
rnd.UpdateRound(genesisTime, genesisTime.Add(roundTimeDuration+roundTimeDuration/2))
@@ -104,7 +106,7 @@ func TestRound_TimeDurationShouldReturnTheDurationOfOneRound(t *testing.T) {

genesisTime := time.Now()

syncTimerMock := &mock.SyncTimerMock{}
syncTimerMock := &consensusMocks.SyncTimerMock{}

rnd, _ := round.NewRound(genesisTime, genesisTime, roundTimeDuration, syncTimerMock, 0)
timeDuration := rnd.TimeDuration()
@@ -117,7 +119,7 @@ func TestRound_RemainingTimeInCurrentRoundShouldReturnPositiveValue(t *testing.T

genesisTime := time.Unix(0, 0)

syncTimerMock := &mock.SyncTimerMock{}
syncTimerMock := &consensusMocks.SyncTimerMock{}

timeElapsed := int64(roundTimeDuration - 1)

@@ -138,7 +140,7 @@ func TestRound_RemainingTimeInCurrentRoundShouldReturnNegativeValue(t *testing.T

genesisTime := time.Unix(0, 0)

syncTimerMock := &mock.SyncTimerMock{}
syncTimerMock := &consensusMocks.SyncTimerMock{}

timeElapsed := int64(roundTimeDuration + 1)

22 changes: 11 additions & 11 deletions consensus/spos/bls/blsWorker.go
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import (
"github.com/multiversx/mx-chain-go/consensus/spos"
)

// peerMaxMessagesPerSec defines how many messages can be propagated by a pid in a round. The value was chosen by
// PeerMaxMessagesPerSec defines how many messages can be propagated by a pid in a round. The value was chosen by
// following the next premises:
// 1. a leader can propagate as maximum as 3 messages per round: proposed header block + proposed body + final info;
// 2. due to the fact that a delayed signature of the proposer (from previous round) can be received in the current round
@@ -16,15 +16,15 @@ import (
//
// Validators only send one signature message in a round, treating the edge case of a delayed message, will need at most
// 2 messages per round (which is ok as it is below the set value of 5)
const peerMaxMessagesPerSec = uint32(6)
const PeerMaxMessagesPerSec = uint32(6)

// defaultMaxNumOfMessageTypeAccepted represents the maximum number of the same message type accepted in one round to be
// DefaultMaxNumOfMessageTypeAccepted represents the maximum number of the same message type accepted in one round to be
// received from the same public key for the default message types
const defaultMaxNumOfMessageTypeAccepted = uint32(1)
const DefaultMaxNumOfMessageTypeAccepted = uint32(1)

// maxNumOfMessageTypeSignatureAccepted represents the maximum number of the signature message type accepted in one round to be
// MaxNumOfMessageTypeSignatureAccepted represents the maximum number of the signature message type accepted in one round to be
// received from the same public key
const maxNumOfMessageTypeSignatureAccepted = uint32(2)
const MaxNumOfMessageTypeSignatureAccepted = uint32(2)

// worker defines the data needed by spos to communicate between nodes which are in the validators group
type worker struct {
@@ -52,17 +52,17 @@ func (wrk *worker) InitReceivedMessages() map[consensus.MessageType][]*consensus

// GetMaxMessagesInARoundPerPeer returns the maximum number of messages a peer can send per round for BLS
func (wrk *worker) GetMaxMessagesInARoundPerPeer() uint32 {
return peerMaxMessagesPerSec
return PeerMaxMessagesPerSec
}

// GetStringValue gets the name of the messageType
func (wrk *worker) GetStringValue(messageType consensus.MessageType) string {
return getStringValue(messageType)
return GetStringValue(messageType)
}

// GetSubroundName gets the subround name for the subround id provided
func (wrk *worker) GetSubroundName(subroundId int) string {
return getSubroundName(subroundId)
return GetSubroundName(subroundId)
}

// IsMessageWithBlockBodyAndHeader returns if the current messageType is about block body and header
@@ -151,10 +151,10 @@ func (wrk *worker) CanProceed(consensusState *spos.ConsensusState, msgType conse
// GetMaxNumOfMessageTypeAccepted returns the maximum number of accepted consensus message types per round, per public key
func (wrk *worker) GetMaxNumOfMessageTypeAccepted(msgType consensus.MessageType) uint32 {
if msgType == MtSignature {
return maxNumOfMessageTypeSignatureAccepted
return MaxNumOfMessageTypeSignatureAccepted
}

return defaultMaxNumOfMessageTypeAccepted
return DefaultMaxNumOfMessageTypeAccepted
}

// IsInterfaceNil returns true if there is no value under the interface
Loading

Unchanged files with check annotations Beta

FROM golang:1.20.7 as builder

Check warning on line 1 in docker/keygenerator/Dockerfile

GitHub Actions / build-docker-image (ubuntu-latest)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
RUN apt-get update && apt-get install -y
WORKDIR /go/mx-chain-go