Skip to content

SBF-safe setup#12

Open
IliaZyrin wants to merge 4 commits into
switchboard-xyz:mainfrom
IliaZyrin:dependencies-cleanup
Open

SBF-safe setup#12
IliaZyrin wants to merge 4 commits into
switchboard-xyz:mainfrom
IliaZyrin:dependencies-cleanup

Conversation

@IliaZyrin

@IliaZyrin IliaZyrin commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Make libsecp256k1 SBF-safe by disabling default features

This changes the libsecp256k1 dependency to disable its default feature set and enable only static-context.

The previous configuration enabled std/hmac transitively, which pulled in rand -> rand_core -> getrandom. That causes SBF builds using switchboard-on-demand with default-features = false and features = ["cpi", "solana-v3"] to fail with:

getrandom: target is not supported

Using:

libsecp256k1 = { version = "0.7.2", default-features = false, features = ["static-context"] }

keeps the precomputed secp256k1 context available while avoiding the unsupported host randomness path. This makes the crate usable in Solana/SBF CPI builds without pulling getrandom through libsecp256k1.

# Conflicts:
#	solana/rust/switchboard-on-demand-client/Cargo.toml
#	solana/rust/switchboard-on-demand-client/src/lut_owner.rs
#	solana/rust/switchboard-on-demand-client/src/pull_feed.rs
#	solana/rust/switchboard-on-demand/Cargo.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant