pub struct ConsensusParameters {
Show 14 fields pub contract_max_size: u64, pub max_inputs: u64, pub max_outputs: u64, pub max_witnesses: u64, pub max_gas_per_tx: u64, pub max_script_length: u64, pub max_script_data_length: u64, pub max_storage_slots: u64, pub max_predicate_length: u64, pub max_predicate_data_length: u64, pub gas_price_factor: u64, pub gas_per_byte: u64, pub max_message_data_length: u64, pub chain_id: u64,
}
Expand description

Consensus configurable parameters used for verifying transactions

Fields§

§contract_max_size: u64

Maximum contract size, in bytes.

§max_inputs: u64

Maximum number of inputs.

§max_outputs: u64

Maximum number of outputs.

§max_witnesses: u64

Maximum number of witnesses.

§max_gas_per_tx: u64

Maximum gas per transaction.

§max_script_length: u64

Maximum length of script, in instructions.

§max_script_data_length: u64

Maximum length of script data, in bytes.

§max_storage_slots: u64

Maximum number of initial storage slots.

§max_predicate_length: u64

Maximum length of predicate, in instructions.

§max_predicate_data_length: u64

Maximum length of predicate data, in bytes.

§gas_price_factor: u64

Factor to convert between gas and transaction assets value.

§gas_per_byte: u64

A fixed ratio linking metered bytes to gas price

§max_message_data_length: u64

Maximum length of message data, in bytes.

§chain_id: u64

The unique identifier of this chain

Implementations§

source§

impl ConsensusParameters

source

pub const DEFAULT: Self = _

Default consensus parameters with settings suggested in fuel-specs

source

pub const fn tx_offset(&self) -> usize

Transaction memory offset in VM runtime

source

pub const fn with_contract_max_size(self, contract_max_size: u64) -> Self

Replace the max contract size with the given argument

source

pub const fn with_max_inputs(self, max_inputs: u64) -> Self

Replace the max inputs with the given argument

source

pub const fn with_max_outputs(self, max_outputs: u64) -> Self

Replace the max outputs with the given argument

source

pub const fn with_max_witnesses(self, max_witnesses: u64) -> Self

Replace the max witnesses with the given argument

source

pub const fn with_max_gas_per_tx(self, max_gas_per_tx: u64) -> Self

Replace the max gas per transaction with the given argument

source

pub const fn with_max_script_length(self, max_script_length: u64) -> Self

Replace the max script length with the given argument

source

pub const fn with_max_script_data_length( self, max_script_data_length: u64 ) -> Self

Replace the max script data length with the given argument

source

pub const fn with_max_storage_slots(self, max_storage_slots: u64) -> Self

Replace the max storage slots with the given argument

source

pub const fn with_max_predicate_length(self, max_predicate_length: u64) -> Self

Replace the max predicate length with the given argument

source

pub const fn with_max_predicate_data_length( self, max_predicate_data_length: u64 ) -> Self

Replace the max predicate data length with the given argument

source

pub const fn with_gas_price_factor(self, gas_price_factor: u64) -> Self

Replace the gas price factor with the given argument

source

pub const fn with_gas_per_byte(self, gas_per_byte: u64) -> Self

source

pub const fn with_max_message_data_length( self, max_message_data_length: u64 ) -> Self

Replace the max message data length with the given argument

Trait Implementations§

source§

impl Clone for ConsensusParameters

source§

fn clone(&self) -> ConsensusParameters

Returns a copy 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 Debug for ConsensusParameters

source§

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

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

impl Default for ConsensusParameters

source§

fn default() -> Self

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

impl Hash for ConsensusParameters

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<ConsensusParameters> for ConsensusParameters

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for ConsensusParameters

source§

impl Eq for ConsensusParameters

source§

impl StructuralEq for ConsensusParameters

source§

impl StructuralPartialEq for ConsensusParameters

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

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

§

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

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> StorageAsMut for T

§

fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,

§

fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,

§

impl<T> StorageAsRef for T

§

fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,

§

fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,

source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V