feat(chainspec): add FeatureRegistry precompile with admin killswitch#2891
Open
decofe wants to merge 1 commit intozygis/feature-flagsfrom
Open
feat(chainspec): add FeatureRegistry precompile with admin killswitch#2891decofe wants to merge 1 commit intozygis/feature-flagsfrom
decofe wants to merge 1 commit intozygis/feature-flagsfrom
Conversation
Adds a FeatureRegistry precompile at 0xFEA7...0000 that stores a bitmap of active features and supports: - Immediate activate/deactivate by the admin (owner) - Timestamp-scheduled activations with admin killswitch - deactivate() clears both the bitmap bit AND any pending schedule - cancelScheduledActivation() for surgical schedule removal - transferOwnership() for admin rotation Also adds TempoFeatures::from_state() to read the feature bitmap directly from on-chain storage via SLOAD, enabling per-block feature resolution without full EVM execution. Co-authored-by: Arsenii Kulikov <klkvr@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019c9bc1-ca89-701e-9632-452eefceccdc Co-authored-by: Amp <amp@ampcode.com>
📊 Tempo Precompiles CoverageprecompilesCoverage: 21335/22406 lines (95.22%) File details
contractsCoverage: 232/406 lines (57.14%) File details
Total: 21567/22812 lines (94.54%) |
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.
Adds a
FeatureRegistryprecompile (0xFEA7...0000) on top of the feature flags branch. Stores a bitmap of active features with admin-controlled activation, deactivation, and timestamp-scheduled activation with killswitch support.Key design decisions:
deactivate(featureId)clears both the bitmap bit AND any pending schedule — acts as a universal killswitchcancelScheduledActivation(featureId)for surgical schedule removal without touching the bitmapactivate(featureId)also clears any pending schedule (feature is now active, schedule is moot)is_active(featureId)checks both the bitmap and scheduled activation timestampsowner+transferOwnership)TempoFeatures::from_state(sload)reads the feature bitmap directly from on-chain storage via SLOAD for per-block feature resolutionPrompted by: arsenii