Crate dock_runtime
source ·Expand description
Dock blockchain runtime. This can be compiled with #[no_std]
, ready for Wasm.
Re-exports
pub use dock_poa;
pub use dock_price_feed;
pub use dock_token_migration;
Modules
- Minimal proof of existence registry.
- This module allows DIDs to publically attests to arbirary (and arbitrarily large) RDF claimgraphs. These attestations are not stored on-chain; rather, the attester chooses a storage method by specifying an Iri.
- Generic immutable single-owner storage.
- Simulates a multisig root account.
- Module to store offchain signature keys and parameters for different signature schemes. Currently, can be either
BBS
,BBS+
,Pointcheval-Sanders
orBBDT16
. ForBBS
,BBS+
andPointcheval-Sanders
, the public key is in group G2 but forBBDT16
, it’s in group G1 and used to verify the proof of validity of MAC (and related proofs) but not the MAC itself. - 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.
- Storage for status list-related verifiable credentials:
- Dock Trust Registry.
Structs
- Public key for the BBS+ signature scheme.
- Denotes when the system should decrease/increase the base fee based on how much weight was used by the last block.
target
is the ideal congestion of the network where the base fee should remain unchanged. Under normal circumstances thetarget
should be 50%. If we go below thetarget
, the base fee is linearly decreased by the Elasticity delta of lower~
target. If we go above thetarget
, the base fee is linearly increased by the Elasticity delta of upper~
target. The base fee is fully increased (default 12.5%) if the block is upper full (default 100%). The base fee is fully decreased (default 12.5%) if the block is lower empty (default 0%). - The numbers configured here could always be more than the the maximum limits of staking pallet to ensure election snapshot will not run out of memory. For now, we set them to smaller values since the staking is bounded and the weight pipeline takes hours for this single pallet.
- Bonding duration is in number of era
- We are fixed supply token, we don’t burn any tokens
- Require 3 days in blocks for each candidate to be allowed for the election.
- Deals with transaction fees
- Keeping 22 as its the ss58 prefix of mainnet
- Fixed gas price. Gas price is always 50 mirco-token (0.00005 token) per gas.
- A validator will only have 256 nominators, so max (rewarded) nominators is 256*50 = 12800. This number is smaller than current token holders (20K) but not all holder participate. Keeping it small to batch payout extrinsics
- We allow for 1 seconds of compute with a 3 second average block time.
- 1000 tokens
- A limit for off-chain phragmen unsigned solution length.
- A limit for off-chain phragmen unsigned solution weight.
- The runtime origin type representing the origin of a call.
- Public key for the PS signature scheme.
- Provides an implementation of
PalletInfo
to provide information about the pallet setup in the runtime. - 0.02 token
- Specifies the number of blocks for which the equivocation is valid.
- Implements all runtime apis for the client side.
- Proposal with lifetime less than 2 hours (in blocks) requires to be approved by all members.
- We prioritize im-online heartbeats over election solution submission.
- .0001 token
- Matches treasury account created during PoA.
- Vesting duration in number of blocks. Duration is 183 days and block time is 3 sec. (183 * 24 * 3600) / 3 = 5270400
- Number of vesting milestones
Enums
- Contains one variant per dispatchable that can be called by an extrinsic.
- Contains one variant per dispatchable that can be called by an extrinsic.
- Public key for different signature schemes. Currently, can be either
BBS
,BBS+
,Pointcheval-Sanders
orBBDT16
. - Indicates the initial status of the staker.
- Contains one variant per dispatchable that can be called by an extrinsic.
Constants
- We assume that an on-initialize consumes 10% of the weight on average, hence a single extrinsic will not be allowed to consume more than
AvailableBlockRatio - 10%
. - The BABE epoch configuration at genesis.
- The token has 6 decimal places
- We allow for 1 second of compute with a 3 second average block time.
- Era duration should be less than or equal year
- This runtime version. Whe compiling with feature “mainnet”,
spec_name
will be “dock-main-runtime”, when compiling with feature “testnet”,spec_name
will be “dock-test-runtime”, when not using either of those,spec_name
will be “dock-dev-runtime”
Functions
- The version information used to identify this runtime when compiled natively.
Type Definitions
- Some way of identifying an account on the chain. We intentionally make it equivalent to the public key of our transaction signing scheme.
- The type for looking up accounts. We don’t expect more than 4 billion of them, but you never know…
- The address format for describing accounts.
- AllPalletsDeprecatedAll pallets included in the runtime as a nested tuple of types.
- AllPalletsReversedWithSystemFirstDeprecatedAll pallets included in the runtime as a nested tuple of types in reversed order. With the system pallet first.
- All pallets included in the runtime as a nested tuple of types.
- AllPalletsWithSystemReversedDeprecatedAll pallets included in the runtime as a nested tuple of types in reversed order.
- All pallets included in the runtime as a nested tuple of types. Excludes the System pallet.
- AllPalletsWithoutSystemReversedDeprecatedAll pallets included in the runtime as a nested tuple of types in reversed order. Excludes the System pallet.
- Balance of an account.
- Block type as expected by this runtime.
- BlockId type as expected by this runtime.
- An index to a block.
- Extrinsic type that has already been checked.
- A hash of some data used by the chain.
- Block header type as expected by this runtime.
- Index of a transaction in the chain.
- Type used for expressing timestamp.
- Alias to 512-bit hash when used in the context of a transaction signature on the chain.
- A Block signed with a Justification
- The SignedExtension to the basic transaction logic.
- The payload being signed in transactions.
- Unchecked extrinsic type as expected by this runtime.