-
Notifications
You must be signed in to change notification settings - Fork 16
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
Validate block hash and signatures #808
Conversation
c43e6a4
to
9530a60
Compare
9b83557
to
f911d5b
Compare
c850bc0
to
bfc25ef
Compare
838e083
to
1afca6a
Compare
e2e/features/validator.feature
Outdated
And I restart the validator | ||
And I wait for my node to be synced | ||
Then My node should be a validator | ||
# Scenario: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this?
112910f
to
3959f0c
Compare
@@ -37,11 +35,12 @@ func WaitMined(ctx context.Context, backend Backend, txHash common.Hash) (*types | |||
} else { | |||
logger.Trace("Transaction not yet mined") | |||
} | |||
// Wait for the next round. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could check ctx timeout and break the func being a loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check is a few lines below the code fragment :)
client/core/state/statedb.go
Outdated
}) | ||
|
||
if revertedIndex == -1 { | ||
panic(fmt.Errorf("revision id %v cannot be reverted. found the revision at index %d. latest revision index %d", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not our normal log.Crit
with context
votes map[common.Hash]*Vote // non-nil votes | ||
nilVotes map[common.Hash]*Vote // nil votes | ||
counter map[common.Hash]int // map[block.Hash]count | ||
isVoted map[common.Address]struct{} // map[voterAddress]count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if you need this, the votes
could be replaced by AddressVote
?
89f12ae
to
5687ad6
Compare
5687ad6
to
4748217
Compare
4748217
to
5aeaa84
Compare
f5721c7
to
94cc480
Compare
On the local cluster, I get errors like
|
dbde51c
to
9b8dc01
Compare
9b8dc01
to
62c3cd6
Compare
61d90f1
to
abddd3d
Compare
abddd3d
to
3573d76
Compare
It's a first iteration fixing our consensus and voting.
When I had added proposed block and block fragments validation, the consensus crushed, panicked and crushed. So I had to make many changes until it started work better.
Main changes:
votingSystem
algorithmvalidator.Start
twice, that was caused incorrect voting, a part ofMerkle proof
errors and allduplicate vote
errors.voting_table
while checking for duplicated votesclient/core/voting_table_test.go
to remove shared state between tests and data racesclient/knode/validator/validator.go
val.round is always 0:init -> val.round = 0
,newRoundState -> if val.round != 0 -> val.round++
. It causes that a part of init doesn't work and votingSystem always gets round=0 (causes duplicate votes). So added a proper round change and inits.Cons:
crush-recovery
doesn't work fine.Closes #787 #91
Next steps are in #837