Expand description
Protocol parameters
Re-exports§
pub use storage::get_gas_scale;pub use storage::get_max_block_gas;
Modules§
Structs§
- Epoch
Duration - Epoch duration. A new epoch begins as soon as both the
min_num_of_blocksandmin_durationhave passed since the beginning of the current epoch. - Parameters
- Protocol parameters
- Proposal
Bytes - Configuration parameter for the upper limit on the number of bytes transactions can occupy in a block proposal.
- Store
- Parameters storage
Keys/Read/Writeimplementation
Enums§
Constants§
- ADDRESS
- The internal address for storage keys representing parameters than can be changed via governance.
Traits§
- Keys
- Abstract parameters storage keys interface
- Read
- Abstract parameters storage read interface
- Write
- Abstract parameters storage write interface
Functions§
- estimate_
max_ block_ time_ from_ blocks - Return an estimate of the maximum time taken to decide a block,
by sourcing block headers from up to
num_blocks_to_read. - estimate_
max_ block_ time_ from_ blocks_ and_ params - Return an estimate of the maximum time taken to decide a block,
by sourcing block headers from up to
num_blocks_to_read, and from chain parameters. - estimate_
max_ block_ time_ from_ parameters - Return an estimate of the maximum time taken to decide a block, based on chain parameters.
- init_
storage - Initialize parameters in storage in the genesis block.
- is_
tx_ allowed - Check if the given tx code
Hashis in the allowlist. When the allowlist is empty it always returns true. - is_
vp_ allowed - Check if the given VP code
Hashis in the allowlist. When the allowlist is empty it always returns true. - native_
erc20_ key - Storage key for the Ethereum address of wNam.
- read
- Read all the parameters from storage. Returns the parameters and gas cost.
- read_
epoch_ duration_ parameter - Read the epoch duration parameter from store
- read_
epochs_ per_ year - Read the number of epochs per year parameter
- read_
epochs_ per_ year_ parameter - Read the epochs per year parameter from store
- read_
gas_ cost - Read the cost per unit of gas for the provided token
- read_
masp_ epoch_ multiplier_ parameter - Read the masp epoch multiplier parameter from store
- read_
max_ proposal_ bytes - Retrieve the
max_proposal_bytesconsensus parameter from storage. - update_
epoch_ parameter - Update the epoch parameter in storage. Returns the parameters and gas cost.
- update_
epochs_ per_ year_ parameter - Update the epochs_per_year parameter in storage. Returns the parameters and gas cost.
- update_
implicit_ vp - Update the implicit VP parameter in storage. Return the gas cost.
- update_
tx_ allowlist_ parameter - Update the tx allowlist parameter in storage. Returns the parameters and gas cost.
- update_
vp_ allowlist_ parameter - Update the vp allowlist parameter in storage. Returns the parameters and gas cost.
- validate_
tx_ bytes - Validate the size of a tx.
Type Aliases§
- Result
- Result of a storage API call.