feat(sdk-node): expose feature-gate config in Node SDK#653
Open
amilz wants to merge 2 commits into
Open
Conversation
Adds enableFeatures, disableFeatures, and allFeatures to the napi
SurfnetConfig, parsed via the existing parse_feature_pubkey() helper
(accepts kebab-case names, snake_case, or base58 pubkeys). Threads
through SurfnetBuilder::{enable_feature, disable_feature, feature_config}
into SVM init.
Builder default now seeds SvmFeatureConfig::default_mainnet_features()
so single-feature overrides layer on a mainnet baseline instead of
flipping every gate on (matches CLI semantics).
Bumps @solana/surfpool to 1.3.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes DEV-526.
enableFeatures,disableFeatures, andallFeaturesto the napiSurfnetConfig, parsed via the existingparse_feature_pubkey()helper (kebab-case name, snake_case name, or base58 pubkey).SurfnetBuilder::{enable_feature, disable_feature, feature_config}methods into SVM init.SvmFeatureConfig::default_mainnet_features()so single-feature overrides layer on a mainnet baseline instead of flipping every gate on (matches CLI semantics — previously,.enable_feature(X)would activate every known gate, not justX).@solana/surfpoolto 1.3.0.Usage
Unknown feature names reject at startup with an
InvalidArgerror listing the available gates.Test plan
cargo test -p surfpool-types --lib features— 22/22 passcargo test -p surfpool-sdk --lib— 19/19 passcd crates/sdk-node && npm run build && npm test— 6/6 pass (incl. new feature-gate case + invalid-name rejection)surfpool-sdkdep in@solana/kit-plugin-surfpoolfrom^1.2.0→^1.3.0once published, and add a kit-tools V1-transaction test that fails withoutenableFeaturesand passes with it.