The constraints on compute power a program can consume is limited only to its instruction count (#11717)

This commit is contained in:
Jack May
2020-08-21 15:31:19 -07:00
committed by GitHub
parent 418b483af6
commit 8d362f682b
17 changed files with 350 additions and 137 deletions

View File

@@ -8,7 +8,10 @@ extern crate solana_exchange_program;
extern crate solana_vest_program;
use log::*;
use solana_runtime::bank::{Bank, EnteredEpochCallback};
use solana_runtime::{
bank::{Bank, EnteredEpochCallback},
message_processor::{DEFAULT_COMPUTE_BUDGET, DEFAULT_MAX_INVOKE_DEPTH},
};
use solana_sdk::{
clock::Epoch, entrypoint_native::ProcessInstructionWithContext, genesis_config::OperatingMode,
inflation::Inflation, pubkey::Pubkey,
@@ -145,6 +148,9 @@ pub fn get_entered_epoch_callback(operating_mode: OperatingMode) -> EnteredEpoch
} else {
bank.set_cross_program_support(true);
}
bank.set_max_invoke_depth(DEFAULT_MAX_INVOKE_DEPTH);
bank.set_compute_budget(DEFAULT_COMPUTE_BUDGET);
})
}