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

Support Dao Fork and other state.fork options for t8n #737

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

gurukamath
Copy link
Collaborator

What was wrong?

The go-ethereum version of t8n supports various options for --state.fork which involve transition for one fork to the next at a certain block number. E.g - FrontierToHomesteadAt5. The t8n tool also doesn't support the DAO Fork.

Related to Issue #625

How was it fixed?

This commit adds support for the transition options. It also adds support for the Dao Fork.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov-commenter
Copy link

codecov-commenter commented Mar 26, 2023

Codecov Report

Patch coverage: 85.71% and project coverage change: +2.44 🎉

Comparison is base (05f6ab0) 82.47% compared to head (2af23de) 84.91%.

❗ Current head 2af23de differs from pull request most recent head c7afa88. Consider uploading reports for the commit c7afa88 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #737      +/-   ##
==========================================
+ Coverage   82.47%   84.91%   +2.44%     
==========================================
  Files         570      570              
  Lines       31568    31571       +3     
==========================================
+ Hits        26036    26810     +774     
+ Misses       5532     4761     -771     
Flag Coverage Δ
unittests 84.91% <85.71%> (+2.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/ethereum/dao_fork/fork.py 23.61% <50.00%> (+23.61%) ⬆️
src/ethereum/dao_fork/dao.py 100.00% <100.00%> (+100.00%) ⬆️

... and 35 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gurukamath gurukamath force-pushed the t8n-dao-fork branch 2 times, most recently from 2af23de to c7afa88 Compare March 26, 2023 06:57
Comment on lines +207 to +208
if t8n.fork_module == "dao_fork":
t8n.fork.apply_dao(state)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we run apply_fork for every fork, and not just the DAO fork?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The t8n inputs do not have enough details to re-create the entire chain which is why we decided to use the apply_body function as the point of entry for the tool. That is why I have also separated out the state changes in dao_fork into a different function apply_dao and used that instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I got that, I'm just thinking generally. I'd like to avoid the situation where every state modifying fork (all one of them 🤣) needs to be mentioned explicitly in this tool. Do we need to change apply_fork so it's better suited?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think forks that modify the state directly (like the DAO Fork) should be looked upon as more of an exception than a rule. But we can discuss this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have created an issue for this for now (see #740 ). Would like to implement the next few steps in the evm tools and re-visit this at a later point

src/ethereum_spec_tools/evm_tools/utils.py Outdated Show resolved Hide resolved
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>

The go-ethereum version of t8n supports various options for --state.fork which involve transition for one fork to the next at a certain block number. E.g - FrontierToHomesteadAt5. This commit adds support for these options. It also adds support for the Dao Fork.
@SamWilsn SamWilsn merged commit e4acb7e into ethereum:master Mar 30, 2023
@gurukamath gurukamath deleted the t8n-dao-fork branch March 31, 2023 18:42
@@ -12,6 +14,39 @@

W = TypeVar("W", Uint, U64, U256)

EXCEPTION_MAPS = {
"FrontierToHomesteadAt5": {
Copy link
Contributor

Choose a reason for hiding this comment

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

this logic can be done also on testers side. if tool is transition only it does not keep blockchain data.
so the testing tool can run it with Frontier or Homestead to build a transition chain

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.

4 participants