Skip to content

feat: add native function to check protocol feature flags in Move#11443

Merged
valeriyr merged 5 commits intodevelopfrom
vm-lang/protocol-feature-flags-in-move
May 8, 2026
Merged

feat: add native function to check protocol feature flags in Move#11443
valeriyr merged 5 commits intodevelopfrom
vm-lang/protocol-feature-flags-in-move

Conversation

@valeriyr
Copy link
Copy Markdown
Contributor

@valeriyr valeriyr commented May 6, 2026

Description of change

Add iota::protocol_config::is_feature_enabled() to allow Move code to query protocol feature flags at runtime.
This enables conditional logic and fallbacks based on protocol version capabilities.

Links to any relevant issues

fixes #11465

@valeriyr valeriyr self-assigned this May 6, 2026
@iota-ci iota-ci added sc-platform Issues related to the Smart Contract Platform group. vm-language Issues related to the VM & Language Team labels May 6, 2026
valeriyr added 2 commits May 7, 2026 16:13
fix(iota-json-rpc-tests): fix get_normalized_move_modules_by_package
@valeriyr valeriyr force-pushed the vm-lang/protocol-feature-flags-in-move branch from 7c52d4f to 630c871 Compare May 7, 2026 13:24
@valeriyr valeriyr marked this pull request as ready for review May 7, 2026 14:32
@valeriyr valeriyr requested review from a team as code owners May 7, 2026 14:32
Copy link
Copy Markdown
Contributor

@muXxer muXxer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node owned files LGTM!

Copy link
Copy Markdown
Contributor

@theiari theiari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

let is_enabled = match String::from_utf8(bytes.to_vec()) {
Ok(s) => {
// Use the auto-generated lookup_feature method to find the feature flag
match protocol_config.lookup_feature(s) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pointing out that lookup_feature only looks for boolean feature flags and filters out other flags, is this intended?

Copy link
Copy Markdown
Contributor Author

@valeriyr valeriyr May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is added to check feature flags only. feature_flags contains only boolean values.

@valeriyr valeriyr merged commit 317ad1d into develop May 8, 2026
34 checks passed
@valeriyr valeriyr deleted the vm-lang/protocol-feature-flags-in-move branch May 8, 2026 09:02
valeriyr added a commit that referenced this pull request May 8, 2026
…1443)

Add iota::protocol_config::is_feature_enabled() to allow Move code to
query protocol feature flags at runtime.
This enables conditional logic and fallbacks based on protocol version
capabilities.

fixes #11465
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sc-platform Issues related to the Smart Contract Platform group. vm-language Issues related to the VM & Language Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[move][framework] Port native function to check protocol feature flags in Move

7 participants