Fresh runtime api instance per call estimation#565
Merged
sorpaas merged 4 commits intopolkadot-evm:masterfrom Feb 24, 2022
Merged
Fresh runtime api instance per call estimation#565sorpaas merged 4 commits intopolkadot-evm:masterfrom
sorpaas merged 4 commits intopolkadot-evm:masterfrom
Conversation
sorpaas
approved these changes
Feb 15, 2022
Member
|
LGTM, but need to resolve conflicts. |
# Conflicts: # client/rpc/src/eth.rs
Contributor
Author
|
done |
boundless-forest
pushed a commit
to darwinia-network/frontier
that referenced
this pull request
Mar 2, 2022
* Fresh runtime api instance per call estimation * rustfmt skip * fmt
jordy25519
pushed a commit
to cennznet/frontier
that referenced
this pull request
Apr 6, 2022
* Fresh runtime api instance per call estimation * rustfmt skip * fmt
18 tasks
boundless-forest
pushed a commit
to darwinia-network/frontier
that referenced
this pull request
May 11, 2022
* Fresh runtime api instance per call estimation * rustfmt skip * fmt
32 tasks
abhijeetbhagat
pushed a commit
to web3labs/frontier
that referenced
this pull request
Jan 11, 2023
* Fresh runtime api instance per call estimation * rustfmt skip * fmt
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A new
ApiRefinstance needs to be used per execution to avoid the overlayed state to affect the estimation result of subsequent calls.Note that this would have a performance penalty if we introduce gas estimation for past blocks - and thus, past runtime versions - in the future. Substrate has a
runtime_cache_size(introduced in paritytech/substrate#10177) which defaults to 2 slots LRU-style, meaning if users were to access multiple runtime versions (more than 2) in a short period of time, the RPC response time would degrade a lot, as theVersionedRuntimeneeds to be compiled to occupy a slot.To solve that, and if we introduce historical gas estimation, we'd need to increase value.