-
Notifications
You must be signed in to change notification settings - Fork 479
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
EIP-2935: Save historical block hashes in state #6925
Conversation
d89f1ae
to
9aed996
Compare
6dfa63a
to
f044dfe
Compare
src/Nethermind/Nethermind.Blockchain.Test/BlockhashProviderTests.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Blockchain.Test/BlockhashProviderTests.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs
Outdated
Show resolved
Hide resolved
BlockHeader header = currentBlock; | ||
for (var i = 0; i < Math.Min(Eip2935Constants.RingBufferSize, current); i++) | ||
{ | ||
// an extra check - don't think it is needed |
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.
I think it is needed when you start devnet from genesis or from early blocks with 2935
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.
I think it shouldn't be needed if for loop header would take it into account and I think it does - this could use a test and removing this.
Just to be sure - genesis block hash should be added to state or not? If it should then it currently isn't and it is consensus issue.
If genesis shouldn't be added then we either need this or have a conditional -1 on Math.Min(Eip2935Constants.RingBufferSize, current) if we go up to genesis.
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.
so it is handled by the loop - I will remove this check.
genesis is added to the state in current implementation also, we have a test for this. for adding genesis we dont need to iterate to block 0, we need to iterate to block 1, because we add the parent hash to the state.
Closes #6689
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs
. Remove if not applicable.Requires explanation in Release Notes
If yes, fill in the details here. Remove if not applicable.