-
Notifications
You must be signed in to change notification settings - Fork 370
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
Berlin support #40
Merged
Merged
Berlin support #40
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
d7ea767
Initial stab at EIP-2929 support
birchmd 8c24c13
Revert "Initial stab at EIP-2929 support"
birchmd b471064
Another try at EIP-2929 (I think this one is better)
birchmd 5ee05ae
Cleanup
joshuajbouw 7654641
Clean up costs
joshuajbouw a08f255
Add `Precompiles` trait
joshuajbouw 4d7c084
Update other costs
joshuajbouw 7705151
General fixes
joshuajbouw 238f262
Avoid unnecessary Vec allocation
birchmd d5c078a
Ensure precompile addresses are added to storage access in create cal…
birchmd a75b46f
Fix benches compilation
birchmd 3674356
Initialize accessed_addressed with caller too
birchmd 712e7c3
Export Precompile at root
joshuajbouw 224a471
Enable EIP-2929 for Berlin
joshuajbouw 45de2a4
Update accessed_addresses and accessed_storage_keys on read/write; sc…
birchmd a2410a5
Fix sload cost
birchmd 40c1023
Fix sstore refund
birchmd 3e081dc
Fix random state test 649 (see https://github.com/ethereum/tests/comm…
birchmd 0b07823
EIP-2930 support
birchmd 7a74753
Fix bug in EIP-1706 implementation. Note the spec says _less than or …
birchmd bf2fb77
Import alloc types
birchmd 09d4fe0
Precompiles trait refactor
birchmd 0bd05b1
Merge branch 'master' into berlin-support
joshuajbouw f230e7d
Update `transact_call` documentation
joshuajbouw 49aefb2
Merge remote-tracking branch 'aurora-is-near/master' into berlin-support
joshuajbouw 384ff22
cargo fmt
joshuajbouw d3adea7
Merge remote-tracking branch 'origin/master' into berlin-support
joshuajbouw 335e2d9
Clippy fix
birchmd 9bee750
Add comment to memory.rs change
birchmd 79d12b1
get_accessed_addresses -> accessed_addresses
joshuajbouw d16bdec
Don't imply use of a single state for precompiles
joshuajbouw c2af451
Move access lists to metadata
joshuajbouw 6b46fa8
Handle all clippy errors
joshuajbouw 56a7ee0
Remove debug asserts (they do not passs Istanbul tests)
birchmd 2c92477
Remove commented out code
birchmd 62c1c52
Resore immutability of gas_cost calls
birchmd 0d70657
Remove obsolete additions made to gasometer
birchmd 2a08e99
Fix storage access tracking and is_cold functionality
birchmd a252024
Move, do not copy, access struct in swallow_commit
birchmd 51d6876
Merge branch 'master' into berlin-support
joshuajbouw 5bad029
Use precompile type over trait
joshuajbouw 865af75
Fix min version of ethereum dependency
joshuajbouw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is actually not necessary for semantics, since below we call
set
, and within that function it checked the len is zero case.I understand the concern of a short-cut here since we do not need to do additional checks below, but there are indeed several things:
ErrorFatal::NotSupported
check but not above. TheErrorFatal
type is a unique error type not covered in spec but useful in practice for non-metered cases -- it ensures we can always handle the addressing spaces since EVM supports 256-bit memory, but in reality all current EVM executors can only support up to 64-bit memory running on x86_64.set
andcopy_large
is already quiet complex and it happened that some trivial changes in the past caused compliance issue. We should really not add additional "patches" unless necessary and instead prefer to fully refactor those two functions.With all the above said, my current recommendation is to remove this change. We then spend some time refactor
set
andcopy_large
to make it less error-prone and then consider to add those sugar-sized optimizations.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 added this change to pass this eth json test (you can see it linked from the commit where the change was introduced).
That eth json test was added before Berlin tests so when we updated the evm tests repo to point at a later version of ethereum tests this change was needed to have them all pass.
I agree it's a little hacky, but I do not think we should block merging Berlin changes to refactor the memory functions. We could create an issue to do that refactoring and come back to it after Berlin changes are merged.
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.
We don't need that now though -- till the moment we update jsontests.
Alternatively, you can add comments to this line explaining why this is introduced now, and that this is a temporary solution and will eventually be refactored. The priority here should be to avoid more confusions.
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.
Added a comment in 9bee750
Are we not going to update the jsontests along side this PR?
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.
That's what I am confused about, as jsontests will be updated immediately after.