Move native_loader under programs/native/
This commit is contained in:
13
Cargo.lock
generated
13
Cargo.lock
generated
@ -1745,7 +1745,6 @@ dependencies = [
|
|||||||
"ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"nix 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"nix 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -1773,6 +1772,7 @@ dependencies = [
|
|||||||
"solana-jsonrpc-ws-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"solana-jsonrpc-ws-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"solana-lualoader 0.11.0",
|
"solana-lualoader 0.11.0",
|
||||||
"solana-metrics 0.11.0",
|
"solana-metrics 0.11.0",
|
||||||
|
"solana-native-loader 0.11.0",
|
||||||
"solana-noop 0.11.0",
|
"solana-noop 0.11.0",
|
||||||
"solana-sdk 0.11.0",
|
"solana-sdk 0.11.0",
|
||||||
"solana-storage-program 0.11.0",
|
"solana-storage-program 0.11.0",
|
||||||
@ -1950,6 +1950,17 @@ dependencies = [
|
|||||||
"solana-sdk 0.11.0",
|
"solana-sdk 0.11.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "solana-native-loader"
|
||||||
|
version = "0.11.0"
|
||||||
|
dependencies = [
|
||||||
|
"bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"solana-sdk 0.11.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "solana-noop"
|
name = "solana-noop"
|
||||||
version = "0.11.0"
|
version = "0.11.0"
|
||||||
|
@ -81,7 +81,6 @@ indexmap = "1.0"
|
|||||||
ipnetwork = "0.12.7"
|
ipnetwork = "0.12.7"
|
||||||
itertools = "0.7.11"
|
itertools = "0.7.11"
|
||||||
libc = "0.2.44"
|
libc = "0.2.44"
|
||||||
libloading = "0.5.0"
|
|
||||||
log = "0.4.2"
|
log = "0.4.2"
|
||||||
matches = "0.1.6"
|
matches = "0.1.6"
|
||||||
nix = "0.12.0"
|
nix = "0.12.0"
|
||||||
@ -109,6 +108,7 @@ solana-jsonrpc-pubsub = "0.3.0"
|
|||||||
solana-jsonrpc-ws-server = "0.3.0"
|
solana-jsonrpc-ws-server = "0.3.0"
|
||||||
solana-lualoader = { path = "programs/native/lua_loader", version = "0.11.0" }
|
solana-lualoader = { path = "programs/native/lua_loader", version = "0.11.0" }
|
||||||
solana-metrics = { path = "metrics", version = "0.11.0" }
|
solana-metrics = { path = "metrics", version = "0.11.0" }
|
||||||
|
solana-native-loader = { path = "programs/native/native_loader", version = "0.11.0" }
|
||||||
solana-noop = { path = "programs/native/noop", version = "0.11.0" }
|
solana-noop = { path = "programs/native/noop", version = "0.11.0" }
|
||||||
solana-sdk = { path = "sdk", version = "0.11.0" }
|
solana-sdk = { path = "sdk", version = "0.11.0" }
|
||||||
solana-storage-program = { path = "programs/native/storage", version = "0.11.0" }
|
solana-storage-program = { path = "programs/native/storage", version = "0.11.0" }
|
||||||
@ -152,6 +152,7 @@ members = [
|
|||||||
"programs/native/budget",
|
"programs/native/budget",
|
||||||
"programs/native/erc20",
|
"programs/native/erc20",
|
||||||
"programs/native/lua_loader",
|
"programs/native/lua_loader",
|
||||||
|
"programs/native/native_loader",
|
||||||
"programs/native/noop",
|
"programs/native/noop",
|
||||||
"programs/native/vote",
|
"programs/native/vote",
|
||||||
"sdk",
|
"sdk",
|
||||||
|
@ -19,7 +19,7 @@ if [[ -n $CI ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=2044 # Disable 'For loops over find output are fragile...'
|
# shellcheck disable=2044 # Disable 'For loops over find output are fragile...'
|
||||||
for Cargo_toml in {sdk,metrics,drone,programs/native/{budget,bpf_loader,lua_loader,noop,system,vote},.}/Cargo.toml; do
|
for Cargo_toml in {sdk,metrics,drone,programs/native/{budget,bpf_loader,lua_loader,native_loader,noop,system,vote},.}/Cargo.toml; do
|
||||||
# TODO: Ensure the published version matches the contents of BUILDKITE_TAG
|
# TODO: Ensure the published version matches the contents of BUILDKITE_TAG
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
|
18
programs/native/native_loader/Cargo.toml
Normal file
18
programs/native/native_loader/Cargo.toml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
[package]
|
||||||
|
name = "solana-native-loader"
|
||||||
|
version = "0.11.0"
|
||||||
|
description = "Solana Native Loader"
|
||||||
|
authors = ["Solana Maintainers <maintainers@solana.com>"]
|
||||||
|
repository = "https://github.com/solana-labs/solana"
|
||||||
|
license = "Apache-2.0"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
bincode = "1.0.0"
|
||||||
|
libc = "0.2.44"
|
||||||
|
libloading = "0.5.0"
|
||||||
|
log = "0.4.2"
|
||||||
|
solana-sdk = { path = "../../../sdk", version = "0.11.0" }
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "native_loader"
|
||||||
|
crate-type = ["lib"]
|
@ -1,6 +1,12 @@
|
|||||||
//! Native loader
|
//! Native loader
|
||||||
|
extern crate bincode;
|
||||||
|
extern crate libc;
|
||||||
|
extern crate libloading;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate log;
|
||||||
|
extern crate solana_sdk;
|
||||||
|
|
||||||
use bincode::deserialize;
|
use bincode::deserialize;
|
||||||
use libc;
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use libloading::os::unix::*;
|
use libloading::os::unix::*;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
@ -47,7 +53,7 @@ pub fn check_id(program_id: &Pubkey) -> bool {
|
|||||||
program_id.as_ref() == NATIVE_LOADER_PROGRAM_ID
|
program_id.as_ref() == NATIVE_LOADER_PROGRAM_ID
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn process_instruction(
|
pub fn entrypoint(
|
||||||
program_id: &Pubkey,
|
program_id: &Pubkey,
|
||||||
keyed_accounts: &mut [KeyedAccount],
|
keyed_accounts: &mut [KeyedAccount],
|
||||||
ix_userdata: &[u8],
|
ix_userdata: &[u8],
|
@ -43,7 +43,6 @@ pub mod ledger;
|
|||||||
pub mod ledger_write_stage;
|
pub mod ledger_write_stage;
|
||||||
pub mod logger;
|
pub mod logger;
|
||||||
pub mod mint;
|
pub mod mint;
|
||||||
pub mod native_loader;
|
|
||||||
pub mod ncp;
|
pub mod ncp;
|
||||||
pub mod netutil;
|
pub mod netutil;
|
||||||
pub mod packet;
|
pub mod packet;
|
||||||
@ -93,7 +92,6 @@ extern crate indexmap;
|
|||||||
extern crate ipnetwork;
|
extern crate ipnetwork;
|
||||||
extern crate itertools;
|
extern crate itertools;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
extern crate libloading;
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
extern crate nix;
|
extern crate nix;
|
||||||
@ -107,6 +105,7 @@ extern crate serde;
|
|||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
|
extern crate native_loader;
|
||||||
extern crate serde_cbor;
|
extern crate serde_cbor;
|
||||||
extern crate sha2;
|
extern crate sha2;
|
||||||
extern crate socket2;
|
extern crate socket2;
|
||||||
|
@ -45,7 +45,7 @@ fn process_instruction(
|
|||||||
tick_height,
|
tick_height,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
native_loader::process_instruction(
|
native_loader::entrypoint(
|
||||||
&program_id,
|
&program_id,
|
||||||
&mut keyed_accounts,
|
&mut keyed_accounts,
|
||||||
&tx.instructions[instruction_index].userdata,
|
&tx.instructions[instruction_index].userdata,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
extern crate bincode;
|
extern crate bincode;
|
||||||
extern crate elf;
|
extern crate elf;
|
||||||
|
extern crate native_loader;
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
extern crate solana;
|
extern crate solana;
|
||||||
extern crate solana_sdk;
|
extern crate solana_sdk;
|
||||||
@ -7,7 +8,6 @@ extern crate solana_sdk;
|
|||||||
use solana::bank::Bank;
|
use solana::bank::Bank;
|
||||||
use solana::logger;
|
use solana::logger;
|
||||||
use solana::mint::Mint;
|
use solana::mint::Mint;
|
||||||
use solana::native_loader;
|
|
||||||
#[cfg(feature = "bpf_c")]
|
#[cfg(feature = "bpf_c")]
|
||||||
use solana_sdk::bpf_loader;
|
use solana_sdk::bpf_loader;
|
||||||
use solana_sdk::loader_transaction::LoaderTransaction;
|
use solana_sdk::loader_transaction::LoaderTransaction;
|
||||||
|
Reference in New Issue
Block a user