Skip to content

Commit

Permalink
core-bpf: enable sol-get-sysvar syscall (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec authored Dec 9, 2024
1 parent f2bdbca commit efcebf7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,22 @@ fn load_builtins(cache: &mut ProgramCacheForTxBatch) -> HashSet<Pubkey> {
}

fn execute_instr(mut input: InstrContext) -> Option<InstrEffects> {
#[cfg(feature = "core-bpf-conformance")]
// The BPF version of some builtin programs are built with the assumption
// that certain features will be active at the time of their deployment.
// Some of these features are already active on all clusters.
//
// As a result, they must be activated when testing for conformance.
{
if &input.instruction.program_id == &solana_sdk::address_lookup_table::program::id() {
// The BPF version of Address Lookup Table depends on `SolGetSysvar`
// to read slot hash data.
input
.feature_set
.activate(&get_sysvar_syscall_enabled::id(), 0);
}
}

#[cfg(feature = "core-bpf-conformance")]
// If the fixture declares `cu_avail` to be less than the builtin version's
// `DEFAULT_COMPUTE_UNITS`, the program should fail on compute meter
Expand Down

0 comments on commit efcebf7

Please sign in to comment.