-
Notifications
You must be signed in to change notification settings - Fork 757
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
Chain setup API / Centralize default HF / Common options dict / Block HFbyBlockNumber & initWithGenesisHeader options #863
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
Ok, this got a bit out of hand and one thing lead to another. 😄 I will repurpose the target of this PR to be just preparatory work, otherwise things would get too hard too review, hope I am not yet too much out of the scope here. Nevertheless once tests pass here this would be open for review, you should likely do commit-by-commit for a better overview, the single commits are relatively well structured. This PR addresses a lot of issues we had discussed lately with the
Sorry that this got so complex but actually all of the changes from above got triggered by follow-up demands of previous changes so that things got consistent again. Hope it was worth the effort and we get this merged. 😀 If you see improvements to be done feel free - with a short note on Discord maybe - to directly work on this and push here. |
Wow this is a heavy one - but the description of these changes sound all super good to me! I don't think it is efficient if I start looking at why tests fail at this point but let me know if I can help over there. I will quickly glance over this code and comment on it. |
@jochem-brouwer thanks! 😄 I think one think which would be the most effective would be if you do a commit-by-commit review - I won't do any rebases here any more or something and this will remain stable - and if you then explicitly confirm which commits have been reviewed. |
@jochem-brouwer pushed again and fixed (hopefully, we'll see on CI) VM API tests failing. Selected state tests are still failing if you want to have a look there once time permits that would be extremely helpful. |
8a25277
to
63a3560
Compare
State tests fail to run:
Looks like the state test runner still uses the chain/hf options in the constructor. |
Looked over the commits, have to do a more thorough review later. |
ce4796d
to
93c63eb
Compare
…on as preparation for new eips option and future non-breaking option additions
…t if none provided, before: null), remove static default HF references from VM, tx
… chain/hardfork options, added Common method setHardforkByBlockNumber()
…der init to constructor, made setGenesisParams() private
…thash, removed chain/hardfork options for blockchain
…s to prevent implicitly wrong chain setups, fixed VM API tests
93c63eb
to
bd9ce1d
Compare
…AULT_HARDFORK to class, small fixes
0f5a7ea
to
82cb0d3
Compare
Rebased this, had a final more distant look and I think I am now confident on all changes. Did some last fixes and modifications - with the most notable being DEFAULT_HARDFORK moved inside the Common class as a readonly param to be accessible from a Common instance. Tests are now passing, the So this should be ready to review now. 😄 |
fix small typo
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.
love it, great PR and nice improvements!
i saw updates to the changelogs for blockchain and vm, but not for:
- block
- constructor opts
- new opts: hardforkByBlockNumber, initwithGenesisHeader
- tx
- constructor opts (i made a note and can include this in my tx refactor pr since I set up the unreleased changelog notes in there)
- common
- setHardforkForBlockNumber
This PR is big enough as it is so I will merge in and we can handle the above separately :)
(also need to regenerate the docs, but that can be done closer to v5 release prep)
This PR prepares for the rework of EIP support as a follow-up on #856
I moved Common to be instantiated with an option dictionary - like we do in most of the other libraries too - should be a good occasion to do this now since we are right before a breaking release anyhow.
This prepares for a new to be added
eips
option, things would otherwise slowly getting too ugly with all the optional parameters chained. It also makes the library more future proof by preparing the ground for future non-breaking option additions.First push here to see if all tests in related consuming libraries pass.