This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Description
Problem
When loading from a snapshot, a validator adds and removes builtins and precompiles according to which runtime features are activated. When the prevent_calling_precompiles_as_programs feature is activated, ed25519 builtin program should be removed in favor of a precompile. However, when loading from a snapshot, all activated builtins are added before processing removals. Whenever a validator encounters a builtin that should be added during snapshot but doesn't already exist on-chain, it will hard exit.
Proposed Solution
Collapse builtins when activated and deactivated for the same bank
- For v1.8 compatibility, we need to be able to keep adding a builtin until a feature is activated.
- For v1.9 compatibility, we need to avoid adding a builtin if a feature is already activated.