Skip to main content

Module iota_system::protocol_config

This module mirrors iota::protocol_config for use within the iota-system package. The native implementations are identical; they are registered under the iota-system address so that public(package) visibility keeps them inaccessible to user packages.

Module Functions

pub(pkg) get_attr

Returns the value of a protocol config parameter.

Aborts if the parameter is absent in the current protocol version, if T does not match the parameter's actual type, or if param_name is not valid UTF-8.

Type parameter

  • T - Must be one of u16, u32, u64, or bool.

public(package) fun get_attr<T: copy, drop, store>(param_name: vector<u8>): T

Implementation

public(package) native fun get_attr<T: copy + drop + store>(param_name: vector<u8>): T;

pub(pkg) is_feature_enabled

Checks if a specific protocol feature flag is enabled.

Arguments

  • feature_flag_name - The name of the feature flag as bytes (e.g., b"enable_vdf")

Returns

  • true if the feature is enabled in the current protocol version
  • false if the feature is disabled or unknown

public(package) fun is_feature_enabled(feature_flag_name: vector<u8>): bool

Implementation

public(package) native fun is_feature_enabled(feature_flag_name: vector<u8>): bool;