-
Notifications
You must be signed in to change notification settings - Fork 274
Precompile pre post handling #524
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
6a3ebe1
Re-apply warp precompile interface changes
aaronbuchwald 9474829
Address nits
aaronbuchwald 0d2c92b
Merge branch 'master' into precompile-pre-post-handling
aaronbuchwald 29277c5
Separate predicate storage slot preparation into separate function in…
aaronbuchwald 83036b7
fix lint
aaronbuchwald 7e10491
improve miner enforcePredicates comment
aaronbuchwald dcfd120
Merge branch 'master' into precompile-pre-post-handling
aaronbuchwald 584bcaa
Add HashSliceToBytes test case for empty slice
aaronbuchwald 73aee4b
Address comments
aaronbuchwald 2eff72e
Address comments WIP
aaronbuchwald e3c0899
Pre+post handling diff for shared mem precompile
cd79963
Separate proposer and general precompile predicates
aaronbuchwald be31bea
Update ShouldVerifyWithContext to return true iff proposer predicate …
aaronbuchwald 67b7f7c
Add checkPredicates unit test
aaronbuchwald 0d4ad9f
Merge branch 'master' into precompile-pre-post-handling
aaronbuchwald cde76df
Merge branch 'precompile-pre-post-handling' into precompile-pre-post-…
aaronbuchwald ffdda86
Update .gitignore
aaronbuchwald e6d6d78
goimports
aaronbuchwald 794122d
update
aaronbuchwald eb2bb88
goimports config
aaronbuchwald 2edac77
Address PR review comments and improve comments
aaronbuchwald 15bcbe8
Merge branch 'master' into precompile-pre-post-handling
aaronbuchwald 485ed59
Fix typo
aaronbuchwald 5fa5bb5
Address PR comments
aaronbuchwald 67116e0
Add rules into PrepareAccessList
aaronbuchwald 972e486
Only copy bytes in preparePredicates if predicate precompile is active
aaronbuchwald 9d5246c
Merge branch 'master' into precompile-pre-post-handling
aaronbuchwald 336f0cc
Address PR comments
aaronbuchwald 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
Pre+post handling diff for shared mem precompile
- Loading branch information
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // (c) 2023, Ava Labs, Inc. All rights reserved. | ||
| // See the file LICENSE for licensing terms. | ||
|
|
||
| package evm | ||
|
|
||
| import ( | ||
| "github.com/ava-labs/avalanchego/chains/atomic" | ||
| "github.com/ava-labs/avalanchego/ids" | ||
| "github.com/ava-labs/subnet-evm/precompile/contract" | ||
| ) | ||
|
|
||
| var _ contract.SharedMemoryWriter = &sharedMemoryWriter{} | ||
|
|
||
| type sharedMemoryWriter struct { | ||
| requests map[ids.ID]*atomic.Requests | ||
| } | ||
|
|
||
| func NewSharedMemoryWriter() *sharedMemoryWriter { | ||
aaronbuchwald marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return &sharedMemoryWriter{ | ||
| requests: make(map[ids.ID]*atomic.Requests), | ||
| } | ||
| } | ||
|
|
||
| func (s *sharedMemoryWriter) AddSharedMemoryRequests(chainID ids.ID, requests *atomic.Requests) { | ||
| mergeAtomicOpsToMap(s.requests, chainID, requests) | ||
| } | ||
|
|
||
| // mergeAtomicOps merges atomic ops for [chainID] represented by [requests] | ||
| // to the [output] map provided. | ||
| func mergeAtomicOpsToMap(output map[ids.ID]*atomic.Requests, chainID ids.ID, requests *atomic.Requests) { | ||
| if request, exists := output[chainID]; exists { | ||
| request.PutRequests = append(request.PutRequests, requests.PutRequests...) | ||
| request.RemoveRequests = append(request.RemoveRequests, requests.RemoveRequests...) | ||
| } else { | ||
| output[chainID] = requests | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.