-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Type:
Issue
What happened? / What do you need?:
While working on #808 a few issues were discovered:
-
We need something to not sync processes using
time.Sleep. It causes data races betweenFetcherandValidator. The consensus should not rely on sleep and waits. Ethereum can garauntee only ~7sec sync between peers, so we can't rely on sleeps ~ 100 - 1000ms -
Too complicated flow control in
client/knode/validator/validator.go
running int32
validating int32
canStart int32 // can start indicates whether we can start the validation operation
shouldStart int32 // should start indicates whether we should start after sync
isStarted int32 // is Start method has been already called
wg sync.WaitGroup
We should have as simple as possible flow control and validator start.
-
We're creating a few goroutines in
client/knode/validator/validator.gothat have no external control or a way to shutdown them. -
Something wrong with e2e tests. It looks racy or something. Eg:
./e2e --features ./features
....................P---.....P-....F----.P-.P- 46
--- Failed steps:
Scenario: Wrong chain ID # features/token.feature:22
And the token balance of A should be 15 mTokens # features/token.feature:25
Error: account 0xdEe18552F77aea976eABE2F0AaD2Ce413b17DC05 have 20000000000000000000 mTokens, expected 15000000000000000000
But Scenario: Wrong chain ID is in e2e/features/node.feature and it hasn't And the token balance of A should be 15 mTokens step.
All of them should be fixed and all code related to Validator should be rechecked and simplified.
- state initialization is devided between
init()andnewRoundState()methods. It leads to bugs
Priority:
High