-
Notifications
You must be signed in to change notification settings - Fork 143
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
Proposal: Fee upgrade process #120
Comments
Don't quite follow here. You said that in the non-sir case there are two lookups which is more expensive, but here you said it doesn't matter. Why? |
Clarified: But since a local receipt can't be created from another receipt (it can only be created directly form SignedTransaction), the SIR (Sender is Receiver) cost should be the same as non-sir. |
@evgenykuzyakov I still don't fully understand. When you create a receipt, couldn't |
Yes it can. While the fees are going to use |
Move `RuntimeConfig` from `Runtime` initialization to `ApplyState` object. This makes `Runtime` completely stateless and allows to execute transitions based on different configs. It allows to upgrade `RuntimeConfig` with the new fees based on the protocol version for the current block. This change should be NOOP and doesn't change the protocol. NEP: near/NEPs#120 Issue: #3158 # Test plan: - [X] CI - [x] http://nayduck.eastus.cloudapp.azure.com:3000/#/run/553
Move `RuntimeConfig` from `Runtime` initialization to `ApplyState` object. This makes `Runtime` completely stateless and allows to execute transitions based on different configs. It allows to upgrade `RuntimeConfig` with the new fees based on the protocol version for the current block. This change should be NOOP and doesn't change the protocol. NEP: near/NEPs#120 Issue: #3158 # Test plan: - [X] CI - [x] http://nayduck.eastus.cloudapp.azure.com:3000/#/run/553
Move `RuntimeConfig` from `Runtime` initialization to `ApplyState` object. This makes `Runtime` completely stateless and allows to execute transitions based on different configs. It allows to upgrade `RuntimeConfig` with the new fees based on the protocol version for the current block. This change should be NOOP and doesn't change the protocol. NEP: near/NEPs#120 Issue: #3158 # Test plan: - [X] CI - [x] http://nayduck.eastus.cloudapp.azure.com:3000/#/run/553
Move `RuntimeConfig` from `Runtime` initialization to `ApplyState` object. This makes `Runtime` completely stateless and allows to execute transitions based on different configs. It allows to upgrade `RuntimeConfig` with the new fees based on the protocol version for the current block. This change should be NOOP and doesn't change the protocol. NEP: near/NEPs#120 Issue: #3158 # Test plan: - [X] CI - [x] http://nayduck.eastus.cloudapp.azure.com:3000/#/run/553
To make sure we don't lose track of things, this is where the new costs are computed near/nearcore#3279. Data receipt creation cost will be reduced from 4.7Tgas to 0.03Tgas once we upgrade the fees. |
Fee upgrade process
This doc explains the process of upgrading Runtime fees in nearcore.
Background
We've decided to upgrade contracts compilation cache from fully in-memory cache to a on-disk cache. The on-disk cache allows to store all contracts pre-compiled and removes the hot/cold cache compilation issue. This is due to being able to compile contracts when the code is first deployed.
Changes
FunctionCallAction
toDeployContractAction
. Since the size of the contract is known for theDeployContractAction
, the full cost can be deducted at the moment this action is created and doesn't need to come from the attached gas at the runtime. This decreases the cost of a function call and makes it predictable. At the same time it makes the deployment action more expensive, but it has to be paid only once.Current Protocol Upgrade
deploy_contract_cost
anddeploy_contract_cost_per_byte
fees by the estimated compilation cost.RuntimeConfig
that is based on the protocol version.Default
implementation to usePROTOCOL_VERSION
and the new method.protocol_version
toRuntime
internal state.config
withinRuntime
when theapply_state.current_protocol_version
is different from theself.protocol_version
.config
record private and exposeget_config()
method that takes protocol version. This will resolvevalidate_tx
protocol issues.NOTE: Main concern here is
RuntimeConfig::free()
options that might come in genesis that are different from the default values for a current protocol versionThe text was updated successfully, but these errors were encountered: