-
Notifications
You must be signed in to change notification settings - Fork 521
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
Fresh runtime api instance per call estimation #565
Merged
sorpaas
merged 4 commits into
polkadot-evm:master
from
moonbeam-foundation:tgm-fix-runtimeapi-reuse
Feb 24, 2022
Merged
Fresh runtime api instance per call estimation #565
sorpaas
merged 4 commits into
polkadot-evm:master
from
moonbeam-foundation:tgm-fix-runtimeapi-reuse
Feb 24, 2022
Conversation
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
sorpaas
approved these changes
Feb 15, 2022
LGTM, but need to resolve conflicts. |
# Conflicts: # client/rpc/src/eth.rs
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
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
ApiRef
instance 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 theVersionedRuntime
needs to be compiled to occupy a slot.To solve that, and if we introduce historical gas estimation, we'd need to increase value.