Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,782 changes: 5,089 additions & 2,693 deletions Cargo.lock

Large diffs are not rendered by default.

148 changes: 74 additions & 74 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,85 +24,85 @@ serde_json = "1.0.114"
tokio = { version = "1.33", features = ["rt-multi-thread", "macros", "time"] }

# integritee deps
pallet-claims = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v1.13.0" }
pallet-enclave-bridge = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v1.13.0" }
pallet-sidechain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v1.13.0" }
pallet-teeracle = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v1.13.0" }
pallet-teerdays = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v1.13.0" }
pallet-teerex = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v1.13.0" }
pallet-claims = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-stable2503-6" }
pallet-enclave-bridge = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-stable2503-6" }
pallet-sidechain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-stable2503-6" }
pallet-teeracle = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-stable2503-6" }
pallet-teerdays = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-stable2503-6" }
pallet-teerex = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-stable2503-6" }

# substrate deps
frame-benchmarking = { version = "35.0.0", default-features = false }
frame-benchmarking-cli = { version = "39.0.0" }
frame-executive = { version = "35.0.0", default-features = false }
frame-metadata-hash-extension = { version = "0.3.0", default-features = false }
frame-support = { version = "35.0.0", default-features = false }
frame-system = { version = "35.0.0", default-features = false }
frame-system-benchmarking = { version = "35.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "33.0.0", default-features = false }
frame-try-runtime = { version = "0.41.0", default-features = false }
frame-benchmarking = { version = "40.2.1", default-features = false }
frame-benchmarking-cli = { version = "48.0.0" }
frame-executive = { version = "40.0.1", default-features = false }
frame-metadata-hash-extension = { version = "0.8.0", default-features = false }
frame-support = { version = "40.1.0", default-features = false }
frame-system = { version = "40.2.0", default-features = false }
frame-system-benchmarking = { version = "40.0.1", default-features = false }
frame-system-rpc-runtime-api = { version = "36.0.0", default-features = false }
frame-try-runtime = { version = "0.46.0", default-features = false }
hex-literal = { version = "0.4.1" }
jsonrpsee = { version = "0.22.0", features = ["server"] }
pallet-aura = { version = "34.0.0", default-features = false }
pallet-balances = { version = "36.0.0", default-features = false }
pallet-grandpa = { version = "35.0.0", default-features = false }
pallet-insecure-randomness-collective-flip = { version = "23.0.0", default-features = false }
pallet-multisig = { version = "35.0.0", default-features = false }
pallet-preimage = { version = "35.0.0", default-features = false }
pallet-proxy = { version = "35.0.0", default-features = false }
pallet-scheduler = { version = "36.0.0", default-features = false }
pallet-sudo = { version = "35.0.0", default-features = false }
pallet-timestamp = { version = "34.0.0", default-features = false }
pallet-transaction-payment = { version = "35.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "37.0.0" }
pallet-transaction-payment-rpc-runtime-api = { version = "35.0.0", default-features = false }
pallet-treasury = { version = "34.0.0", default-features = false }
pallet-utility = { version = "35.0.0", default-features = false }
pallet-vesting = { version = "35.0.0", default-features = false }
sc-basic-authorship = { version = "0.41.0" }
sc-chain-spec = "34.0.0"
sc-cli = { version = "0.43.0" }
sc-client-api = { version = "35.0.0" }
sc-consensus = { version = "0.40.0" }
sc-consensus-aura = { version = "0.41.0" }
sc-consensus-grandpa = { version = "0.26.0" }
sc-executor = { version = "0.39.0" }
sc-keystore = { version = "32.0.0" }
sc-network = { version = "0.41.0" }
sc-offchain = { version = "36.0.0" }
sc-rpc = "36.0.0"
sc-rpc-api = "0.40.0"
sc-service = { version = "0.42.0" }
sc-telemetry = { version = "21.0.0" }
sc-transaction-pool = { version = "35.0.0" }
sc-transaction-pool-api = { version = "35.0.0" }
sp-api = { version = "33.0.0", default-features = false }
sp-application-crypto = { version = "37.0.0", default-features = false }
sp-arithmetic = { version = "26.0.0", default-features = false }
sp-block-builder = { version = "33.0.0", default-features = false }
sp-blockchain = "35.0.0"
sp-consensus = { version = "0.39.0" }
sp-consensus-aura = { version = "0.39.0", default-features = false }
sp-consensus-grandpa = { version = "20.0.0", default-features = false }
sp-core = { version = "34.0.0", default-features = false }
sp-genesis-builder = { version = "0.14.0", default-features = false }
sp-inherents = { version = "33.0.0", default-features = false }
sp-io = { version = "37.0.0", default-features = false }
sp-keyring = "38.0.0"
sp-keystore = "0.40.0"
sp-offchain = { version = "33.0.0", default-features = false }
sp-rpc = "32.0.0"
sp-runtime = { version = "38.0.0", default-features = false }
sp-session = { version = "34.0.0", default-features = false }
sp-staking = { version = "33.0.0", default-features = false }
jsonrpsee = { version = "0.24.9", features = ["server"] }
pallet-aura = { version = "39.0.0", default-features = false }
pallet-balances = { version = "41.1.1", default-features = false }
pallet-grandpa = { version = "40.0.0", default-features = false }
pallet-insecure-randomness-collective-flip = { version = "28.0.0", default-features = false }
pallet-multisig = { version = "40.1.0", default-features = false }
pallet-preimage = { version = "40.0.0", default-features = false }
pallet-proxy = { version = "40.1.0", default-features = false }
pallet-scheduler = { version = "41.2.0", default-features = false }
pallet-sudo = { version = "40.0.0", default-features = false }
pallet-timestamp = { version = "39.0.0", default-features = false }
pallet-transaction-payment = { version = "40.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "43.0.0" }
pallet-transaction-payment-rpc-runtime-api = { version = "40.0.0", default-features = false }
pallet-treasury = { version = "39.0.0", default-features = false }
pallet-utility = { version = "40.0.0", default-features = false }
pallet-vesting = { version = "40.1.0", default-features = false }
sc-basic-authorship = { version = "0.49.0" }
sc-chain-spec = "43.0.0"
sc-cli = { version = "0.52.0" }
sc-client-api = { version = "39.0.0" }
sc-consensus = { version = "0.49.0" }
sc-consensus-aura = { version = "0.50.0" }
sc-consensus-grandpa = { version = "0.35.0" }
sc-executor = { version = "0.42.0" }
sc-keystore = { version = "35.0.0" }
sc-network = { version = "0.50.1" }
sc-offchain = { version = "45.0.0" }
sc-rpc = "45.0.0"
sc-rpc-api = "0.49.0"
sc-service = { version = "0.51.0" }
sc-telemetry = { version = "28.1.0" }
sc-transaction-pool = { version = "39.0.0" }
sc-transaction-pool-api = { version = "39.0.0" }
sp-api = { version = "36.0.1", default-features = false }
sp-application-crypto = { version = "40.1.0", default-features = false }
sp-arithmetic = { version = "26.1.0", default-features = false }
sp-block-builder = { version = "36.0.0", default-features = false }
sp-blockchain = "39.0.0"
sp-consensus = { version = "0.42.0" }
sp-consensus-aura = { version = "0.42.0", default-features = false }
sp-consensus-grandpa = { version = "23.1.0", default-features = false }
sp-core = { version = "36.1.0", default-features = false }
sp-genesis-builder = { version = "0.17.0", default-features = false }
sp-inherents = { version = "36.0.0", default-features = false }
sp-io = { version = "40.0.1", default-features = false }
sp-keyring = "41.0.0"
sp-keystore = "0.42.0"
sp-offchain = { version = "36.0.0", default-features = false }
sp-rpc = "34.0.0"
sp-runtime = { version = "41.1.0", default-features = false }
sp-session = { version = "38.1.0", default-features = false }
sp-staking = { version = "38.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-storage = { version = "21.0.0", default-features = false }
sp-timestamp = { version = "33.0.0" }
sp-transaction-pool = { version = "33.0.0", default-features = false }
sp-version = { version = "36.0.0", default-features = false }
substrate-frame-rpc-system = { version = "35.0.0" }
sp-storage = { version = "22.0.0", default-features = false }
sp-timestamp = { version = "36.0.0" }
sp-transaction-pool = { version = "36.0.0", default-features = false }
sp-version = { version = "39.0.0", default-features = false }
substrate-frame-rpc-system = { version = "44.0.0" }

substrate-wasm-builder = "23.0.0"
substrate-wasm-builder = "26.0.1"
substrate-build-script-utils = "11.0.0"

#[patch."https://github.com/integritee-network/pallets.git"]
Expand Down
1 change: 1 addition & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ runtime-benchmarks = [
"frame-benchmarking-cli/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"pallet-transaction-payment/runtime-benchmarks",
]
# for secure launch of a live solo network, do enable extrinsic filtering
extrinsic-filtering = ["integritee-node-runtime/extrinsic-filtering"]
3 changes: 2 additions & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ pub fn run() -> sc_cli::Result<()> {
let ext_builder = RemarkBuilder::new(client.clone());

cmd.run(
config,
config.chain_spec.name().into(),
client,
inherent_benchmark_data()?,
Vec::new(),
&ext_builder,
false,
)
},
BenchmarkCmd::Extrinsic(cmd) => {
Expand Down
8 changes: 2 additions & 6 deletions node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};

pub use sc_rpc_api::DenyUnsafe;

/// Full client dependencies.
pub struct FullDeps<C, P> {
/// The client instance to use.
pub client: Arc<C>,
/// Transaction pool instance.
pub pool: Arc<P>,
/// Whether to deny unsafe calls
pub deny_unsafe: DenyUnsafe,
}

/// Instantiate all full RPC extensions.
Expand All @@ -43,9 +39,9 @@ where
use substrate_frame_rpc_system::{System, SystemApiServer};

let mut module = RpcModule::new(());
let FullDeps { client, pool, deny_unsafe } = deps;
let FullDeps { client, pool } = deps;

module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
module.merge(System::new(client.clone(), pool).into_rpc())?;
module.merge(TransactionPayment::new(client).into_rpc())?;

// Extend this RPC with a custom API by using the following syntax.
Expand Down
47 changes: 24 additions & 23 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use integritee_node_runtime::{self, opaque::Block, RuntimeApi};
use sc_client_api::{Backend, BlockBackend};
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
use sc_consensus_grandpa::SharedVoterState;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager, WarpSyncParams};
use sc_service::{error::Error as ServiceError, Configuration, TaskManager, WarpSyncConfig};
use sc_telemetry::{Telemetry, TelemetryWorker};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
Expand All @@ -28,7 +28,7 @@ pub type Service = sc_service::PartialComponents<
FullBackend,
FullSelectChain,
sc_consensus::DefaultImportQueue<Block>,
sc_transaction_pool::FullPool<Block, FullClient>,
sc_transaction_pool::TransactionPoolHandle<Block, FullClient>,
(
sc_consensus_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, FullSelectChain>,
sc_consensus_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
Expand All @@ -48,7 +48,7 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {
})
.transpose()?;

let executor = sc_service::new_wasm_executor::<sp_io::SubstrateHostFunctions>(config);
let executor = sc_service::new_wasm_executor::<sp_io::SubstrateHostFunctions>(&config.executor);
let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
config,
Expand All @@ -64,12 +64,15 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {

let select_chain = sc_consensus::LongestChain::new(backend.clone());

let transaction_pool = sc_transaction_pool::BasicPool::new_full(
config.transaction_pool.clone(),
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
let transaction_pool = Arc::from(
sc_transaction_pool::Builder::new(
task_manager.spawn_essential_handle(),
client.clone(),
config.role.is_authority().into(),
)
.with_options(config.transaction_pool.clone())
.with_prometheus(config.prometheus_registry())
.build(),
);

let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import(
Expand Down Expand Up @@ -144,7 +147,7 @@ pub fn new_full<
Block,
<Block as sp_runtime::traits::Block>::Hash,
N,
>::new(&config.network);
>::new(&config.network, config.prometheus_registry().cloned());
let metrics = N::register_notification_metrics(config.prometheus_registry());

let peer_store_handle = net_config.peer_store_handle();
Expand All @@ -166,7 +169,7 @@ pub fn new_full<
Vec::default(),
));

let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
let (network, system_rpc_tx, tx_handler_controller, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
net_config,
Expand All @@ -175,15 +178,13 @@ pub fn new_full<
spawn_handle: task_manager.spawn_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)),
warp_sync_config: Some(WarpSyncConfig::WithProvider(warp_sync)),
block_relay: None,
metrics,
})?;

if config.offchain_worker.enabled {
task_manager.spawn_handle().spawn(
"offchain-workers-runner",
"offchain-worker",
let offchain_workers =
sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions {
runtime_api_provider: client.clone(),
is_validator: config.role.is_authority(),
Expand All @@ -195,13 +196,15 @@ pub fn new_full<
network_provider: Arc::new(network.clone()),
enable_http_requests: true,
custom_extensions: |_| vec![],
})
.run(client.clone(), task_manager.spawn_handle())
.boxed(),
})?;
task_manager.spawn_handle().spawn(
"offchain-workers-runner",
"offchain-worker",
offchain_workers.run(client.clone(), task_manager.spawn_handle()).boxed(),
);
}

let role = config.role.clone();
let role = config.role;
let force_authoring = config.force_authoring;
let backoff_authoring_blocks: Option<()> = None;
let name = config.network.node_name.clone();
Expand All @@ -212,9 +215,8 @@ pub fn new_full<
let client = client.clone();
let pool = transaction_pool.clone();

Box::new(move |deny_unsafe, _| {
let deps =
crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe };
Box::new(move |_| {
let deps = crate::rpc::FullDeps { client: client.clone(), pool: pool.clone() };
crate::rpc::create_full(deps).map_err(Into::into)
})
};
Expand Down Expand Up @@ -327,6 +329,5 @@ pub fn new_full<
);
}

network_starter.start_network();
Ok(task_manager)
}
27 changes: 27 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,31 @@ runtime-benchmarks = [
"pallet-grandpa/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
"pallet-transaction-payment/runtime-benchmarks",
]
try-runtime = [
"frame-executive/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-aura/try-runtime",
"pallet-balances/try-runtime",
"pallet-claims/try-runtime",
"pallet-enclave-bridge/try-runtime",
"pallet-grandpa/try-runtime",
"pallet-insecure-randomness-collective-flip/try-runtime",
"pallet-multisig/try-runtime",
"pallet-preimage/try-runtime",
"pallet-proxy/try-runtime",
"pallet-scheduler/try-runtime",
"pallet-sidechain/try-runtime",
"pallet-sudo/try-runtime",
"pallet-teeracle/try-runtime",
"pallet-teerdays/try-runtime",
"pallet-teerex/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-treasury/try-runtime",
"pallet-utility/try-runtime",
"pallet-vesting/try-runtime",
"sp-runtime/try-runtime",
]
Loading
Loading