Enum ProtocolFeature

Source
pub enum ProtocolFeature {
Show 46 variants ImplicitAccountCreation, RectifyInflation, AccessKeyNonceRange, FixApplyChunks, LowerStorageCost, DeleteActionRestriction, AccountVersions, TransactionSizeLimit, FixStorageUsage, CapMaxGasPrice, CountRefundReceiptsInGasLimit, MathExtension, RestoreReceiptsAfterFixApplyChunks, Wasmer2, SimpleNightshade, LowerDataReceiptAndEcrecoverBaseCost, LowerRegularOpCost, LowerRegularOpCost2, LimitContractFunctionsNumber, BlockHeaderV3, AliasValidatorSelectionAlgorithm, SynchronizeBlockChunkProduction, CorrectStackLimit, AccessKeyNonceForImplicitAccounts, IncreaseDeploymentCost, FunctionCallWeight, LimitContractLocals, ChunkNodesCache, LowerStorageKeyLimit, AltBn128, ChunkOnlyProducers, MaxKickoutPledge, AccountIdInFunctionCallPermission, ZeroBalanceAccount, DelegateAction, Ed25519Verify, ComputeCosts, FlatStorageReads, PreparationV2, UncVmRuntime, BlockHeaderV4, SimpleNightshadeV2, RestrictTla, TestnetFewerBlockProducers, ChunkValidation, EthAccounts,
}
Expand description

New Protocol features should go here. Features are guarded by their corresponding feature flag. For example, if we have ProtocolFeature::EVM and a corresponding feature flag evm, it will look like

#[cfg(feature = “protocol_feature_evm”)] EVM code

Variants§

§

ImplicitAccountCreation

§

RectifyInflation

§

AccessKeyNonceRange

Add AccessKey nonce range by setting nonce to (block_height - 1) * 1e6, see

§

FixApplyChunks

Don’t process any receipts for shard when chunk is not present. Always use gas price computed in the previous block.

§

LowerStorageCost

§

DeleteActionRestriction

§

AccountVersions

Add versions to Account data structure

§

TransactionSizeLimit

§

FixStorageUsage

Fix a bug in storage_usage for account caused by #3824

§

CapMaxGasPrice

Cap maximum gas price to 2,000,000,000 attoUNC

§

CountRefundReceiptsInGasLimit

§

MathExtension

Add ripemd60 and ecrecover host function

§

RestoreReceiptsAfterFixApplyChunks

Restore receipts that were previously stuck because of

§

Wasmer2

This feature switch our WASM engine implementation from wasmer 0.* to wasmer 2.*, bringing better performance and reliability.

The implementations should be sufficiently similar for this to not be a protocol upgrade, but we conservatively do a protocol upgrade to be on the safe side.

Although wasmer2 is faster, we don’t change fees with this protocol version – we can safely do that in a separate step.

§

SimpleNightshade

§

LowerDataReceiptAndEcrecoverBaseCost

§

LowerRegularOpCost

Lowers the cost of wasm instruction due to switch to wasmer2.

§

LowerRegularOpCost2

Lowers the cost of wasm instruction due to switch to faster, compiler-intrinsics based gas counter.

§

LimitContractFunctionsNumber

Limit number of wasm functions in one contract. See

§

BlockHeaderV3

§

AliasValidatorSelectionAlgorithm

Changes how we select validators for epoch and how we select validators within epoch.

§

SynchronizeBlockChunkProduction

Make block producers produce chunks for the same block they would later produce to avoid network delays

§

CorrectStackLimit

Change the algorithm to count WASM stack usage to avoid undercounting in some cases.

§

AccessKeyNonceForImplicitAccounts

Add AccessKey nonce range for implicit accounts, as in AccessKeyNonceRange feature.

§

IncreaseDeploymentCost

Increase cost per deployed code byte to cover for the compilation steps that a deployment triggers. Only affects the action execution cost.

§

FunctionCallWeight

§

LimitContractLocals

This feature enforces a global limit on the function local declarations in a WebAssembly contract. See <…> for more information.

§

ChunkNodesCache

Ensure caching all nodes in the chunk for which touching trie node cost was charged. Charge for each such node only once per chunk at the first access time.

§

LowerStorageKeyLimit

Lower max_length_storage_key limit, which itself limits trie node sizes.

§

AltBn128

§

ChunkOnlyProducers

§

MaxKickoutPledge

Ensure the total pledge of validators that are kicked out does not exceed a percentage of total pledges

§

AccountIdInFunctionCallPermission

Validate account id for function call access keys.

§

ZeroBalanceAccount

§

DelegateAction

Execute a set of actions on behalf of another account.

Meta Transaction

§

Ed25519Verify

§

ComputeCosts

Decouple compute and gas costs of operations to safely limit the compute time it takes to process the chunk.

§

FlatStorageReads

Enable flat storage for reads, reducing number of DB accesses from 2 * key.len() in the worst case to 2.

Flat Storage

§

PreparationV2

Enables preparation V2. Note that this setting is not supported in production settings without UncVmRuntime enabled alongside it, as the VM runner would be too slow.

§

UncVmRuntime

Enables unc-Vm. Note that this setting is not at all supported without PreparationV2, as it hardcodes preparation v2 code into the generated assembly.

§

BlockHeaderV4

§

SimpleNightshadeV2

Resharding V2. A new implementation for resharding and a new shard layout for the production networks.

§

RestrictTla

§

TestnetFewerBlockProducers

Increases the number of chunk producers.

§

ChunkValidation

Enables chunk validation which is introduced with stateless validation.

§

EthAccounts

Implementations§

Trait Implementations§

Source§

impl Clone for ProtocolFeature

Source§

fn clone(&self) -> ProtocolFeature

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 ProtocolFeature

Source§

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

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

impl Hash for ProtocolFeature

Source§

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

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 for ProtocolFeature

Source§

fn eq(&self, other: &ProtocolFeature) -> 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 Copy for ProtocolFeature

Source§

impl Eq for ProtocolFeature

Source§

impl StructuralPartialEq for ProtocolFeature

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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

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<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
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<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

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> 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
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> ErasedDestructor for T
where T: 'static,