Prevent the invoke and upgrade of programs in the same tx batch (bp #14653) (#14679)

* Prevent the invoke and upgrade of programs in the same tx batch (#14653)

* Prevent the invoke and upgrade of programs in the same tx batch

* Pass program address as writable in the upgrade instruction

(cherry picked from commit e3bd9e5300)

# Conflicts:
#	programs/bpf/Cargo.lock
#	programs/bpf/Cargo.toml
#	programs/bpf/tests/programs.rs

* fix conflicts

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2021-01-19 18:28:23 -08:00
committed by GitHub
parent 702a353d71
commit 540e23c987
9 changed files with 1527 additions and 168 deletions

View File

@@ -138,6 +138,10 @@ pub mod turbine_retransmit_peers_patch {
solana_sdk::declare_id!("5Lu3JnWSFwRYpXzwDMkanWSk6XqSuF2i5fpnVhzB5CTc");
}
pub mod prevent_upgrade_and_invoke {
solana_sdk::declare_id!("BiNjYd8jCYDgAwMqP91uwZs6skWpuHtKrZbckuKESs8N");
}
lazy_static! {
/// Map of feature identifiers to user-visible description
pub static ref FEATURE_NAMES: HashMap<Pubkey, &'static str> = [
@@ -174,6 +178,7 @@ lazy_static! {
(abort_on_all_cpi_failures::id(), "Abort on all CPI failures"),
(warp_timestamp::id(), "warp timestamp to current, adjust bounding to 50% #14532"),
(turbine_retransmit_peers_patch::id(), "turbine retransmit peers patch #14631"),
(prevent_upgrade_and_invoke::id(), "Prevent upgrade and invoke in same tx batch"),
/*************** ADD NEW FEATURES HERE ***************/
]
.iter()