-
Notifications
You must be signed in to change notification settings - Fork 359
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
External cost recorder #170
Merged
sorpaas
merged 18 commits into
rust-ethereum:master
from
moonbeam-foundation:tgm-record-external-cost
Jun 21, 2023
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
94c9036
Add support for external cost recording
tgmichel 932044e
Add refund methods
tgmichel 44b5296
Modify `refund_external_cost` signature
tgmichel 70cc197
Add `record_external_static_opcode_cost` method
tgmichel 9e7568e
Handle code size hash oog
tgmichel 6f46413
Temp remove static external cost accounting
tgmichel ba318ee
`call` fn call must be able to oog
tgmichel 3d733d7
Merge branch 'master' into tgm-record-external-cost
tgmichel a9bf609
Prevent exiting substate on top level create function
tgmichel c3db477
`transact_create2`
tgmichel 1b902f6
ci
tgmichel 269f83f
`record_external_dynamic_opcode_cost` only `with-substrate`
tgmichel 5b2c10c
fmt
tgmichel f9b8dd9
clippy
tgmichel 1fe19d1
`ExternalOperation` handling
tgmichel 6171ea3
remove `with-substrate` feature
tgmichel 1e497c5
add missing `AccountBasicRead` to `call_inner`
tgmichel 53315e2
fmt
tgmichel 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use primitive_types::H160; | ||
|
||
/// Operations for recording external costs | ||
pub enum ExternalOperation { | ||
/// Reading basic account from storage. Fixed size. | ||
AccountBasicRead, | ||
/// Reading address code from storage. Dynamic size. | ||
AddressCodeRead(H160), | ||
/// Basic check for account emptiness. Fixed size. | ||
IsEmpty, | ||
/// Writing to storage. Fixed size. | ||
Write, | ||
} |
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
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.
Can we still implement this for
&mut
andBox
?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.
Anyway, I'm fine keeping this as is for now.
A refactoring we can do is to move
record_external_operation
into a separate traitRecord
, and then add yet another type parameter toStackExecutor
R: Record
. Then we can uncomment this again.But the changes are already huge so we can do that in a separate PR.