-
Notifications
You must be signed in to change notification settings - Fork 1.2k
pallet_revive: Add dry-run timestamp override support #10191
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 all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
da1baf8
add eth_transact_at_time
mokita-j bd927ad
add: local timestamp in estimate_gas
mokita-j b75f9ff
refactor: merge eth_transact_at_time into eth_transact
mokita-j c4ea78f
change estimate_gas block default to pending
mokita-j de1a294
add: timestamp to eth_call
mokita-j 3ec16d5
refactor timestamp source & fix tests
mokita-j ae99522
remove redundant logs and comments
mokita-j 0db67ae
add: dry_run timestamp override tests
mokita-j 8d39a29
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] fa6888b
format with fmt
mokita-j 0b9825f
fix prdoc bump
mokita-j e107143
refactor dry_run api
mokita-j e4a3dae
format with fmt
mokita-j 4b353ed
remove log
mokita-j fa5d203
remove unused imports
mokita-j 2fd4af1
refactor with_dry_run
mokita-j d9f24fe
fix: increment block iff timestamp_override is provided
mokita-j 1d1170f
refactor: dry_run_override into is_dry_run
mokita-j 8ca05c5
Merge remote-tracking branch 'origin/master' into mj/fix-dry-run-time…
mokita-j aa531f9
update: tests-evm hash
mokita-j 71ff4fb
slight adjustments
pgherveou e1a46e5
fix dry run config
mokita-j de9475c
fix
pgherveou 7b77659
move things around
pgherveou 2e6c186
add: fallback to eth_transact if eth_transact_config not available
mokita-j fd0746f
fix
pgherveou 68bb7ff
Update substrate/frame/revive/src/evm/api/rpc_types.rs
pgherveou 73c7bcf
fix clippy
pgherveou 239edb3
refactor to saturating add & add DryRunConfig constructor
mokita-j 056c19d
apply suggestion
pgherveou d5b5a0b
add name to print
pgherveou 906f12e
fix
pgherveou 82c5714
address historical block use case
pgherveou 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
Some comments aren't visible on the classic Files Changed page.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,30 @@ | ||
| title: 'pallet_revive: Add dry-run timestamp override support' | ||
| doc: | ||
| - audience: Runtime User | ||
| description: |- | ||
| # Description | ||
|
|
||
| This PR updates `pallet-revive` to **support overriding the block timestamp during dry-run calls**. | ||
| The dry-run execution now uses the following configuration for `eth_estimateGas` and `eth_call` when the block tag is `pending`: | ||
|
|
||
| ```text | ||
| block.timestamp = max(rpc_timestamp, latest_block.timestamp + 1) | ||
| block.number = latest_block.number + 1 | ||
| ``` | ||
|
|
||
| Fixes [#153](https://github.com/paritytech/contract-issues/issues/153), [#205](https://github.com/paritytech/contract-issues/issues/205) | ||
|
|
||
| ## Integration | ||
|
|
||
| Downstream projects using the `ReviveApi::eth_transact` runtime API should either provide a `timestamp` or pass `None`. | ||
|
|
||
| ## Review Notes | ||
| - Added dry run timestamp to `ExecConfig`. | ||
| - Added a new parameter to `ReviveApi::eth_transact` for passing the current RPC timestamp. | ||
| - `eth_estimateGas` defaults to the `pending` block tag. | ||
| - `eth_estimateGas` and `eth_call` with `pending` block tag will dry run the transaction with the block timestamp set to `max(rpc_timestamp, latest_block.timestamp + 1)` and block number set to `latest_block.number + 1`. | ||
| crates: | ||
| - name: pallet-revive-eth-rpc | ||
| bump: major | ||
| - name: pallet-revive | ||
| bump: major |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
AFAIK this defaults to
latest. Butestimate_gasshould default topending.callshould continue to default tolatest.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.
PG and I tried this test here and it seems that geth is defaulting to
latest