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

fix(lib/grandpa): avoid spamming round messages #2688

Merged
merged 175 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from 167 commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
88a4a0e
fix: improve sending vote messages and neighbor messages
EclesioMeloJunior Jul 22, 2022
9f073d6
chore: using `notifyNeighbor` goroutine func
EclesioMeloJunior Jul 22, 2022
499e552
chore: solve ci lint warns
EclesioMeloJunior Jul 22, 2022
66063cb
chore: solve `broadcastVotes` test helper to only broadcast `*VoteMes…
EclesioMeloJunior Jul 26, 2022
34b4a3d
chore: improve tests to neighbor messages
EclesioMeloJunior Jul 26, 2022
42b68bc
chore: solve lint warns
EclesioMeloJunior Jul 26, 2022
2b0c4e3
chore: improve not needed long for loop
EclesioMeloJunior Jul 26, 2022
3bad27e
chore: include unit tests
EclesioMeloJunior Jul 27, 2022
5f65292
chore: solve lint warns
EclesioMeloJunior Jul 27, 2022
3a418bc
chore: use incoming messages to decide when determine prevotes
EclesioMeloJunior Aug 11, 2022
0d8adec
fix: improve sending vote messages and neighbor messages
EclesioMeloJunior Jul 22, 2022
f5a0223
chore: using `notifyNeighbor` goroutine func
EclesioMeloJunior Jul 22, 2022
c23cff5
chore: solve ci lint warns
EclesioMeloJunior Jul 22, 2022
f21a428
chore: solve `broadcastVotes` test helper to only broadcast `*VoteMes…
EclesioMeloJunior Jul 26, 2022
71e4ce1
chore: improve tests to neighbor messages
EclesioMeloJunior Jul 26, 2022
397ce6d
chore: solve lint warns
EclesioMeloJunior Jul 26, 2022
3167c10
chore: improve not needed long for loop
EclesioMeloJunior Jul 26, 2022
bf39c24
chore: include unit tests
EclesioMeloJunior Jul 27, 2022
c9d9342
chore: solve lint warns
EclesioMeloJunior Jul 27, 2022
3561513
chore: use incoming messages to decide when determine prevotes
EclesioMeloJunior Aug 11, 2022
ecd6d93
chore: fix lint
EclesioMeloJunior Aug 15, 2022
8d79daa
Merge branch 'eclesio/fix/sending-votes-wrong-stage' of github.com:Ch…
EclesioMeloJunior Aug 15, 2022
075c070
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Aug 16, 2022
d15537c
chore: remove skip cache check when receive the same vote
EclesioMeloJunior Aug 16, 2022
7863b97
chore: resolve diffs and deltas
EclesioMeloJunior Aug 16, 2022
240070a
chore: resolve diffs and deltas
EclesioMeloJunior Aug 16, 2022
f540d91
chore: rename to `determinePrecommitCh`
EclesioMeloJunior Aug 16, 2022
053ee06
chore: stop `sendPrevoteMessage` once we reach the prevotes threshold
EclesioMeloJunior Aug 17, 2022
82730f0
chore: waits until round is finalizable
EclesioMeloJunior Aug 17, 2022
87c2dff
chore: remove `ctx` from goroutines and rely on `isFinalizableCh`
EclesioMeloJunior Aug 17, 2022
ec36847
chore: wip removing commit message
EclesioMeloJunior Aug 18, 2022
68dd6e8
chore: send commit message after round is finalizable
EclesioMeloJunior Aug 18, 2022
6eb34d4
Tim/fix/sending votes wrong stage (#2761)
timwu20 Aug 22, 2022
aef29de
wip: round_tests.go
EclesioMeloJunior Aug 23, 2022
bba4474
chore: wip tests
EclesioMeloJunior Aug 23, 2022
9b6dca3
chore: fixed tests to ensure we send messages in the right round
EclesioMeloJunior Aug 23, 2022
aff2de7
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Aug 24, 2022
5ddfd63
chore: solve lint wanrs
EclesioMeloJunior Aug 24, 2022
651926e
chore: skip lint `unparam`
EclesioMeloJunior Aug 24, 2022
af41370
chore: solve `varying chain` grandpa finalization test
EclesioMeloJunior Aug 29, 2022
41fa913
chore: solve all tests after `playGrandpaRound` refactor
EclesioMeloJunior Aug 30, 2022
b8d67e3
chore: solve lint warns
EclesioMeloJunior Aug 30, 2022
bf7a1a0
chore: solve lint warns
EclesioMeloJunior Aug 30, 2022
da7353b
chore: keep config.toml as development
EclesioMeloJunior Aug 31, 2022
ac55379
chore: fix test hanging due to unbuffered channel
EclesioMeloJunior Aug 31, 2022
a78577e
chore: improve error wrappings
EclesioMeloJunior Sep 8, 2022
5177a72
chore: solve lint warns
EclesioMeloJunior Sep 8, 2022
79f42c6
chore: solve main issues with finalization and tests
EclesioMeloJunior Sep 15, 2022
10343fe
chore: fix finalization issue on rpc tests with only one authority
EclesioMeloJunior Sep 15, 2022
ce4b103
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Sep 15, 2022
7c71d29
chore: solve `state_subscribeStorage` rpc test problems
EclesioMeloJunior Sep 15, 2022
ff6a0b8
Merge branch 'eclesio/fix/sending-votes-wrong-stage' of github.com:Ch…
EclesioMeloJunior Sep 15, 2022
98773ff
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Sep 15, 2022
9edd8cf
wip: addressing comments
EclesioMeloJunior Sep 20, 2022
6d2fdb8
wip: addressing comments/implementing service interface
EclesioMeloJunior Sep 21, 2022
8d1af70
chore: introducing service pattern in grandpa pkg
EclesioMeloJunior Sep 26, 2022
35b6cff
fix: runtime issue while running gossamer node
EclesioMeloJunior Sep 27, 2022
42b8337
wip: getPrevotedBlock does not returns the supermajority prevoted block
EclesioMeloJunior Sep 27, 2022
cb2028f
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Sep 27, 2022
eabb3b7
chore: introduce service arch in grandpa package + fix tests
EclesioMeloJunior Oct 3, 2022
db0d517
chore: fix lint + license
EclesioMeloJunior Oct 3, 2022
f4aa3ec
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Oct 3, 2022
2dae537
chore: fix mocks
EclesioMeloJunior Oct 3, 2022
241d2ba
fix: mocks
EclesioMeloJunior Oct 3, 2022
2dc205e
chore: revert unneeded diffs
EclesioMeloJunior Oct 4, 2022
0d3934d
chore: addressing comments
EclesioMeloJunior Oct 4, 2022
558ce7a
chore: improve logs/errors
EclesioMeloJunior Oct 4, 2022
ee27001
chore: solve panic while running tests
EclesioMeloJunior Oct 5, 2022
8c1c38d
chore(dot/rpc/modules): narrower `TransactionStateAPI` interface (#2863)
qdm12 Oct 4, 2022
6753022
chore(deps): bump github.com/breml/rootcerts from 0.2.7 to 0.2.8 (#2870)
dependabot[bot] Oct 4, 2022
e44e343
chore(deps): bump github.com/klauspost/compress from 1.15.10 to 1.15.…
dependabot[bot] Oct 4, 2022
3ad50f4
chore(deps): bump github.com/jpillora/ipfilter from 1.2.7 to 1.2.8 (#…
dependabot[bot] Oct 5, 2022
7ba3df6
chore: apply suggestions + fix tests
EclesioMeloJunior Oct 5, 2022
c4ffb5c
chore(lib/trie): split fuzz testing of the trie (#2653)
qdm12 Oct 6, 2022
39f51c0
chore(chain, cmd, dot): Change retain blocks type to be `uint32` (#2877)
axaysagathiya Oct 6, 2022
3ddde15
fix(lib/babe): Unrestricted Loop When Building Blocks (GSR-19) (#2632)
edwardmack Oct 6, 2022
e522a25
Implement parachain inherents (#2566)
kishansagathiya Oct 7, 2022
5e5bb4d
fix: gossip block announce only after block sucessfully imported
EclesioMeloJunior Oct 10, 2022
98a70a4
chore: imported block could be a best block
EclesioMeloJunior Oct 10, 2022
1665324
chore: fix lint warns
EclesioMeloJunior Oct 11, 2022
cc6a2c5
chore: simplify bool var, remove unneeded comment
EclesioMeloJunior Oct 11, 2022
988653c
chore(lib/trie): `LoadFromMap` as function for transactional trie mut…
qdm12 Oct 11, 2022
ff14ea8
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Oct 12, 2022
9186c58
chore: `VoteMessage` String method
EclesioMeloJunior Oct 12, 2022
53f0c6d
chore: reverting deltas
EclesioMeloJunior Oct 12, 2022
914c69d
chore: clear comment
EclesioMeloJunior Oct 12, 2022
784ce07
chore: clear comment
EclesioMeloJunior Oct 12, 2022
ae392bb
Merge branch 'eclesio/fix/sending-votes-wrong-stage' of github.com:Ch…
EclesioMeloJunior Oct 12, 2022
c7adb22
chore: change error signature
EclesioMeloJunior Oct 13, 2022
fc716a7
chore: substantial changes to finalization handler
EclesioMeloJunior Oct 19, 2022
0d8ec97
chore: only share neighbor message if authority
EclesioMeloJunior Oct 19, 2022
587820d
chore: introduce mutexes, include `stop()` and add `default` to check…
EclesioMeloJunior Oct 20, 2022
6f42798
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Oct 21, 2022
b511a01
chore: apply suggested comments
EclesioMeloJunior Oct 24, 2022
edb0257
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Oct 24, 2022
5f507c3
chore: fix license
EclesioMeloJunior Oct 25, 2022
6e39c95
chore: fix lint warn
EclesioMeloJunior Oct 25, 2022
03d9cb5
chore: fix mock gen at grandpa pakcage
EclesioMeloJunior Oct 25, 2022
fd892fd
chore: new mock due file rename
EclesioMeloJunior Oct 25, 2022
9289b05
chore: fix test mock assertions
EclesioMeloJunior Oct 26, 2022
8221689
chore: fix lint warns
EclesioMeloJunior Oct 26, 2022
8182ba1
chore: remove unneeded function, remove wrapped errors
EclesioMeloJunior Oct 26, 2022
d068016
chore: use `continue` instead of `break`
EclesioMeloJunior Oct 26, 2022
02bfc67
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Oct 26, 2022
86a8559
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Oct 27, 2022
5ff0378
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Oct 29, 2022
cb18333
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Nov 1, 2022
ec1fa3f
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Nov 2, 2022
0e6d8de
chore: wip addressing comments
EclesioMeloJunior Nov 8, 2022
2d16fae
chore: return a combined error when both services fail
EclesioMeloJunior Nov 8, 2022
9edb9e8
chore: rename `timeoutStop` -> `timeout`
EclesioMeloJunior Nov 8, 2022
b0d27fb
chore: remove timeout inside `Stop` methods
EclesioMeloJunior Nov 8, 2022
e38972f
chore: improve `waitServices` comment
EclesioMeloJunior Nov 8, 2022
ed4ed1f
chore: simplify ephemeral services error channels
EclesioMeloJunior Nov 8, 2022
842f9b1
chore: remove hot select by putting the check outside of the select stmt
EclesioMeloJunior Nov 8, 2022
3c72c7b
chore: set `engineDone` to nil instead of `stopCh` in services defer
EclesioMeloJunior Nov 8, 2022
9eff714
chore: inverting position
EclesioMeloJunior Nov 8, 2022
d1c4e89
chore: stopping the `determinePrevoteTimer` when we return early
EclesioMeloJunior Nov 8, 2022
b2f02d4
chore: remove unneeded call top stop
EclesioMeloJunior Nov 8, 2022
80dffb0
chore: improving the error message
EclesioMeloJunior Nov 8, 2022
8903d2f
chore: address comments
EclesioMeloJunior Nov 8, 2022
6259c73
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Nov 8, 2022
0da0f50
chore: remove changes in the trackers
EclesioMeloJunior Nov 8, 2022
458397f
chore: link issue to todo mark
EclesioMeloJunior Nov 8, 2022
b661f42
chore: not needed deltas
EclesioMeloJunior Nov 8, 2022
c084684
chore: addressing comments
EclesioMeloJunior Nov 8, 2022
db8492f
chore: addressing comments
EclesioMeloJunior Nov 9, 2022
64579ff
chore: checking errorCh in a blocking manner
EclesioMeloJunior Nov 9, 2022
85148c1
chore: changing from `timer.After` to `time.Sleep`
EclesioMeloJunior Nov 9, 2022
376267c
chore: rename `finalization_test` to `finalization_integration_test` …
EclesioMeloJunior Nov 9, 2022
ea98e88
chore: changing log level from `Warnf` to `Debugf`
EclesioMeloJunior Nov 9, 2022
1d910f2
chore: ephemeral services rename `Start` to `Run`
EclesioMeloJunior Nov 9, 2022
5fb2960
chore: comment around `errorCh` drain
EclesioMeloJunior Nov 9, 2022
21d6cff
chore: simplify var declaration
EclesioMeloJunior Nov 9, 2022
3cd9f81
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Nov 9, 2022
88a15a0
chore: fix integration test ci packages
EclesioMeloJunior Nov 9, 2022
7ac4121
chore: address lint warns
EclesioMeloJunior Nov 9, 2022
16dffdd
chore: revert golang-ci lint to version `1.48`
EclesioMeloJunior Nov 9, 2022
f053524
chore: return error from `send(prevote|precommit)`
EclesioMeloJunior Nov 10, 2022
d8622e3
chore: returning an error instead of logging
EclesioMeloJunior Nov 10, 2022
78d5f0f
chore: addressing testing problems
EclesioMeloJunior Nov 10, 2022
4e733d3
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Nov 10, 2022
03543bc
chore: fixing integration tests
EclesioMeloJunior Nov 10, 2022
f96b933
Merge branch 'eclesio/fix/sending-votes-wrong-stage' of github.com:Ch…
EclesioMeloJunior Nov 10, 2022
cd56533
chore: creating new consts and putting test in the parent scope
EclesioMeloJunior Nov 10, 2022
469eff4
chore: remove `time.After` and let it hang
EclesioMeloJunior Nov 10, 2022
ba18277
chore: renaming err fields
EclesioMeloJunior Nov 10, 2022
7bb0323
chore: instead of stopping the handler we stop the specific service
EclesioMeloJunior Nov 10, 2022
1200174
chore: skip test being addressed by PR#2923
EclesioMeloJunior Nov 10, 2022
128bcd7
chore: remove the amount of lines used in the `stop` method
EclesioMeloJunior Nov 10, 2022
2a0daa3
chore: undo test skip
EclesioMeloJunior Nov 10, 2022
22a41fe
chore: fix lint
EclesioMeloJunior Nov 10, 2022
47d5c32
chore: remove unneeded defer code block
EclesioMeloJunior Nov 14, 2022
7ed0b1d
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Nov 14, 2022
6565bb5
chore: change `ErrBlockNumbersMismatch`
EclesioMeloJunior Nov 14, 2022
211e275
chore: rename test
EclesioMeloJunior Nov 16, 2022
c21b42a
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Nov 16, 2022
61cbf57
chore: move tests to `finalization_test.go` remove unneeded `time.Sleep`
EclesioMeloJunior Nov 16, 2022
9647301
chore: rename variables/struct names, using `fmt.Sprintf`
EclesioMeloJunior Nov 16, 2022
e355f38
chore: deref pointer in `verifyCommitMessageJustification`
EclesioMeloJunior Nov 16, 2022
9944bf0
chore: create tests for message_tracker commits
EclesioMeloJunior Nov 16, 2022
d66f888
chore: remove all `.Time(1)` from tests
EclesioMeloJunior Nov 16, 2022
0a838e5
chore: remove unneeded sleep
EclesioMeloJunior Nov 16, 2022
458e2a2
chore: renaming
EclesioMeloJunior Nov 16, 2022
eb00b02
chore: remove global test variables
EclesioMeloJunior Nov 16, 2022
96780f8
chore: add build tag
EclesioMeloJunior Nov 16, 2022
c5ebc53
chore: rename `finalization.go` to `finalisation.go`
EclesioMeloJunior Nov 16, 2022
358fbbb
chore: fix tests
EclesioMeloJunior Nov 16, 2022
f3bb5a7
chore: remove unneeded comment
EclesioMeloJunior Nov 16, 2022
d32cf74
chore: fixing tests
EclesioMeloJunior Nov 16, 2022
eca3a2a
chore: make functions available
EclesioMeloJunior Nov 17, 2022
f00b53b
chore: avoid unexpected assertion
EclesioMeloJunior Nov 17, 2022
f6322b6
chore: address comments regards tests
EclesioMeloJunior Nov 21, 2022
bc70d65
chore: solving test issues
EclesioMeloJunior Nov 21, 2022
7db3f31
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Nov 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
github.com/ChainSafe/gossamer/dot/rpc/modules,
github.com/ChainSafe/gossamer/lib/babe,
github.com/ChainSafe/gossamer/dot/sync,
github.com/ChainSafe/gossamer/lib/grandpa,
]
runs-on: ubuntu-latest
steps:
Expand Down
13 changes: 4 additions & 9 deletions lib/grandpa/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@ package grandpa

import (
"errors"
"fmt"

"github.com/ChainSafe/gossamer/lib/blocktree"
)

// errRoundMismatch is returned when trying to validate a vote message that isn't for the current round
func errRoundMismatch(got, want uint64) error {
return fmt.Errorf("rounds do not match: got %d, want %d", got, want)
}

var (
// ErrBlockDoesNotExist is returned when trying to validate a vote for a block that doesn't exist
ErrBlockDoesNotExist = errors.New("block does not exist")
Expand Down Expand Up @@ -60,6 +54,8 @@ var (

ErrBlockHashMismatch = errors.New("block hash does not correspond to given block number")

ErrBlockNumbersMismatch = errors.New("block numbers mismatch")

// ErrMinVotesNotMet is returned when the number of votes is less than the required minimum in a Justification
ErrMinVotesNotMet = errors.New("minimum number of votes not met in a Justification")

Expand All @@ -76,9 +72,6 @@ var (
// ErrCatchUpResponseNotCompletable is returned when the round represented by the catch up response is not completable
ErrCatchUpResponseNotCompletable = errors.New("catch up response is not completable")

// ErrServicePaused is returned if the service is paused and waiting for catch up messages
ErrServicePaused = errors.New("service is paused")

// ErrPrecommitSignatureMismatch is returned when the number of precommits
// and signatures in a CommitMessage do not match
ErrPrecommitSignatureMismatch = errors.New("number of precommits does not match number of signatures")
Expand All @@ -93,4 +86,6 @@ var (
errVoteToSignatureMismatch = errors.New("votes and authority count mismatch")
errVoteBlockMismatch = errors.New("block in vote is not descendant of previously finalised block")
errVoteFromSelf = errors.New("got vote from ourselves")
errRoundOutOfBounds = errors.New("round out of bounds")
EclesioMeloJunior marked this conversation as resolved.
Show resolved Hide resolved
errRoundsMismatch = errors.New("rounds mismatch")
)