Expand description
The Moonbeam Runtime.
Primary features of this runtime include:
- Ethereum compatibility
- Moonbeam tokenomics
Modules§
- api
- asset_
config - Asset configuration for Moonbase.
- bridge_
config - currency
- GLMR, the native token, uses 18 decimals of precision.
- genesis_
config_ preset - governance
- Governance configurations
- moonbeam_
xcm_ weights - opaque
- Opaque types. These are used by the CLI to instantiate machinery that don’t need to know the specifics of the runtime. They can then be made to be agnostic over specific formats of data like extrinsics, allowing for them to continue syncing the network through upgrades to even the core datastructures.
- runtime_
params - Dynamic runtime parameters for moonbeam.
- xcm_
config - XCM configuration for Moonbase.
Macros§
Structs§
- Adjustment
Variable - The adjustment variable of the runtime. Higher values will cause
TargetBlockFullnessto change the fees more rapidly. This low value causes changes to occur slowly over time. - Babe
Data Getter - Block
GasLimit - Block
Length - We allow for 5 MB blocks.
- Bridge
Reject Obsolete Headers AndMessages - Deposit
Base - Deposit
Factor - Ethereum
XcmEnsure Proxy - Existential
Deposit - Find
Author Adapter - The author inherent provides a AccountId20, but pallet evm needs an H160. This simple adapter makes the conversion.
- GasLimit
PovSize Ratio - The amount of gas per pov. A ratio of 8 if we convert ref_time to gas and we compare
it with the pov_size for a block. E.g.
ceil(
(max_extrinsic.ref_time() / max_extrinsic.proof_size()) / WEIGHT_PER_GAS
)
We should re-check
xcm_config::Erc20XcmBridgeTransferGasLimitwhen changing this value - GasLimit
Storage Growth Ratio - The amount of gas per storage (in bytes): BLOCK_GAS_LIMIT / BLOCK_STORAGE_LIMIT The current definition of BLOCK_STORAGE_LIMIT is 160 KB, resulting in a value of 366.
- Genesis
Account - Account definition used for genesis block construction.
- Inflation
Info - Initialization
Payment - Length
ToFee - Linear
Inflation Threshold - Maintenance
Filter - Maintenance mode Call filter
- MaxAdditional
Fields - MaxRegistrars
- MaxService
Weight - MaxSignatories
- MaxSpend
Balance - MaxSub
Accounts - MaxSuffix
Length - MaxUsername
Length - Maximum
Multiplier - Maximum multiplier. We pick a value that is expensive but not impossibly so; it should act as a safety net.
- Minimum
Multiplier - Minimum amount of the multiplier. This value cannot be too low. A test case should ensure
that combined with
AdjustmentVariable, we can recover from the minimum. Seemultiplier_can_grow_from_zeroin integration_tests.rs. This value is currently only used by pallet-transaction-payment as an assertion that the next multiplier is always > min value. - Normal
Filter - Normal Call Filter
- OnChargeEVM
Transaction - OnInactive
Collator - OnNew
Round - Orbiter
Reserve Identifier - Pallet
Info - Provides an implementation of
PalletInfoto provide information about the pallet setup in the runtime. - Payout
Collator OrOrbiter Reward - Pending
Username Expiration - Post
Block AndTxn Hashes - Precompiles
Value - Preimage
Base Deposit - Preimage
Byte Deposit - Preimage
Hold Reason - Proposal
Bond - Range
- Relay
Chain Slot Provider - Relay
Origin - Relay
Signatures Threshold - Reserved
DmpWeight - Reserved
Xcmp Weight - Runtime
- Runtime
Api - Runtime
ApiImpl - Implements all runtime apis for the client side.
- Runtime
Block Weights - Runtime
Genesis Config - Runtime
Origin - The runtime origin type representing the origin of a call.
- Signature
Network Identifier - Target
Block Fullness - The portion of the
NORMAL_DISPATCH_RATIOthat we adjust the fees with. Blocks filled less than this will decrease the weight and more will increase. - Transaction
Converter - Transaction
Payment AsGas Price - Treasury
Account - Treasury
Id - Version
- Weight
PerGas - XcmExecution
Manager
Enums§
- Origin
Caller - Precompile
Name - Proxy
Type - The type used to represent the kinds of proxying allowed.
- Runtime
Call - The aggregated runtime call type.
- Runtime
Error - Runtime
Event - Runtime
Freeze Reason - A reason for placing a freeze on funds.
- Runtime
Hold Reason - A reason for placing a hold on funds.
- Runtime
Lock Id - An identifier for each lock placed on funds.
- Runtime
Slash Reason - A reason for slashing funds.
- Runtime
Task - An aggregation of all
Taskenums across all pallets included in the current runtime. - Runtime
View Function - Runtime query type.
Constants§
- BLOCK_
STORAGE_ LIMIT - The highest amount of new storage that can be created in a block (160KB). Originally 40KB, then multiplied by 4 when the block deadline was increased from 500ms to 2000ms. Reference: https://github.com/moonbeam-foundation/moonbeam/blob/master/MBIPS/MBIP-5.md#specification
- DAYS
- EXTRINSIC_
BASE_ WEIGHT - FOREIGN_
ASSET_ PRECOMPILE_ ADDRESS_ PREFIX - The asset precompile address prefix. Addresses that match against this prefix will be routed to Erc20AssetsPrecompileSet being marked as foreign
- GAS_
PER_ SECOND - Current approximation of the gas/s consumption considering EVM execution over compiled WASM (on 4.4Ghz CPU). Given the 2000ms Weight, from which 75% only are used for transactions, the total EVM execution gas limit is: GAS_PER_SECOND * 2 * 0.75 ~= 60_000_000.
- HOURS
- MAXIMUM_
BLOCK_ WEIGHT - Maximum weight per block
- MAX_
POV_ SIZE - Maximum PoV size we support right now.
- MILLISECS_
PER_ BLOCK - MINUTES
- MONTHS
- NORMAL_
WEIGHT - RUNTIME_
API_ VERSIONS - VERSION
- This runtime version. The spec_version is composed of 2x2 digits. The first 2 digits represent major changes that can’t be skipped, such as data migration upgrades. The last 2 digits represent minor changes which can be skipped.
- WASM_
BINARY - WASM_
BINARY_ BLOATY - WASM_
BINARY_ PATH - WEEKS
- WEIGHT_
PER_ GAS - Approximate ratio of the amount of Weight per Gas. u64 works for approximations because Weight is a very small unit compared to gas.
Traits§
- Build
Storage - Complex storage builder stuff.
- Get
- A trait for querying a single value from a type.
- Weight
Info - Weight functions needed for
pallet_parachain_staking.
Functions§
- native_
version - The version information used to identify this runtime when compiled natively.
Type Aliases§
- Account
Id - Some way of identifying an account on the chain. We intentionally make it equivalent to the public key of our transaction signing scheme.
- Account
Index - The type for looking up accounts. We don’t expect more than 4 billion of them, but you never know…
- Address
- The address format for describing accounts.
- AllPallets
With System - All pallets included in the runtime as a nested tuple of types.
- AllPallets
Without System - All pallets included in the runtime as a nested tuple of types. Excludes the System pallet.
- AssetId
- AssetId type
- Async
Backing - Author
Filter - Author
Filter Config - Author
Inherent - Author
Mapping - Author
Mapping Config - Balance
- Balance of an account.
- Balances
- Balances
Config - Block
- Block type as expected by this runtime.
- BlockId
- BlockId type as expected by this runtime.
- Block
Number - An index to a block.
- Bridge
Kusama Grandpa - Bridge
Kusama Grandpa Config - Bridge
Kusama Messages - Bridge
Kusama Messages Config - Bridge
Kusama Parachains - Bridge
Kusama Parachains Config - Bridge
XcmOver Moonriver - Bridge
XcmOver Moonriver Config - Checked
Extrinsic - Extrinsic type that has already been checked.
- Conviction
Voting - Crowdloan
Rewards - Cumulus
Xcm - Digest
Item - Digest item type.
- EVM
- EVMConfig
- Eligibility
Value - The type of eligibility to use
- Emergency
Para Xcm - Erc20
XcmBridge - Ethereum
- Ethereum
Chain Id - Ethereum
Chain IdConfig - Ethereum
Config - Ethereum
Xcm - EvmForeign
Assets - EvmForeign
Assets Config - Executive
- Executive: handles dispatch to the various pallets.
- Foreign
Asset Migrator Origin - Hash
- A hash of some data used by the chain.
- Header
- Block header type as expected by this runtime.
- Identity
- Index
- Index of a transaction in the chain.
- Maintenance
Mode - Maintenance
Mode Config - Message
Queue - Moonbeam
Lazy Migrations - Moonbeam
Orbiters - Moonbeam
Precompiles - The PrecompileSet installed in the Moonbeam runtime. We include the nine Istanbul precompiles (https://github.com/ethereum/go-ethereum/blob/3c46f557/core/vm/contracts.go#L69) as well as a special precompile for dispatching Substrate extrinsics The following distribution has been decided for the precompiles 0-1023: Ethereum Mainnet Precompiles 1024-2047 Precompiles that are not in Ethereum Mainnet but are neither Moonbeam specific 2048-4095 Moonbeam specific precompiles
- Multi
Block Migrations - Multisig
- Open
Tech Committee Collective - Open
Tech Committee Collective Config - Origins
- Parachain
Info - Parachain
Info Config - Parachain
Staking - Parachain
Staking Config - Parachain
System - Parameters
- Polkadot
Xcm - Polkadot
XcmConfig - Precompiles
- Preimage
- Proxy
- Proxy
Genesis Companion - Proxy
Genesis Companion Config - Randomness
- Referenda
- Relay
Storage Roots - Root
Testing - Scheduler
- Signature
- Alias to 512-bit hash when used in the context of a transaction signature on the chain.
- Signed
Block - A Block signed with a Justification
- Slow
Adjusting FeeUpdate - Parameterized slow adjusting fee updated based on https://research.web3.foundation/Polkadot/overview/token-economics#2-slow-adjusting-mechanism // editorconfig-checker-disable-line
- System
- System
Config - Timestamp
- Transaction
Payment - Transaction
Payment Config - Treasury
- Treasury
Config - Treasury
Council Collective - Treasury
Council Collective Config - TxExtension
- The TransactionExtension to the basic transaction logic.
- Unchecked
Extrinsic - Unchecked extrinsic type as expected by this runtime.
- Utility
- Weight
Reclaim - Whitelist
- XcmTransactor
- XcmWeight
Trader - XcmWeight
Trader Config - Xcmp
Queue