Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polkadot Release v1.5.0 migration #330

Merged
merged 13 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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,029 changes: 460 additions & 569 deletions Cargo.lock

Large diffs are not rendered by default.

17 changes: 7 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[workspace]
members = [
"node",
"runtime/kreivo",
"runtime/virto",
"common",
"runtime/kreivo"
]

exclude = ["xcm-emulator"]
exclude = ["xcm-emulator", "common"]
darkforest0202 marked this conversation as resolved.
Show resolved Hide resolved
resolver = "2"

[profile.release]
Expand Down Expand Up @@ -36,7 +34,7 @@ parity-scale-codec = { version = "3.6.4", default-features = false, features = [
"derive",
] }
futures = { version = "0.3.28" }
hex-literal = { version = "0.3.4" }
hex-literal = { version = "0.4.1" }
log = { version = "0.4.20" }
serde = { version = "1.0.188" }
serde_json = "1.0.104"
Expand All @@ -47,14 +45,12 @@ smallvec = "1.11"

# Local dependencies
kreivo-runtime = { path = "runtime/kreivo" }
virto-runtime = { path = "runtime/virto" }
jsonrpsee = { version = "0.16.3" }
jsonrpsee = { version = "0.16.2"}


# Virto Pallets
pallet-asset-registry = { default-features = false, path = "pallets/asset-registry" }
pallet-burner = { default-features = false, path = "pallets/burner" }
pallet-payments = { default-features = false, path = "pallets/payments" }

runtime-common = { default-features = false, path = "runtime/common" }
kusama-runtime-constants = { default-features = false, path = "runtime/kusama-runtime-constants" }
Expand Down Expand Up @@ -103,6 +99,7 @@ sc-transaction-pool-api = { default-features = false, git = "https://github.com/
sp-runtime = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
sp-inherents = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
sp-arithmetic = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
sp-genesis-builder = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
sp-std = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
sp-version = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
sp-weights = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
Expand Down Expand Up @@ -178,7 +175,7 @@ pallet-message-queue = { default-features = false, git = "https://github.com/vir

# Polkadot
polkadot-cli = { features = ["rococo-native"], git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
polkadot-primitives = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
polkadot-primitives = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0", default-features = false }
polkadot-service = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
polkadot-runtime-parachains = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }

Expand All @@ -195,7 +192,7 @@ pallet-xcm-benchmarks = { default-features = false, git = "https://github.com/vi

# Dev dependencies
assert_cmd = "2.0"
nix = "0.26"
nix = "0.27.1"
tempfile = "3.7"
tokio = { version = "1.32.0", features = ["macros", "time", "parking_lot"] }
wait-timeout = "0.2"
5,791 changes: 5,791 additions & 0 deletions cargo.tree
darkforest0202 marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ serde = { workspace = true }
serde_json = { workspace = true }

# Local
virto-runtime = { workspace = true, optional = true }
kreivo-runtime = { workspace = true, optional = true }
jsonrpsee = { workspace = true, features = ["server"] }

Expand Down Expand Up @@ -101,13 +100,11 @@ wait-timeout = { workspace = true }
polkadot-cli = { workspace = true }

[features]
default = ["virto-runtime", "kreivo-runtime"]
default = ["kreivo-runtime"]
runtime-benchmarks = [
"virto-runtime?/runtime-benchmarks",
"kreivo-runtime?/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks"
]
try-runtime = [
"virto-runtime?/try-runtime",
"kreivo-runtime?/try-runtime"
]
62 changes: 1 addition & 61 deletions node/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,67 +85,6 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder<kreivo_runtime::
}
}

#[cfg(feature = "virto-runtime")]
impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder<virto_runtime::RuntimeApi> {
fn pallet(&self) -> &str {
"system"
}

fn extrinsic(&self) -> &str {
"remark"
}

fn build(&self, nonce: u32) -> Result<OpaqueExtrinsic, &'static str> {
use virto_runtime as runtime;

let call: runtime::RuntimeCall = runtime::SystemCall::remark { remark: vec![] }.into();
let period = runtime::BlockHashCount::get()
.checked_next_power_of_two()
.map(|c| c / 2)
.unwrap_or(2) as u64;
let best_block = self.client.chain_info().best_number;
let tip = 0;
let extra: runtime::SignedExtra = (
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(),
frame_system::CheckSpecVersion::<runtime::Runtime>::new(),
frame_system::CheckTxVersion::<runtime::Runtime>::new(),
frame_system::CheckGenesis::<runtime::Runtime>::new(),
frame_system::CheckEra::<runtime::Runtime>::from(generic::Era::mortal(period, best_block.saturated_into())),
frame_system::CheckNonce::<runtime::Runtime>::from(nonce),
frame_system::CheckWeight::<runtime::Runtime>::new(),
pallet_asset_tx_payment::ChargeAssetTxPayment::<runtime::Runtime>::from(tip, None),
);

let genesis_hash = self.client.block_hash(0).ok().flatten().expect("Genesis block exists");
let best_hash = self.client.chain_info().best_hash;
let payload = runtime::SignedPayload::from_raw(
call.clone(),
extra.clone(),
(
(),
runtime::VERSION.spec_version,
runtime::VERSION.transaction_version,
genesis_hash,
best_hash,
(),
(),
(),
),
);

let sender = Sr25519Keyring::Bob.pair();
let signature = payload.using_encoded(|x| sender.sign(x));
let extrinsic = runtime::UncheckedExtrinsic::new_signed(
call,
sp_runtime::AccountId32::from(sender.public()).into(),
runtime::Signature::Sr25519(signature),
extra,
);

Ok(extrinsic.into())
}
}

/// Generates inherent data for the `benchmark overhead` command.
pub fn inherent_benchmark_data() -> sc_cli::Result<InherentData> {
let mut inherent_data = InherentData::new();
Expand All @@ -163,6 +102,7 @@ pub fn inherent_benchmark_data() -> sc_cli::Result<InherentData> {
xcm_config: Default::default(),
raw_downward_messages: Default::default(),
raw_horizontal_messages: Default::default(),
additional_key_values: Default::default(),
};

futures::executor::block_on(parachain_inherent.provide_inherent_data(&mut inherent_data))
Expand Down
Loading
Loading