Skip to content

Commit

Permalink
Update polkadot-sdk to latest git revision of subspace-v2 branch of…
Browse files Browse the repository at this point in the history
… Subspace fork
  • Loading branch information
nazar-pc committed Jan 16, 2024
1 parent 08d5d47 commit 7627e61
Show file tree
Hide file tree
Showing 14 changed files with 480 additions and 1,357 deletions.
1,648 changes: 389 additions & 1,259 deletions Cargo.lock

Large diffs are not rendered by default.

142 changes: 71 additions & 71 deletions Cargo.toml

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions client/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ where
{
type Error = ConsensusError;

async fn check_block(
&mut self,
block: BlockCheckParams<B>,
) -> Result<ImportResult, Self::Error> {
async fn check_block(&self, block: BlockCheckParams<B>) -> Result<ImportResult, Self::Error> {
self.inner.check_block(block).await.map_err(Into::into)
}

Expand Down
1 change: 1 addition & 0 deletions frame/base-fee/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ impl frame_system::Config for Test {
type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
type Nonce = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
Expand Down
1 change: 1 addition & 0 deletions frame/dynamic-fee/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ impl frame_system::Config for Test {
type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
type Nonce = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
Expand Down
1 change: 1 addition & 0 deletions frame/ethereum/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ impl frame_system::Config for Test {
type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
type Nonce = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/curve25519/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = { workspace = true }
repository = { workspace = true }

[dependencies]
curve25519-dalek = { version = "4.1.0", default-features = false, features = ["alloc"] }
curve25519-dalek = { version = "4.1.1", default-features = false, features = ["alloc"] }
# Frontier
fp-evm = { workspace = true }

Expand Down
1 change: 1 addition & 0 deletions frame/evm/precompile/dispatch/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl frame_system::Config for Test {
type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
type Nonce = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
Expand Down
1 change: 1 addition & 0 deletions frame/evm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl frame_system::Config for Test {
type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
type Nonce = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
Expand Down
1 change: 1 addition & 0 deletions frame/hotfix-sufficients/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ impl frame_system::Config for Test {
type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
type Nonce = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
Expand Down
1 change: 1 addition & 0 deletions precompiles/tests-external/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ impl frame_system::Config for Runtime {
type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
type Nonce = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Stable
#channel = "1.70.0" # rustc 1.70.0 (84c898d65 2023-05-13)
# Nightly
channel = "nightly-2023-05-23" # rustc 1.71.0-nightly (8b4b20836 2023-05-22)
channel = "nightly-2023-10-16" # rustc 1.75.0-nightly (42b1224e9 2023-10-15)
components = ["cargo", "clippy", "rustc", "rustfmt", "rust-src"]
profile = "minimal"
targets = ["wasm32-unknown-unknown"]
29 changes: 8 additions & 21 deletions template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
use std::{cell::RefCell, path::Path, sync::Arc, time::Duration};

use futures::{channel::mpsc, prelude::*};
use sc_consensus::SharedBlockImport;
// Substrate
use prometheus_endpoint::Registry;
use sc_client_api::{Backend, BlockBackend};
use sc_consensus::BasicQueue;
use sc_executor::NativeExecutionDispatch;
use sc_network_sync::warp::{WarpSyncParams, WarpSyncProvider};
use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager};
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
Expand Down Expand Up @@ -38,7 +38,7 @@ type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
type GrandpaBlockImport<Client> =
sc_consensus_grandpa::GrandpaBlockImport<FullBackend, Block, Client, FullSelectChain>;
type GrandpaLinkHalf<Client> = sc_consensus_grandpa::LinkHalf<Block, Client, FullSelectChain>;
type BoxBlockImport = sc_consensus::BoxBlockImport<Block>;
type BoxBlockImport = SharedBlockImport<Block>;

/// The minimum period of blocks on which justifications will be
/// imported and generated.
Expand Down Expand Up @@ -227,7 +227,7 @@ where
)
.map_err::<ServiceError, _>(Into::into)?;

Ok((import_queue, Box::new(frontier_block_import)))
Ok((import_queue, SharedBlockImport::new(frontier_block_import)))
}

/// Build the import queue for the template runtime (manual seal).
Expand All @@ -248,11 +248,11 @@ where
let frontier_block_import = FrontierBlockImport::new(client.clone(), client);
Ok((
sc_consensus_manual_seal::import_queue(
Box::new(frontier_block_import.clone()),
SharedBlockImport::new(frontier_block_import.clone()),
&task_manager.spawn_essential_handle(),
config.prometheus_registry(),
),
Box::new(frontier_block_import),
SharedBlockImport::new(frontier_block_import),
))
}

Expand Down Expand Up @@ -291,27 +291,14 @@ where
fee_history_cache_limit,
} = new_frontier_partial(&eth_config)?;

let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);
let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);
let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name(
&client.block_hash(0)?.expect("Genesis block exists; qed"),
&config.chain_spec,
);
let (grandpa_protocol_config, grandpa_notification_service) =
let (_grandpa_protocol_config, grandpa_notification_service) =
sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone());

let warp_sync_params = if sealing.is_some() {
None
} else {
net_config.add_notification_protocol(grandpa_protocol_config);
let warp_sync: Arc<dyn WarpSyncProvider<Block>> =
Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
Vec::default(),
));
Some(WarpSyncParams::WithProvider(warp_sync))
};

let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
Expand All @@ -321,7 +308,7 @@ where
spawn_handle: task_manager.spawn_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_params,
warp_sync_params: None,
block_relay: None,
})?;

Expand Down
2 changes: 2 additions & 0 deletions template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
state_version: 1,
extrinsic_state_version: 0,
};

pub const MILLISECS_PER_BLOCK: u64 = 6000;
Expand Down Expand Up @@ -176,6 +177,7 @@ impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin;
/// The aggregated dispatch type that is available for extrinsics.
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
/// The index type for storing how many extrinsics an account has signed.
type Nonce = Nonce;
/// The type for hashing blocks and tries.
Expand Down

0 comments on commit 7627e61

Please sign in to comment.