Make BPF Loader static (bp #11516) (#11790)

* Make BPF Loader static (#11516)

(cherry picked from commit 7c736f71fe)

# Conflicts:
#	Cargo.lock
#	core/Cargo.toml
#	core/src/lib.rs
#	core/src/validator.rs
#	genesis-programs/src/lib.rs
#	programs/bpf_loader/src/deprecated.rs
#	programs/bpf_loader/src/lib.rs
#	sdk/src/entrypoint_native.rs
#	sdk/src/lib.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2020-08-22 01:54:50 +00:00
committed by GitHub
parent a227b813d8
commit 6540d3c63e
20 changed files with 764 additions and 573 deletions

View File

@@ -0,0 +1,6 @@
solana_sdk::declare_builtin!(
solana_sdk::bpf_loader_deprecated::ID,
solana_bpf_loader_deprecated_program,
solana_bpf_loader_program::process_instruction,
deprecated::id
);

View File

@@ -25,10 +25,10 @@ use solana_sdk::{
use std::{io::prelude::*, mem};
use thiserror::Error;
solana_sdk::declare_loader!(
solana_sdk::declare_builtin!(
solana_sdk::bpf_loader::ID,
solana_bpf_loader_program,
process_instruction
solana_bpf_loader_program::process_instruction
);
#[derive(Error, Debug, Clone, PartialEq, FromPrimitive, ToPrimitive)]
@@ -343,14 +343,6 @@ mod tests {
}
}
#[rustversion::since(1.46.0)]
#[test]
fn test_bpf_loader_same_crate() {
// Ensure that we can invoke this macro from the same crate
// where it is defined.
solana_bpf_loader_program!();
}
#[test]
#[should_panic(expected = "ExceededMaxInstructions(10)")]
fn test_bpf_loader_non_terminating_program() {