diff --git a/Cargo.lock b/Cargo.lock index 5f18fbc89..0af9c2213 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5799,11 +5799,13 @@ checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" [[package]] name = "node-polkadex-runtime" -version = "6.0.0" +version = "6.2.0" dependencies = [ + "docify", "frame-benchmarking", "frame-election-provider-support", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -7534,7 +7536,7 @@ dependencies = [ "sp-timestamp", "sp-transaction-pool", "staging-xcm", - "substrate-build-script-utils 3.0.0", + "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", "try-runtime-cli", @@ -7918,12 +7920,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "platforms" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" - [[package]] name = "polkadex-client" version = "5.4.2" @@ -7937,10 +7933,11 @@ dependencies = [ [[package]] name = "polkadex-node" -version = "6.0.0" +version = "6.2.0" dependencies = [ "clap 4.5.8", "frame-benchmarking-cli", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-try-runtime", @@ -8007,7 +8004,7 @@ dependencies = [ "sp-tracing 10.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-transaction-storage-proof", "structopt", - "substrate-build-script-utils 5.0.0", + "substrate-build-script-utils", "substrate-frame-rpc-system", "swap-rpc", "tempfile", @@ -8176,7 +8173,7 @@ dependencies = [ "sp-io 23.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-keyring", "sp-maybe-compressed-blob 4.1.0-dev (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", - "substrate-build-script-utils 3.0.0", + "substrate-build-script-utils", "thiserror", "try-runtime-cli", ] @@ -8546,7 +8543,7 @@ dependencies = [ "sp-core 21.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-maybe-compressed-blob 4.1.0-dev (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-wasm-interface 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", - "substrate-build-script-utils 3.0.0", + "substrate-build-script-utils", "tempfile", "tokio", "tracing-gum", @@ -13765,15 +13762,6 @@ name = "substrate-build-script-utils" version = "3.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#39482e78cc1580c9f16a8f8d8261baf914ab5559" -[[package]] -name = "substrate-build-script-utils" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cbc6b6e856dfd283e5116c3cc40c9f2efec2f0be49d9aaa27231a2b24bd454d" -dependencies = [ - "platforms", -] - [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" @@ -16112,4 +16100,4 @@ checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" dependencies = [ "cc", "pkg-config", -] +] \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 5d40fa87a..7218251ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,12 +118,12 @@ pallet-statement = { git = "https://github.com/paritytech/polkadot-sdk", branch sp-statement-store = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } pallet-asset-conversion = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } pallet-asset-conversion-tx-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } - +frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } orml-vesting = { git = "https://github.com/Polkadex-Substrate/orml-1.1.0.git", branch = "master", default-features = false } sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } @@ -172,7 +172,7 @@ sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", bran sc-consensus-babe-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sc-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } pallet-nomination-pools = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } grandpa-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, package = "sp-finality-grandpa" } diff --git a/nodes/mainnet/Cargo.toml b/nodes/mainnet/Cargo.toml index 359317476..316667406 100644 --- a/nodes/mainnet/Cargo.toml +++ b/nodes/mainnet/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadex-node" -version = "6.0.0" +version = "6.2.0" authors = ["Polkadex OÜ "] description = "Polkadex main blockchain" edition = "2021" @@ -13,7 +13,7 @@ repository = "https://github.com/Polkadex-Substrate/Polkadex/" targets = ["x86_64-unknown-linux-gnu"] [build-dependencies] -substrate-build-script-utils = { version = "5.0.0" } +substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } structopt = { version = "0.3.8", optional = true } [dependencies] @@ -26,16 +26,18 @@ clap = { version = "4.0.9", features = ["derive"] } itertools = "0.10.1" jsonrpsee = { version = "0.16.2", features = ["server"] } # local dependencies -node-polkadex-runtime = { path = "../../runtimes/mainnet" } +node-polkadex-runtime = { path = "../../runtimes/mainnet"} rpc-assets = { path = "../../rpc/assets" } pallet-rewards-rpc = { path = "../../pallets/rewards/rpc" } pallet-ocex-rpc = { path = "../../pallets/ocex/rpc" } polkadex-client = { path = "../../client" } - thea = { path = "../../pallets/thea" } pallet-ocex-lmp = { path = "../../pallets/ocex" } swap-rpc = { path = "../../rpc/swap" } + + # Substrate dependencies +frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } @@ -73,7 +75,6 @@ sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "rel sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } -#sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } @@ -82,7 +83,7 @@ sp-statement-store = { git = "https://github.com/paritytech/polkadot-sdk", branc sc-network-statement = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } pallet-asset-conversion-tx-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } pallet-asset-conversion = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } -#Primitives +##Primitives polkadex-primitives = { path = "../../primitives/polkadex" } sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } @@ -94,12 +95,12 @@ try-runtime-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", bran [dev-dependencies] futures = "0.3.9" tempfile = "3.1.0" -sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } sc-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } sc-consensus-epochs = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } -sc-service-test = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-service-test = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} [features] default = [] diff --git a/nodes/mainnet/src/chain_spec.rs b/nodes/mainnet/src/chain_spec.rs index 576c90297..1ff160fc0 100644 --- a/nodes/mainnet/src/chain_spec.rs +++ b/nodes/mainnet/src/chain_spec.rs @@ -1224,6 +1224,7 @@ pub fn get_stakeholder_tokens() -> Vec<(AccountId, Balance)> { } #[cfg(test)] +#[allow(dead_code)] pub(crate) mod tests { use sp_runtime::BuildStorage; diff --git a/nodes/mainnet/src/service.rs b/nodes/mainnet/src/service.rs index 8d3ac83a6..a8e4d65de 100644 --- a/nodes/mainnet/src/service.rs +++ b/nodes/mainnet/src/service.rs @@ -107,6 +107,7 @@ pub fn create_extrinsic( pallet_asset_conversion_tx_payment::ChargeAssetTxPayment::< node_polkadex_runtime::Runtime, >::from(tip, None), + frame_metadata_hash_extension::CheckMetadataHash::new(false), ); let raw_payload = node_polkadex_runtime::SignedPayload::from_raw( @@ -121,6 +122,7 @@ pub fn create_extrinsic( (), (), (), + None, ), ); let signature = raw_payload.using_encoded(|e| sender.sign(e)); @@ -312,6 +314,7 @@ pub fn new_partial( } /// Result of [`new_full_base`]. +#[allow(dead_code)] pub struct NewFullBase { /// The task manager of the node. pub task_manager: TaskManager, @@ -848,6 +851,7 @@ mod tests { check_nonce, check_weight, tx_payment, + frame_metadata_hash_extension::CheckMetadataHash::new(false), ); let raw_payload = node_polkadex_runtime::SignedPayload::from_raw( function.clone(), @@ -861,6 +865,7 @@ mod tests { (), (), (), + None, ), ); let signature = raw_payload.using_encoded(|payload| signer.sign(payload)); diff --git a/pallets/ocex/src/aggregator.rs b/pallets/ocex/src/aggregator.rs index fab4c6480..481ce76f8 100644 --- a/pallets/ocex/src/aggregator.rs +++ b/pallets/ocex/src/aggregator.rs @@ -46,7 +46,12 @@ impl AggregatorClient { /// Load signed summary and send it to the aggregator /// # Parameters /// * `snapshot_id`: Snapshot id for which signed summary should be loaded and sent - pub fn load_signed_summary_and_send(snapshot_id: u64) { + pub fn load_signed_summary_and_send( + current_set_id: u64, + snapshot_id: u64, + signer: &T::AuthorityId, + auth_index: u16, + ) -> Result<(), &'static str> { let mut key = LAST_PROCESSED_SNAPSHOT.to_vec(); key.append(&mut snapshot_id.encode()); @@ -56,7 +61,14 @@ impl AggregatorClient { <::AuthorityId as RuntimeAppPublic>::Signature, u16, )>() { - Ok(Some((summary, signature, index))) => { + Ok(Some((mut summary, mut signature, mut index))) => { + // Check if the validator set id is same as the current active, if not, update it and sign again + if summary.validator_set_id != current_set_id { + log::info!(target:"ocex","Signing with new validator set id's keys"); + summary.validator_set_id = current_set_id; + signature = signer.sign(&summary.encode()).ok_or("Private key not found")?; + index = auth_index; + } match serde_json::to_string(&ApprovedSnapshot { summary: summary.encode(), index: index.saturated_into(), @@ -83,6 +95,7 @@ impl AggregatorClient { log::error!(target:"ocex","Error loading signed summary for: nonce {:?}, {:?}",snapshot_id,err); }, } + Ok(()) } /// Load user action batch from aggregator diff --git a/pallets/ocex/src/lib.rs b/pallets/ocex/src/lib.rs index 1356dbb05..55eafe76a 100644 --- a/pallets/ocex/src/lib.rs +++ b/pallets/ocex/src/lib.rs @@ -974,11 +974,7 @@ pub mod pallet { claim_safety_period: Option, ) -> DispatchResult { T::GovernanceOrigin::ensure_origin(origin)?; - let mut config = if let Some(config) = >::get() { - config - } else { - LMPEpochConfig::default() - }; + let mut config = >::get().unwrap_or_default(); let unit: Decimal = Decimal::from(UNIT_BALANCE); if let Some(total_liquidity_mining_rewards) = total_liquidity_mining_rewards { config.total_liquidity_mining_rewards = @@ -2281,8 +2277,8 @@ impl>> Pallet signatures.len() { diff --git a/pallets/ocex/src/validator.rs b/pallets/ocex/src/validator.rs index 1c516d9c7..4f9e3962a 100644 --- a/pallets/ocex/src/validator.rs +++ b/pallets/ocex/src/validator.rs @@ -82,8 +82,7 @@ impl Pallet { let authorities = Self::validator_set().validators; let mut available_keys = authorities .iter() - .enumerate() - .filter_map(move |(_index, authority)| { + .filter_map(move |authority| { local_keys .binary_search(authority) .ok() @@ -120,9 +119,8 @@ impl Pallet { return Err("Last processed snapshot root is not same as on-chain root"); } info - } else if info.snapshot_id != 0 { + } else if info.snapshot_id != 0 && info.snapshot_id != next_nonce { log::error!(target:"ocex","Unable to load last processed snapshot summary from on-chain: {:?}",info.snapshot_id); - store_trie_root(H256::zero()); return Err("Unable to load last processed snapshot summary from on-chain"); } else { info @@ -139,8 +137,22 @@ impl Pallet { // Check if we already processed this snapshot and updated our offchain state. if last_processed_nonce == next_nonce { log::debug!(target:"ocex","Submitting last processed snapshot: {:?}",next_nonce); + if !sp_io::offchain::is_validator() { + log::error!(target: "ocex","We have stale signed summary for {:?} but not a validator anymore", last_processed_nonce); + return Ok(true); + } + let current_set_id = Self::validator_set().set_id; + let key = available_keys.first().ok_or("No active keys found")?; + let auth_index = Self::calculate_signer_index(&authorities, key) + .ok_or("Unable to calculate signer index")?; + // resubmit the summary to aggregator - AggregatorClient::::load_signed_summary_and_send(next_nonce); + AggregatorClient::::load_signed_summary_and_send( + current_set_id, + next_nonce, + key, + auth_index as u16, + )?; return Ok(true); } log::info!(target:"ocex","last_processed_nonce: {:?}, next_nonce: {:?}",last_processed_nonce, next_nonce); @@ -646,7 +658,9 @@ impl Pallet { return Err("Invalid egress message for withdraw trading fees"); } }, - IngressMessages::NewLMPEpoch(epoch) => Self::start_new_lmp_epoch(state, epoch)?, + IngressMessages::NewLMPEpoch(_epoch) => { + // Self::start_new_lmp_epoch(state, epoch)? + }, _ => {}, } } @@ -654,10 +668,12 @@ impl Pallet { Ok(verified_egress_messages) } + #[allow(dead_code)] /// Reset the offchain state's LMP index and set the epoch fn start_new_lmp_epoch(state: &mut OffchainState, epoch: u16) -> Result<(), &'static str> { let mut config = if epoch > 1 { - get_lmp_config(state, epoch)? + get_lmp_config(state, epoch) + .unwrap_or(orderbook_primitives::lmp::LMPConfig { epoch, index: 0 }) } else { // To Handle the corner case of zero orderbook_primitives::lmp::LMPConfig { epoch, index: 0 } diff --git a/runtimes/mainnet/Cargo.toml b/runtimes/mainnet/Cargo.toml index 4453dc82c..4f03f8fd1 100644 --- a/runtimes/mainnet/Cargo.toml +++ b/runtimes/mainnet/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "node-polkadex-runtime" -version = "6.0.0" +version = "6.2.0" authors = ["Polkadex OÜ "] edition = "2021" license = "GNU GPL v3" @@ -18,7 +18,6 @@ static_assertions = { workspace = true } log = { workspace = true, default-features = false } rust_decimal = { workspace = true, features = ["scale-codec"], default-features = false } #pallets -#added pallet-authorship = { default-features = false, workspace = true } pallet-babe = { default-features = false, workspace = true } pallet-balances = { default-features = false, workspace = true } @@ -82,7 +81,6 @@ sp-inherents = { default-features = false, workspace = true } sp-staking = { default-features = false, workspace = true } sp-npos-elections = { default-features = false, workspace = true } frame-election-provider-support = { default-features = false, workspace = true } -#pallet-randomness-collective-flip = { default-features = false, workspace = true } pallet-assets = { default-features = false, workspace = true } #end added @@ -101,7 +99,7 @@ polkadex-primitives = { workspace = true, default-features = false } orderbook-primitives = { path = "../../primitives/orderbook", default-features = false } pdex-migration = { path = "../../pallets/pdex-migration", default-features = false } -# Orderbook +# Orderbook pallet-ocex-lmp = { path = "../../pallets/ocex", default-features = false } pallet-lmp = { path = "../../pallets/liquidity-mining", default-features = false } @@ -118,14 +116,33 @@ frame-try-runtime = { workspace = true, optional = true, default-features = fals rpc-assets-runtime-api = { path = "../../rpc/assets/runtime-api", default-features = false } pallet-rewards-runtime-api = { path = "../../pallets/rewards/rpc/runtime-api", default-features = false } pallet-ocex-runtime-api = { path = "../../pallets/ocex/rpc/runtime-api", default-features = false } +frame-metadata-hash-extension = { workspace = true, default-features = false } [build-dependencies] -substrate-wasm-builder = { workspace = true } +substrate-wasm-builder = { workspace = true , optional = true} +docify = "0.2.8" [features] default = ["std"] +# Enable the metadata hash generation. +# +# This is hidden behind a feature because it increases the compile time. +# The wasm binary needs to be compiled twice, once to fetch the metadata, +# generate the metadata hash and then a second time with the +# `RUNTIME_METADATA_HASH` environment variable set for the `CheckMetadataHash` +# extension. +metadata-hash = [ + "substrate-wasm-builder/metadata-hash" +] + +# A convenience feature for enabling things when doing a build +# for an on-chain release. +on-chain-release-build = ["metadata-hash"] + std = [ + "substrate-wasm-builder", "rust_decimal/std", + "frame-metadata-hash-extension/std", "parity-scale-codec/std", "scale-info/std", "log/std", @@ -177,7 +194,6 @@ std = [ "sp-staking/std", "sp-npos-elections/std", "frame-election-provider-support/std", - #"pallet-randomness-collective-flip/std", "pallet-assets/std", "frame-system-rpc-runtime-api/std", "orml-vesting/std", @@ -202,7 +218,7 @@ std = [ "sp-storage?/std", ] runtime-benchmarks = [ - #theirs +# theirs "sp-storage", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", @@ -258,7 +274,6 @@ try-runtime = [ "pdex-migration/try-runtime", "pallet-democracy/try-runtime", "pallet-preimage/try-runtime", - #"pallet-randomness-collective-flip/try-runtime", "pallet-child-bounties/try-runtime", "pallet-assets/try-runtime", "pallet-ocex-lmp/try-runtime", diff --git a/runtimes/mainnet/build.rs b/runtimes/mainnet/build.rs index 453eebcc8..dd047a83d 100644 --- a/runtimes/mainnet/build.rs +++ b/runtimes/mainnet/build.rs @@ -16,12 +16,20 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use substrate_wasm_builder::WasmBuilder; +#[cfg(all(feature = "std", feature = "metadata-hash"))] +#[docify::export(template_enable_metadata_hash)] +fn main() { + substrate_wasm_builder::WasmBuilder::init_with_defaults() + .enable_metadata_hash("PDEX", 12) + .build(); +} +#[cfg(all(feature = "std", not(feature = "metadata-hash")))] fn main() { - WasmBuilder::new() - .with_current_project() - .import_memory() - .export_heap_base() - .build() + substrate_wasm_builder::WasmBuilder::build_using_defaults(); } + +/// The wasm builder is deactivated when compiling +/// this crate for wasm to speed up the compilation. +#[cfg(not(feature = "std"))] +fn main() {} diff --git a/runtimes/mainnet/src/lib.rs b/runtimes/mainnet/src/lib.rs index 0b21ea717..3c032444f 100644 --- a/runtimes/mainnet/src/lib.rs +++ b/runtimes/mainnet/src/lib.rs @@ -122,7 +122,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 358, + spec_version: 370, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -1019,9 +1019,9 @@ impl pallet_sudo::Config for Runtime { } parameter_types! { - pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); + pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::MAX; /// We prioritize im-online heartbeats over election solution submission. - pub const StakingUnsignedPriority: TransactionPriority = TransactionPriority::max_value() / 2; + pub const StakingUnsignedPriority: TransactionPriority = TransactionPriority::MAX / 2; pub const MaxKeys: u32 = 10_000; pub const MaxPeerInHeartbeats: u32 = 10_000; pub const MaxPeerDataEncodingSize: u32 = 1_000; @@ -1055,6 +1055,7 @@ where frame_system::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), pallet_asset_conversion_tx_payment::ChargeAssetTxPayment::::from(tip, None), + frame_metadata_hash_extension::CheckMetadataHash::new(false), ); let raw_payload = SignedPayload::new(call, extra) .map_err(|e| { @@ -1589,6 +1590,7 @@ pub type SignedExtra = ( frame_system::CheckNonce, frame_system::CheckWeight, pallet_asset_conversion_tx_payment::ChargeAssetTxPayment, + frame_metadata_hash_extension::CheckMetadataHash, ); /// Unchecked extrinsic type as expected by this runtime. diff --git a/runtimes/parachain/src/lib.rs b/runtimes/parachain/src/lib.rs index b457f4874..1fb5ee714 100644 --- a/runtimes/parachain/src/lib.rs +++ b/runtimes/parachain/src/lib.rs @@ -179,7 +179,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("polkadex-parachain"), impl_name: create_runtime_str!("polkadex-parachain"), authoring_version: 1, - spec_version: 14, + spec_version: 16, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1,