Struct CoreConfig

Source
pub struct CoreConfig {
Show 39 fields pub era_duration: TimeDiff, pub minimum_era_height: u64, pub minimum_block_time: TimeDiff, pub validator_slots: u32, pub finality_threshold_fraction: Ratio<u64>, pub start_protocol_version_with_strict_finality_signatures_required: ProtocolVersion, pub legacy_required_finality: LegacyRequiredFinality, pub auction_delay: u64, pub locked_funds_period: TimeDiff, pub vesting_schedule_period: TimeDiff, pub unbonding_delay: u64, pub round_seigniorage_rate: Ratio<u64>, pub max_associated_keys: u32, pub max_runtime_call_stack_height: u32, pub minimum_delegation_amount: u64, pub maximum_delegation_amount: u64, pub minimum_bid_amount: u64, pub prune_batch_size: u64, pub strict_argument_checking: bool, pub simultaneous_peer_requests: u8, pub consensus_protocol: ConsensusProtocolName, pub max_delegators_per_validator: u32, pub finders_fee: Ratio<u64>, pub finality_signature_proportion: Ratio<u64>, pub validator_credit_cap: Ratio<u64>, pub signature_rewards_max_delay: u64, pub allow_auction_bids: bool, pub allow_unrestricted_transfers: bool, pub compute_rewards: bool, pub refund_handling: RefundHandling, pub fee_handling: FeeHandling, pub pricing_handling: PricingHandling, pub allow_prepaid: bool, pub gas_hold_balance_handling: HoldBalanceHandling, pub gas_hold_interval: TimeDiff, pub administrators: BTreeSet<PublicKey>, pub enable_addressable_entity: bool, pub baseline_motes_amount: u64, pub trap_on_ambiguous_entity_version: bool,
}
Available on crate feature std only.
Expand description

Configuration values associated with the core protocol.

Fields§

§era_duration: TimeDiff

Duration of an era.

§minimum_era_height: u64

Minimum era height.

§minimum_block_time: TimeDiff

Minimum block time.

§validator_slots: u32

Validator slots.

§finality_threshold_fraction: Ratio<u64>

Finality threshold fraction.

§start_protocol_version_with_strict_finality_signatures_required: ProtocolVersion

Protocol version from which nodes are required to hold strict finality signatures.

§legacy_required_finality: LegacyRequiredFinality

Which finality is required for legacy blocks. Used to determine finality sufficiency for new joiners syncing blocks created in a protocol version before start_protocol_version_with_strict_finality_signatures_required.

§auction_delay: u64

Number of eras before an auction actually defines the set of validators. If you bond with a sufficient bid in era N, you will be a validator in era N + auction_delay + 1

§locked_funds_period: TimeDiff

The period after genesis during which a genesis validator’s bid is locked.

§vesting_schedule_period: TimeDiff

The period in which genesis validator’s bid is released over time after it’s unlocked.

§unbonding_delay: u64

The delay in number of eras for paying out the unbonding amount.

§round_seigniorage_rate: Ratio<u64>

Round seigniorage rate represented as a fractional number.

§max_associated_keys: u32

Maximum number of associated keys for a single account.

§max_runtime_call_stack_height: u32

Maximum height of contract runtime call stack.

§minimum_delegation_amount: u64

The minimum bound of motes that can be delegated to a validator.

§maximum_delegation_amount: u64

The maximum bound of motes that can be delegated to a validator.

§minimum_bid_amount: u64

The minimum bound of motes that can be bid for a validator.

§prune_batch_size: u64

Global state prune batch size (0 means the feature is off in the current protocol version).

§strict_argument_checking: bool

Enables strict arguments checking when calling a contract.

§simultaneous_peer_requests: u8

How many peers to simultaneously ask when sync leaping.

§consensus_protocol: ConsensusProtocolName

Which consensus protocol to use.

§max_delegators_per_validator: u32

The maximum amount of delegators per validator. if the value is 0, there is no maximum capacity.

§finders_fee: Ratio<u64>

The split in finality signature rewards between block producer and participating signers.

§finality_signature_proportion: Ratio<u64>

The proportion of baseline rewards going to reward finality signatures specifically.

§validator_credit_cap: Ratio<u64>

The cap for validator credits based upon a proportion of a receiving validator’s total stake.

§signature_rewards_max_delay: u64

Lookback interval indicating which past block we are looking at to reward.

§allow_auction_bids: bool

Auction entrypoints such as “add_bid” or “delegate” are disabled if this flag is set to false. Setting up this option makes sense only for private chains where validator set rotation is unnecessary.

§allow_unrestricted_transfers: bool

Allows unrestricted transfers between users.

§compute_rewards: bool

If set to false then consensus doesn’t compute rewards and always uses 0.

§refund_handling: RefundHandling

Refund handling.

§fee_handling: FeeHandling

Fee handling.

§pricing_handling: PricingHandling

Pricing handling.

§allow_prepaid: bool

Allow prepaid.

§gas_hold_balance_handling: HoldBalanceHandling

How do gas holds affect available balance calculations?

§gas_hold_interval: TimeDiff

How long does it take for a gas hold to expire?

§administrators: BTreeSet<PublicKey>

Administrative accounts are a valid option for a private chain only.

§enable_addressable_entity: bool

Turn on migration to addressable entity behavior.

§baseline_motes_amount: u64

This value is used as the penalty payment amount, the minimum balance amount, and the minimum consumed amount.

§trap_on_ambiguous_entity_version: bool

The flag on whether the engine will return an error for multiple entity versions.

Implementations§

Source§

impl CoreConfig

Source

pub fn enable_addressable_entity(&self) -> bool

Turn on migration to addressable entity behavior.

Source

pub fn recent_era_count(&self) -> u64

The number of eras that have already started and whose validators are still bonded.

Source

pub fn production_rewards_proportion(&self) -> Ratio<u64>

The proportion of the total rewards going to block production.

Source

pub fn collection_rewards_proportion(&self) -> Ratio<u64>

The finder’s fee, i.e. the proportion of the total rewards going to the validator collecting the finality signatures which is the validator producing the block.

Source

pub fn contribution_rewards_proportion(&self) -> Ratio<u64>

The proportion of the total rewards going to finality signatures collection.

Source

pub fn baseline_motes_amount_u512(&self) -> U512

The baseline motes amount as a U512.

Source§

impl CoreConfig

Source

pub fn random(rng: &mut TestRng) -> Self

Available on crate feature testing only.

Generates a random instance using a TestRng.

Trait Implementations§

Source§

impl Clone for CoreConfig

Source§

fn clone(&self) -> CoreConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl DataSize for CoreConfig

Source§

const IS_DYNAMIC: bool = true

If true, the type has a heap size that can vary at runtime, depending on the actual value.
Source§

const STATIC_HEAP_SIZE: usize = 0usize

The amount of space a value of the type always occupies. If IS_DYNAMIC is false, this is the total amount of heap memory occupied by the value. Otherwise this is a lower bound.
Source§

fn estimate_heap_size(&self) -> usize

Estimates the size of heap memory taken up by this value. Read more
Source§

impl Debug for CoreConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CoreConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CoreConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl FromBytes for CoreConfig

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Deserializes the slice into Self.
Source§

fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>

Deserializes the Vec<u8> into Self.
Source§

impl PartialEq for CoreConfig

Source§

fn eq(&self, other: &CoreConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CoreConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToBytes for CoreConfig

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Error>

Serializes &self to a Vec<u8>.
Source§

fn serialized_length(&self) -> usize

Returns the length of the Vec<u8> which would be returned from a successful call to to_bytes() or into_bytes(). The data is not actually serialized, so this call is relatively cheap.
Source§

fn into_bytes(self) -> Result<Vec<u8>, Error>
where Self: Sized,

Consumes self and serializes to a Vec<u8>.
Source§

fn write_bytes(&self, writer: &mut Vec<u8>) -> Result<(), Error>

Writes &self into a mutable writer.
Source§

impl Eq for CoreConfig

Source§

impl StructuralPartialEq for CoreConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,