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 ofu16,u32,u64, orbool.
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
trueif the feature is enabled in the current protocol versionfalseif 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;