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

Fixed ExtraData in MiningConfig #4665 #4734

Merged
merged 3 commits into from
Oct 12, 2022
Merged

Fixed ExtraData in MiningConfig #4665 #4734

merged 3 commits into from
Oct 12, 2022

Conversation

OlegJakushkin
Copy link
Contributor

Fixes #4665

Changes:

  • Issue 4665 describes not configurable block extra data and also highlights a few places where ExtraData is hardcoded in different ways.
  • As block creation is a Core functionality it touches a lot of components that provide block creation.
  • This PR provides ability to configure ExtraData from IMiningConfig and expands on preexisting ExtraData roots in MiningConfig
  • This PR also affects unit tests and highlights the problem of hardcoded serialized block values

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing
Tested locally with Goreli, Unit Tested locally, requires wider testing as the this is implementer's first issue

  • Yes
  • No

In case you checked yes, did you write tests??
All new code developed in the fixing of this issue has Unit Tests MiningConfigTest.cs

  • Yes
  • No

Comments about testing, should you have some (optional)
Not 100% of unit tests do currently pass on stand-alone windows (yet the same amount of tests fail on this PR Unit test results as on Master nethermind brunch)

Added it to referenced in the issue-4665 locations and their references
@@ -113,8 +115,58 @@ public virtual async Task forkchoiceUpdatedV1_should_communicate_with_boost_rela
.WithContent("{\"timestamp\":\"0x3e8\",\"prevRandao\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"suggestedFeeRecipient\":\"0x0000000000000000000000000000000000000000\"}")
.Respond("application/json", "{\"timestamp\":\"0x3e9\",\"prevRandao\":\"0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760\",\"suggestedFeeRecipient\":\"0xb7705ae4c6f81b66cdb323c65f4e8133690fc099\"}");

//TODO: think about extracting an essely serialisable class, test its serializatoin sepratly, refactor with it similar methods like the one above
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing - typo: sepratly

Copy link
Contributor

@MarekM25 MarekM25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! :) Let's make CI green and test it on sepolia validators

Missed the constant variable override
@OlegJakushkin
Copy link
Contributor Author

@MarekM25 Please review the update (1 hardcoded hash line update)

@OlegJakushkin OlegJakushkin merged commit 0fb83df into NethermindEth:master Oct 12, 2022
@OlegJakushkin OlegJakushkin deleted the issue-4665 branch October 12, 2022 09:53
rubo pushed a commit that referenced this pull request Oct 13, 2022
* Fixed ExtraData in MiningConfig

Added it to referenced in the issue-4665 locations and their references

* Updated Unit test

Missed the constant variable override
@OlegJakushkin
Copy link
Contributor Author

Samples of configuration in-use
https://sepolia.etherscan.io/block/2085685 with extra
https://sepolia.etherscan.io/block/2085705 with extra
https://sepolia.etherscan.io/block/2085714 with extra
https://sepolia.etherscan.io/block/2085765 no extra
https://sepolia.etherscan.io/block/2085782 no extra
https://sepolia.etherscan.io/block/2085783 no extra

Shout out to the Angkor team; thanks for your help in the testing of this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ExtraData to PostMergeBlockProducer
3 participants