-
Notifications
You must be signed in to change notification settings - Fork 241
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
Unify optimized implementations #811
Unify optimized implementations #811
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #811 +/- ##
=======================================
Coverage 74.06% 74.06%
=======================================
Files 571 571
Lines 31726 31726
=======================================
Hits 23498 23498
Misses 8228 8228
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
src/ethereum_optimized/__init__.py
Outdated
for fork_name in ( | ||
"frontier", | ||
"homestead", | ||
"dao_fork", | ||
"tangerine_whistle", | ||
"spurious_dragon", | ||
"byzantium", | ||
"constantinople", | ||
"istanbul", | ||
"muir_glacier", | ||
"berlin", | ||
"london", | ||
"arrow_glacier", | ||
"gray_glacier", | ||
): |
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.
Is there some way we can put this information into the fork itself and retrieve it using functions from ethereum_spec_tools/forks.py
?
I really want to keep metadata about forks (like these pre-/post-merge lists) in as few places as possible.
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.
Having thought about this it is possible and I have done it.
f07d022
to
5360030
Compare
0911467
to
6d02d09
Compare
src/ethereum_optimized/__init__.py
Outdated
if ( | ||
isinstance(fork.criteria, ByBlockNumber) | ||
and fork.short_name != "paris" | ||
): | ||
monkey_patch_optimized_spec(fork.short_name) |
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.
Would the Hardfork.consensus
property from #820 work here?
6d02d09
to
21427b9
Compare
What was wrong?
Having to duplicate the code in
ethereum_optimized
on a per-fork basis was unwieldy and annoying.How was it fixed?
The optimized implementations now consist of a function that takes a fork and returns a dictionary of optimized patches.
Cute Animal Picture