Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
1,539 changes: 767 additions & 772 deletions Cargo.lock

Large diffs are not rendered by default.

67 changes: 34 additions & 33 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,58 +17,59 @@ targets = ["x86_64-unknown-linux-gnu"]
name = 'integritee-node'

[dependencies]
clap = { version = "3.1.18", features = ["derive"] }
clap = { version = "4.0.29", features = ["derive"] }
hex = "0.4"
serde_json = "1.0.63"

frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
hex-literal = { version = "0.3.1" }
pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-cli = { features = ["wasmtime"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-executor = { features = ["wasmtime"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-service = { features = ["wasmtime"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-cli = { features = ["wasmtime"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-executor = { features = ["wasmtime"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-service = { features = ["wasmtime"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }

# These dependencies are used for the node template's RPCs
jsonrpsee = { version = "0.15.1", features = ["server"] }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }

# These dependencies are used for runtime benchmarking
frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }

# local dependencies
integritee-node-runtime = { path = '../runtime' }

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.29" }
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }

[features]
default = []
runtime-benchmarks = [
"integritee-node-runtime/runtime-benchmarks",
"sc-service/runtime-benchmarks",
]
# allow workers to register without remote attestation for dev purposes
skip-ias-check = ["integritee-node-runtime/skip-ias-check"]
Expand Down
2 changes: 1 addition & 1 deletion node/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
pub fn create_benchmark_extrinsic(
client: &FullClient,
sender: sp_core::sr25519::Pair,
call: runtime::Call,
call: runtime::RuntimeCall,
nonce: u32,
) -> runtime::UncheckedExtrinsic {
let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
Expand Down
8 changes: 4 additions & 4 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ use sc_cli::RunCmd;

#[derive(Debug, clap::Parser)]
pub struct Cli {
#[clap(subcommand)]
#[command(subcommand)]
pub subcommand: Option<Subcommand>,

#[clap(flatten)]
#[command(flatten)]
pub run: RunCmd,
}

#[derive(Debug, clap::Subcommand)]
pub enum Subcommand {
/// Key management cli utilities.
#[clap(subcommand)]
#[command(subcommand)]
Key(sc_cli::KeySubcommand),

/// Build a chain specification.
Expand Down Expand Up @@ -40,7 +40,7 @@ pub enum Subcommand {
ChainInfo(sc_cli::ChainInfoCmd),

/// Sub-commands concerned with benchmarking.
#[clap(subcommand)]
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some command against runtime state.
Expand Down
9 changes: 9 additions & 0 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ pub fn run() -> sc_cli::Result<()> {
let PartialComponents { client, .. } = service::new_partial(&config)?;
cmd.run(client)
},
#[cfg(not(feature = "runtime-benchmarks"))]
BenchmarkCmd::Storage(_) =>
return Err(sc_cli::Error::Input(
"Compile with --features=runtime-benchmarks \
to enable storage benchmarks."
.into(),
)
.into()),
#[cfg(feature = "runtime-benchmarks")]
BenchmarkCmd::Storage(cmd) => {
let PartialComponents { client, backend, .. } =
service::new_partial(&config)?;
Expand Down
30 changes: 12 additions & 18 deletions node/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.

use integritee_node_runtime::{self, opaque::Block, RuntimeApi};
use sc_client_api::{BlockBackend, ExecutorProvider};
use sc_client_api::BlockBackend;
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
pub use sc_executor::NativeElseWasmExecutor;
use sc_finality_grandpa::SharedVoterState;
Expand Down Expand Up @@ -113,7 +113,7 @@ pub fn new_partial(
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;

let import_queue =
sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _>(ImportQueueParams {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always love it, when a parameters disappears. :D

block_import: grandpa_block_import.clone(),
justification_import: Some(Box::new(grandpa_block_import.clone())),
client: client.clone(),
Expand All @@ -126,12 +126,9 @@ pub fn new_partial(
slot_duration,
);

Ok((timestamp, slot))
Ok((slot, timestamp))
},
spawner: &task_manager.spawn_essential_handle(),
can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(
client.executor().clone(),
),
registry: config.prometheus_registry(),
check_for_equivocation: Default::default(),
telemetry: telemetry.as_ref().map(|x| x.handle()),
Expand Down Expand Up @@ -195,7 +192,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
Vec::default(),
));

let (network, system_rpc_tx, network_starter) =
let (network, system_rpc_tx, tx_handler_controller, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
client: client.clone(),
Expand Down Expand Up @@ -235,15 +232,16 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
};

let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
network: network.clone(),
rpc_builder: rpc_extensions_builder,
client: client.clone(),
keystore: keystore_container.sync_keystore(),
task_manager: &mut task_manager,
transaction_pool: transaction_pool.clone(),
rpc_builder: rpc_extensions_builder,
task_manager: &mut task_manager,
config,
keystore: keystore_container.sync_keystore(),
backend,
network: network.clone(),
system_rpc_tx,
config,
tx_handler_controller,
telemetry: telemetry.as_mut(),
})?;

Expand All @@ -256,12 +254,9 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
telemetry.as_ref().map(|x| x.handle()),
);

let can_author_with =
sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());

let slot_duration = sc_consensus_aura::slot_duration(&*client)?;

let aura = sc_consensus_aura::start_aura::<AuraPair, _, _, _, _, _, _, _, _, _, _, _>(
let aura = sc_consensus_aura::start_aura::<AuraPair, _, _, _, _, _, _, _, _, _, _>(
StartAuraParams {
slot_duration,
client,
Expand All @@ -277,12 +272,11 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
slot_duration,
);

Ok((timestamp, slot))
Ok((slot, timestamp))
},
force_authoring,
backoff_authoring_blocks,
keystore: keystore_container.sync_keystore(),
can_author_with,
sync_oracle: network.clone(),
justification_sync_link: network.clone(),
block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32),
Expand Down
Loading