Track account writable deescalation (bp #14626) (#14787)

* Track account writable deescalation (#14626)

(cherry picked from commit 77572a7c53)

# Conflicts:
#	sdk/src/feature_set.rs

* fix conflicts

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2021-01-23 03:33:21 +00:00
committed by GitHub
parent e6b53c262b
commit 480a35d678
13 changed files with 236 additions and 46 deletions

View File

@@ -146,6 +146,10 @@ pub mod prevent_upgrade_and_invoke {
solana_sdk::declare_id!("BiNjYd8jCYDgAwMqP91uwZs6skWpuHtKrZbckuKESs8N");
}
pub mod track_writable_deescalation {
solana_sdk::declare_id!("HVPSxqskEtRLRT2ZeEMmkmt9FWqoFX4vrN6f5VaadLED");
}
lazy_static! {
/// Map of feature identifiers to user-visible description
pub static ref FEATURE_NAMES: HashMap<Pubkey, &'static str> = [
@@ -177,13 +181,14 @@ lazy_static! {
(try_find_program_address_syscall_enabled::id(), "add try_find_program_address syscall"),
(warp_timestamp::id(), "warp timestamp to current, adjust bounding to 50% #14210 & #14531"),
(stake_program_v3::id(), "solana_stake_program v3"),
(max_cpi_instruction_size_ipv6_mtu::id(), "Max cross-program invocation size 1280"),
(limit_cpi_loader_invoke::id(), "Loader not authorized via CPI"),
(use_loaded_program_accounts::id(), "Use loaded program accounts"),
(abort_on_all_cpi_failures::id(), "Abort on all CPI failures"),
(use_loaded_executables::id(), "Use loaded executable accounts"),
(max_cpi_instruction_size_ipv6_mtu::id(), "max cross-program invocation size 1280"),
(limit_cpi_loader_invoke::id(), "loader not authorized via CPI"),
(use_loaded_program_accounts::id(), "use loaded program accounts"),
(abort_on_all_cpi_failures::id(), "abort on all CPI failures"),
(use_loaded_executables::id(), "use loaded executable accounts"),
(turbine_retransmit_peers_patch::id(), "turbine retransmit peers patch #14631"),
(prevent_upgrade_and_invoke::id(), "Prevent upgrade and invoke in same tx batch"),
(prevent_upgrade_and_invoke::id(), "prevent upgrade and invoke in same tx batch"),
(track_writable_deescalation::id(), "track account writable deescalation"),
/*************** ADD NEW FEATURES HERE ***************/
]
.iter()

View File

@@ -41,6 +41,7 @@ pub trait InvokeContext {
message: &Message,
instruction: &CompiledInstruction,
accounts: &[Rc<RefCell<Account>>],
caller_pivileges: Option<&[bool]>,
) -> Result<(), InstructionError>;
/// Get the program ID of the currently executing program
fn get_caller(&self) -> Result<&Pubkey, InstructionError>;
@@ -340,6 +341,7 @@ impl InvokeContext for MockInvokeContext {
_message: &Message,
_instruction: &CompiledInstruction,
_accounts: &[Rc<RefCell<Account>>],
_caller_pivileges: Option<&[bool]>,
) -> Result<(), InstructionError> {
Ok(())
}