feat(replay): gate builtins and precompiles on the per-slot feature set - #9
Merged
Merged
Conversation
Two places assumed the epoch-808 feature state. register_builtins registered every solana_builtins::BUILTINS entry regardless of feature state. Three of the nine sit behind enable_feature_id, so a replay could make a program invokable that the cluster didn't have. The feature set was already there: build_feature_set reads it off the on-chain feature accounts and backfill already handed it to the Replayer. register_builtins just never asked. Not cosmetic at epoch 808. zk_token_proof and loader_v4 have never activated on mainnet and were both being registered. No state was written (all three program accounts already exist on chain, so add_builtin never stubbed) and nothing in the verified 50k range invokes them, so that run's byte-exact result stands. The precompile callbacks hardcoded |_| true and all_enabled(). secp256r1 sits behind enable_secp256r1_precompile, active from slot 345,600,000, so a range below that would resolve a precompile the cluster didn't have. ReplayBank now carries the feature set, defaulting to all-enabled so fixtures are unchanged, and backfill sets it after seeding. The SVM reaches these callbacks through the bank rather than the Replayer, which is why the Replayer already holding one wasn't enough.
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.
Two places assumed the epoch-808 feature state.
register_builtins registered every solana_builtins::BUILTINS entry regardless of feature state. Three of the nine sit behind enable_feature_id, so a replay could make a program invokable that the cluster didn't have. The feature set was already there: build_feature_set reads it off the on-chain feature accounts and backfill already handed it to the Replayer. register_builtins just never asked.
Not cosmetic at epoch 808. zk_token_proof and loader_v4 have never activated on mainnet and were both being registered. No state was written (all three program accounts already exist on chain, so add_builtin never stubbed) and nothing in the verified 50k range invokes them, so that run's byte-exact result stands.
The precompile callbacks hardcoded |_| true and all_enabled(). secp256r1 sits behind enable_secp256r1_precompile, active from slot 345,600,000, so a range below that would resolve a precompile the cluster didn't have. ReplayBank now carries the feature set, defaulting to all-enabled so fixtures are unchanged, and backfill sets it after seeding. The SVM reaches these callbacks through the bank rather than the Replayer, which is why the Replayer already holding one wasn't enough.