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§
Source§impl ProtocolFeature
impl ProtocolFeature
pub const fn protocol_version(self) -> u32
Trait Implementations§
Source§impl Clone for ProtocolFeature
impl Clone for ProtocolFeature
Source§fn clone(&self) -> ProtocolFeature
fn clone(&self) -> ProtocolFeature
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ProtocolFeature
impl Debug for ProtocolFeature
Source§impl Hash for ProtocolFeature
impl Hash for ProtocolFeature
Source§impl PartialEq for ProtocolFeature
impl PartialEq for ProtocolFeature
impl Copy for ProtocolFeature
impl Eq for ProtocolFeature
impl StructuralPartialEq for ProtocolFeature
Auto Trait Implementations§
impl Freeze for ProtocolFeature
impl RefUnwindSafe for ProtocolFeature
impl Send for ProtocolFeature
impl Sync for ProtocolFeature
impl Unpin for ProtocolFeature
impl UnwindSafe for ProtocolFeature
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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