Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Removal of execution strategies #14387

Merged
merged 75 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
04f2167
Start
bkchr Mar 13, 2023
08c0b32
More work!
bkchr Mar 13, 2023
d1d5d4c
Moar
bkchr Mar 14, 2023
55af869
More changes
bkchr Mar 15, 2023
4374d01
More fixes
bkchr Mar 16, 2023
cc3c030
More worrk
bkchr Mar 17, 2023
0cac727
More fixes
bkchr Mar 20, 2023
7dbaa81
More fixes to make it compile
bkchr Mar 20, 2023
5b2fc23
Adds `NoOffchainStorage`
bkchr Mar 21, 2023
9fed302
Pass the extensions
bkchr Mar 21, 2023
6730212
Small basti making small progress
bkchr Mar 22, 2023
63ada35
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Apr 4, 2023
a3ff3e3
Fix merge errors and remove `ExecutionContext`
bkchr Apr 4, 2023
afbc691
Move registration of `ReadRuntimeVersionExt` to `ExecutionExtension`
bkchr Apr 4, 2023
947b02f
Merge remote-tracking branch 'origin/bkchr-move-read-runtime-version-…
bkchr Apr 4, 2023
906fb5a
Fix compilation
bkchr Apr 5, 2023
20f3c02
Register the global extensions inside runtime api instance
bkchr Apr 10, 2023
f6928f8
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Apr 24, 2023
033a32b
Fixes
bkchr Apr 26, 2023
cb24657
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Apr 28, 2023
97befb6
Fix `generate_initial_session_keys` by passing the keystore extension
bkchr May 1, 2023
c76f8fd
Fix the grandpa tests
bkchr May 2, 2023
13347fb
Fix more tests
bkchr May 2, 2023
0bd9113
Fix more tests
bkchr May 2, 2023
d457ac9
Don't set any heap pages if there isn't an override
bkchr May 3, 2023
4e4b5e4
Fix small fallout
bkchr May 3, 2023
7d48c14
FMT
bkchr May 3, 2023
d85f8ea
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr May 5, 2023
05223f1
Fix tests
bkchr May 7, 2023
6ca6737
More tests
bkchr May 8, 2023
440d0e5
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr May 8, 2023
5942c96
Offchain worker custom extensions
bkchr May 9, 2023
5b253f8
More fixes
bkchr May 9, 2023
3b7a8b4
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr May 17, 2023
16714b6
Make offchain tx pool creation reusable
bkchr May 23, 2023
e52f63d
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr May 25, 2023
190e036
Merge remote-tracking branch 'origin/bkchr-offchain-tx-pool-factory' …
bkchr May 25, 2023
902f1a4
Fixes
bkchr May 25, 2023
671f9b9
Fixes
bkchr May 25, 2023
59a6fa0
Set offchain transaction pool in BABE before using it in the runtime
bkchr May 29, 2023
9145976
Add the `offchain_tx_pool` to Grandpa as well
bkchr May 30, 2023
c29dcb3
Fix the nodes
bkchr May 30, 2023
23578b1
Print some error when using the old warnings
bkchr Jun 2, 2023
9208bf4
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Jun 2, 2023
0e0325c
Fix merge issues
bkchr Jun 2, 2023
d12e6ba
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Jun 5, 2023
65248e9
Fix compilation
bkchr Jun 5, 2023
67b1730
Rename `babe_link`
bkchr Jun 5, 2023
b1bb12d
Rename to `offchain_tx_pool_factory`
bkchr Jun 5, 2023
d4de293
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Jun 14, 2023
85ccb89
Cleanup
bkchr Jun 14, 2023
5042fb0
FMT
bkchr Jun 14, 2023
99a5ca8
Fix benchmark name
bkchr Jun 15, 2023
32e69a2
Fix `try-runtime`
bkchr Jun 15, 2023
38191af
Remove `--execution` CLI args
bkchr Jun 15, 2023
8960448
Make clippy happy
bkchr Jun 16, 2023
42301cd
Forward bls functions
bkchr Jun 16, 2023
296ffd5
Merge branch 'bkchr-execution-strategies-remove' of github.com:parity…
bkchr Jun 16, 2023
e4bfccc
Fix docs
bkchr Jun 16, 2023
ae756aa
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Jun 20, 2023
22c5603
Update UI tests
bkchr Jun 20, 2023
74ac48e
Update client/api/src/execution_extensions.rs
bkchr Jun 24, 2023
b07fde8
Apply suggestions from code review
bkchr Jun 24, 2023
8b3f2d9
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Jun 24, 2023
ec9e872
Update client/cli/src/params/import_params.rs
bkchr Jun 24, 2023
e4781c4
Update client/api/src/execution_extensions.rs
bkchr Jun 24, 2023
4115970
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Jun 28, 2023
c668c7c
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Jun 29, 2023
9d61976
Merge branch 'bkchr-execution-strategies-remove' of github.com:parity…
bkchr Jun 30, 2023
3c71aa1
Pass the offchain storage to the MMR RPC
bkchr Jun 30, 2023
0c5c43d
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Jul 5, 2023
7079d01
Update client/api/src/execution_extensions.rs
bkchr Jul 10, 2023
ad87780
Review comments
bkchr Jul 10, 2023
dc65806
Merge remote-tracking branch 'origin/master' into bkchr-execution-str…
bkchr Jul 10, 2023
792fbcc
Fixes
bkchr Jul 10, 2023
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
17 changes: 15 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions bin/node-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ sc-service = { version = "0.10.0-dev", path = "../../../client/service" }
sc-telemetry = { version = "4.0.0-dev", path = "../../../client/telemetry" }
sc-transaction-pool = { version = "4.0.0-dev", path = "../../../client/transaction-pool" }
sc-transaction-pool-api = { version = "4.0.0-dev", path = "../../../client/transaction-pool/api" }
sc-offchain = { version = "4.0.0-dev", path = "../../../client/offchain" }
sc-statement-store = { version = "4.0.0-dev", path = "../../../client/statement-store" }
Copy link
Contributor

Choose a reason for hiding this comment

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

node-template not integrate statement-store, so this seems not necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good find! Ty

sc-consensus-aura = { version = "0.10.0-dev", path = "../../../client/consensus/aura" }
sp-consensus-aura = { version = "0.10.0-dev", path = "../../../primitives/consensus/aura" }
sc-consensus = { version = "0.10.0-dev", path = "../../../client/consensus/common" }
Expand Down
29 changes: 22 additions & 7 deletions bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.

use futures::FutureExt;
use node_template_runtime::{self, opaque::Block, RuntimeApi};
use sc_client_api::BlockBackend;
use sc_client_api::{Backend, BlockBackend};
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
use sc_consensus_grandpa::SharedVoterState;
pub use sc_executor::NativeElseWasmExecutor;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager, WarpSyncParams};
use sc_telemetry::{Telemetry, TelemetryWorker};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
use std::{sync::Arc, time::Duration};

Expand Down Expand Up @@ -179,11 +181,23 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
})?;

if config.offchain_worker.enabled {
sc_service::build_offchain_workers(
&config,
task_manager.spawn_handle(),
client.clone(),
network.clone(),
task_manager.spawn_handle().spawn(
"offchain-workers-runner",
"offchain-worker",
sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions {
runtime_api_provider: client.clone(),
is_validator: config.role.is_authority(),
keystore: Some(keystore_container.keystore()),
offchain_db: backend.offchain_storage(),
transaction_pool: Some(OffchainTransactionPoolFactory::new(
transaction_pool.clone(),
)),
network_provider: network.clone(),
enable_http_requests: true,
custom_extensions: |_| vec![],
})
.run(client.clone(), task_manager.spawn_handle())
.boxed(),
);
}

Expand Down Expand Up @@ -224,7 +238,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
let proposer_factory = sc_basic_authorship::ProposerFactory::new(
task_manager.spawn_handle(),
client.clone(),
transaction_pool,
transaction_pool.clone(),
prometheus_registry.as_ref(),
telemetry.as_ref().map(|x| x.handle()),
);
Expand Down Expand Up @@ -300,6 +314,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
prometheus_registry,
shared_voter_state: SharedVoterState::empty(),
telemetry: telemetry.as_ref().map(|x| x.handle()),
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(transaction_pool),
};

// the GRANDPA voter task is considered infallible, i.e.
Expand Down
1 change: 0 additions & 1 deletion bin/node-template/pallets/template/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
// *
// --steps=50
// --repeat=20
// --execution=wasm
// --wasm-execution=compiled
// --output
// pallets/template/src/weights.rs
Expand Down
16 changes: 4 additions & 12 deletions bin/node/bench/src/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use futures::Future;
use std::{borrow::Cow, collections::HashMap, pin::Pin, sync::Arc};

use node_primitives::Block;
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes, Profile};
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
use sc_transaction_pool_api::{
ImportNotificationStream, PoolFuture, PoolStatus, ReadyTransactions, TransactionFor,
TransactionSource, TransactionStatusStreamFor, TxHash,
Expand All @@ -43,15 +43,13 @@ use crate::{
};

pub struct ConstructionBenchmarkDescription {
pub profile: Profile,
pub key_types: KeyTypes,
pub block_type: BlockType,
pub size: SizeType,
pub database_type: DatabaseType,
}

pub struct ConstructionBenchmark {
profile: Profile,
database: BenchDb,
transactions: Transactions,
}
Expand All @@ -60,11 +58,6 @@ impl core::BenchmarkDescription for ConstructionBenchmarkDescription {
fn path(&self) -> Path {
let mut path = Path::new(&["node", "proposer"]);

match self.profile {
Profile::Wasm => path.push("wasm"),
Profile::Native => path.push("native"),
}

match self.key_types {
KeyTypes::Sr25519 => path.push("sr25519"),
KeyTypes::Ed25519 => path.push("ed25519"),
Expand Down Expand Up @@ -99,24 +92,23 @@ impl core::BenchmarkDescription for ConstructionBenchmarkDescription {
}

Box::new(ConstructionBenchmark {
profile: self.profile,
database: bench_db,
transactions: Transactions(extrinsics),
})
}

fn name(&self) -> Cow<'static, str> {
format!(
"Block construction ({:?}/{}, {:?}, {:?} backend)",
self.block_type, self.size, self.profile, self.database_type,
"Block construction ({:?}/{}, {:?} backend)",
self.block_type, self.size, self.database_type,
)
.into()
}
}

impl core::Benchmark for ConstructionBenchmark {
fn run(&mut self, mode: Mode) -> std::time::Duration {
let context = self.database.create_context(self.profile);
let context = self.database.create_context();

let _ = context
.client
Expand Down
23 changes: 5 additions & 18 deletions bin/node/bench/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
use std::borrow::Cow;

use node_primitives::Block;
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes, Profile};
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
use sc_client_api::backend::Backend;
use sp_state_machine::InspectState;

Expand All @@ -43,15 +43,13 @@ use crate::{
};

pub struct ImportBenchmarkDescription {
pub profile: Profile,
pub key_types: KeyTypes,
pub block_type: BlockType,
pub size: SizeType,
pub database_type: DatabaseType,
}

pub struct ImportBenchmark {
profile: Profile,
database: BenchDb,
block: Block,
block_type: BlockType,
Expand All @@ -61,11 +59,6 @@ impl core::BenchmarkDescription for ImportBenchmarkDescription {
fn path(&self) -> Path {
let mut path = Path::new(&["node", "import"]);

match self.profile {
Profile::Wasm => path.push("wasm"),
Profile::Native => path.push("native"),
}

match self.key_types {
KeyTypes::Sr25519 => path.push("sr25519"),
KeyTypes::Ed25519 => path.push("ed25519"),
Expand All @@ -88,29 +81,23 @@ impl core::BenchmarkDescription for ImportBenchmarkDescription {
}

fn setup(self: Box<Self>) -> Box<dyn core::Benchmark> {
let profile = self.profile;
let mut bench_db = BenchDb::with_key_types(self.database_type, 50_000, self.key_types);
let block = bench_db.generate_block(self.block_type.to_content(self.size.transactions()));
Box::new(ImportBenchmark {
database: bench_db,
block_type: self.block_type,
block,
profile,
})
Box::new(ImportBenchmark { database: bench_db, block_type: self.block_type, block })
}

fn name(&self) -> Cow<'static, str> {
format!(
"Block import ({:?}/{}, {:?}, {:?} backend)",
self.block_type, self.size, self.profile, self.database_type,
"Block import ({:?}/{}, {:?} backend)",
self.block_type, self.size, self.database_type,
)
.into()
}
}

impl core::Benchmark for ImportBenchmark {
fn run(&mut self, mode: Mode) -> std::time::Duration {
let mut context = self.database.create_context(self.profile);
let mut context = self.database.create_context();

let _ = context
.client
Expand Down
Loading