Skip to content

Commit

Permalink
Merge branch 'master' into s0me0ne/retire-im-online-part-2
Browse files Browse the repository at this point in the history
  • Loading branch information
s0me0ne-unkn0wn authored Nov 23, 2023
2 parents 8dbcc41 + c29b74d commit 802528f
Show file tree
Hide file tree
Showing 38 changed files with 188 additions and 175 deletions.
13 changes: 7 additions & 6 deletions .gitlab/pipeline/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ check-rust-feature-propagation:
export RUST_LOG=remote-ext=debug,runtime=debug
echo "---------- Downloading try-runtime CLI ----------"
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.3.3/try-runtime-x86_64-unknown-linux-musl -o try-runtime
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
chmod +x ./try-runtime
echo "---------- Building ${PACKAGE} runtime ----------"
time cargo build --release --locked -p "$PACKAGE" --features try-runtime
echo "---------- Executing on-runtime-upgrade for ${NETWORK} ----------"
time ./try-runtime \
time ./try-runtime ${COMMAND_EXTRA_ARGS} \
--runtime ./target/release/wbuild/"$PACKAGE"/"$WASM" \
on-runtime-upgrade --checks=pre-and-post ${EXTRA_ARGS} live --uri ${URI}
on-runtime-upgrade --disable-spec-version-check --checks=all ${SUBCOMMAND_EXTRA_ARGS} live --uri ${URI}
# Check runtime migrations for Parity managed relay chains
check-runtime-migration-westend:
Expand All @@ -124,7 +124,7 @@ check-runtime-migration-westend:
PACKAGE: "westend-runtime"
WASM: "westend_runtime.compact.compressed.wasm"
URI: "wss://westend-try-runtime-node.parity-chains.parity.io:443"
EXTRA_ARGS: "--no-weight-warnings"
SUBCOMMAND_EXTRA_ARGS: "--no-weight-warnings"

check-runtime-migration-rococo:
stage: check
Expand All @@ -137,7 +137,7 @@ check-runtime-migration-rococo:
PACKAGE: "rococo-runtime"
WASM: "rococo_runtime.compact.compressed.wasm"
URI: "wss://rococo-try-runtime-node.parity-chains.parity.io:443"
EXTRA_ARGS: "--no-weight-warnings"
SUBCOMMAND_EXTRA_ARGS: "--no-weight-warnings"

# Check runtime migrations for Parity managed asset hub chains
check-runtime-migration-asset-hub-westend:
Expand All @@ -151,7 +151,7 @@ check-runtime-migration-asset-hub-westend:
PACKAGE: "asset-hub-westend-runtime"
WASM: "asset_hub_westend_runtime.compact.compressed.wasm"
URI: "wss://westend-asset-hub-rpc.polkadot.io:443"

check-runtime-migration-asset-hub-rococo:
stage: check
extends:
Expand Down Expand Up @@ -214,6 +214,7 @@ check-runtime-migration-collectives-westend:
PACKAGE: "collectives-westend-runtime"
WASM: "collectives_westend_runtime.compact.compressed.wasm"
URI: "wss://westend-collectives-rpc.polkadot.io:443"
COMMAND_EXTRA_ARGS: "--disable-spec-name-check"

find-fail-ci-phrase:
stage: check
Expand Down
11 changes: 8 additions & 3 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ use polkadot_primitives::{
};
use sc_authority_discovery::{AuthorityDiscovery, Error as AuthorityDiscoveryError};
use sc_client_api::AuxStore;
use sp_api::{ApiError, BlockT, HeaderT, NumberFor, RuntimeApiInfo};
use sp_api::{ApiError, RuntimeApiInfo};
use sp_blockchain::Info;
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor};

#[derive(Clone)]
pub struct BlockChainRpcClient {
Expand Down
1 change: 1 addition & 0 deletions cumulus/client/relay-chain-rpc-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ sp-authority-discovery = { path = "../../../substrate/primitives/authority-disco
sp-state-machine = { path = "../../../substrate/primitives/state-machine" }
sp-storage = { path = "../../../substrate/primitives/storage" }
sp-runtime = { path = "../../../substrate/primitives/runtime" }
sp-version = { path = "../../../substrate/primitives/version" }
sc-client-api = { path = "../../../substrate/client/api" }
sc-rpc-api = { path = "../../../substrate/client/rpc-api" }
sc-service = { path = "../../../substrate/client/service" }
Expand Down
2 changes: 1 addition & 1 deletion cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ use cumulus_relay_chain_interface::{RelayChainError, RelayChainResult};
use sc_client_api::StorageData;
use sc_rpc_api::{state::ReadProof, system::Health};
use sc_service::TaskManager;
use sp_api::RuntimeVersion;
use sp_consensus_babe::Epoch;
use sp_core::sp_std::collections::btree_map::BTreeMap;
use sp_storage::StorageKey;
use sp_version::RuntimeVersion;

use crate::{
light_client_worker::{build_smoldot_client, LightClientRpcWorker},
Expand Down
2 changes: 1 addition & 1 deletion cumulus/pallets/xcmp-queue/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fn xcm_enqueueing_broken_xcm_works() {
.take(20)
.collect::<Vec<_>>(),
);
EnqueuedMessages::set(&vec![]);
EnqueuedMessages::take();

// But if we do it all in one page, then it only uses the first 10:
XcmpQueue::handle_xcmp_messages(
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub use service::{
ChainSpec, Configuration, Error as SubstrateServiceError, PruningMode, Role, RuntimeGenesis,
TFullBackend, TFullCallExecutor, TFullClient, TaskManager, TransactionPoolOptions,
};
pub use sp_api::{ApiRef, ConstructRuntimeApi, Core as CoreApi, ProvideRuntimeApi, StateBackend};
pub use sp_api::{ApiRef, ConstructRuntimeApi, Core as CoreApi, ProvideRuntimeApi};
pub use sp_runtime::{
generic,
traits::{self as runtime_traits, BlakeTwo256, Block as BlockT, Header as HeaderT, NumberFor},
Expand Down
1 change: 1 addition & 0 deletions polkadot/node/subsystem-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sc-network = { path = "../../../substrate/client/network" }
sp-api = { path = "../../../substrate/primitives/api" }
sp-blockchain = { path = "../../../substrate/primitives/blockchain" }
sp-consensus-babe = { path = "../../../substrate/primitives/consensus/babe" }
sp-runtime = { path = "../../../substrate/primitives/runtime" }
sp-authority-discovery = { path = "../../../substrate/primitives/authority-discovery" }
sc-client-api = { path = "../../../substrate/client/api" }
sc-transaction-pool-api = { path = "../../../substrate/client/transaction-pool/api" }
Expand Down
3 changes: 2 additions & 1 deletion polkadot/node/subsystem-types/src/runtime_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ use polkadot_primitives::{
};
use sc_client_api::HeaderBackend;
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_api::{ApiError, ApiExt, HeaderT, NumberFor, ProvideRuntimeApi};
use sp_api::{ApiError, ApiExt, ProvideRuntimeApi};
use sp_authority_discovery::AuthorityDiscoveryApi;
use sp_blockchain::Info;
use sp_consensus_babe::{BabeApi, Epoch};
use sp_runtime::traits::{Header as HeaderT, NumberFor};
use std::{collections::BTreeMap, sync::Arc};

/// Offers header utilities.
Expand Down
4 changes: 2 additions & 2 deletions substrate/client/api/src/call_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
use sc_executor::{RuntimeVersion, RuntimeVersionOf};
use sp_core::traits::CallContext;
use sp_externalities::Extensions;
use sp_runtime::traits::Block as BlockT;
use sp_runtime::traits::{Block as BlockT, HashingFor};
use sp_state_machine::{OverlayedChanges, StorageProof};
use std::cell::RefCell;

use crate::execution_extensions::ExecutionExtensions;
use sp_api::{HashingFor, ProofRecorder};
use sp_api::ProofRecorder;

/// Executor Provider
pub trait ExecutorProvider<Block: BlockT> {
Expand Down
3 changes: 1 addition & 2 deletions substrate/client/api/src/in_mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,9 +812,8 @@ pub fn check_genesis_storage(storage: &Storage) -> sp_blockchain::Result<()> {
#[cfg(test)]
mod tests {
use crate::{in_mem::Blockchain, NewBlockState};
use sp_api::HeaderT;
use sp_blockchain::Backend;
use sp_runtime::{ConsensusEngineId, Justifications};
use sp_runtime::{traits::Header as HeaderT, ConsensusEngineId, Justifications};
use substrate_test_runtime::{Block, Header, H256};

pub const ID1: ConsensusEngineId = *b"TST1";
Expand Down
4 changes: 2 additions & 2 deletions substrate/client/consensus/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use sc_client_api::{Backend, BlockBackend, BlockchainEvents, FinalityNotificatio
use sc_consensus::BlockImport;
use sc_network::{NetworkRequest, ProtocolName};
use sc_network_gossip::{GossipEngine, Network as GossipNetwork, Syncing as GossipSyncing};
use sp_api::{HeaderT, NumberFor, ProvideRuntimeApi};
use sp_api::ProvideRuntimeApi;
use sp_blockchain::{
Backend as BlockchainBackend, Error as ClientError, HeaderBackend, Result as ClientResult,
};
Expand All @@ -51,7 +51,7 @@ use sp_consensus_beefy::{
};
use sp_keystore::KeystorePtr;
use sp_mmr_primitives::MmrApi;
use sp_runtime::traits::{Block, Zero};
use sp_runtime::traits::{Block, Header as HeaderT, NumberFor, Zero};
use std::{
collections::{BTreeMap, VecDeque},
marker::PhantomData,
Expand Down
7 changes: 3 additions & 4 deletions substrate/client/consensus/beefy/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use log::{debug, error, info, log_enabled, trace, warn};
use sc_client_api::{Backend, FinalityNotification, FinalityNotifications, HeaderBackend};
use sc_network_gossip::GossipEngine;
use sc_utils::{mpsc::TracingUnboundedReceiver, notification::NotificationReceiver};
use sp_api::{BlockId, ProvideRuntimeApi};
use sp_api::ProvideRuntimeApi;
use sp_arithmetic::traits::{AtLeast32Bit, Saturating};
use sp_consensus::SyncOracle;
use sp_consensus_beefy::{
Expand All @@ -46,7 +46,7 @@ use sp_consensus_beefy::{
VersionedFinalityProof, VoteMessage, BEEFY_ENGINE_ID,
};
use sp_runtime::{
generic::OpaqueDigestItemId,
generic::{BlockId, OpaqueDigestItemId},
traits::{Block, Header, NumberFor, Zero},
SaturatedConversion,
};
Expand Down Expand Up @@ -1074,13 +1074,12 @@ pub(crate) mod tests {
use sc_client_api::{Backend as BackendT, HeaderBackend};
use sc_network_sync::SyncingService;
use sc_network_test::TestNetFactory;
use sp_api::HeaderT;
use sp_blockchain::Backend as BlockchainBackendT;
use sp_consensus_beefy::{
generate_equivocation_proof, known_payloads, known_payloads::MMR_ROOT_ID,
mmr::MmrRootProvider, Keyring, Payload, SignedCommitment,
};
use sp_runtime::traits::One;
use sp_runtime::traits::{Header as HeaderT, One};
use substrate_test_runtime_client::{
runtime::{Block, Digest, DigestItem, Header},
Backend,
Expand Down
15 changes: 8 additions & 7 deletions substrate/client/executor/src/wasm_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ mod tests {
use codec::Encode;
use sp_api::{Core, RuntimeApiInfo};
use sp_runtime::RuntimeString;
use sp_version::{create_apis_vec, RuntimeVersion};
use sp_wasm_interface::HostFunctions;
use substrate_test_runtime::Block;

Expand Down Expand Up @@ -470,7 +471,7 @@ mod tests {
authoring_version: 1,
spec_version: 1,
impl_version: 1,
apis: sp_api::create_apis_vec!([(<dyn Core::<Block>>::ID, 1)]),
apis: create_apis_vec!([(<dyn Core::<Block>>::ID, 1)]),
};

let version = decode_version(&old_runtime_version.encode()).unwrap();
Expand All @@ -486,21 +487,21 @@ mod tests {
authoring_version: 1,
spec_version: 1,
impl_version: 1,
apis: sp_api::create_apis_vec!([(<dyn Core::<Block>>::ID, 3)]),
apis: create_apis_vec!([(<dyn Core::<Block>>::ID, 3)]),
};

decode_version(&old_runtime_version.encode()).unwrap_err();
}

#[test]
fn new_runtime_version_decodes() {
let old_runtime_version = sp_api::RuntimeVersion {
let old_runtime_version = RuntimeVersion {
spec_name: "test".into(),
impl_name: "test".into(),
authoring_version: 1,
spec_version: 1,
impl_version: 1,
apis: sp_api::create_apis_vec!([(<dyn Core::<Block>>::ID, 3)]),
apis: create_apis_vec!([(<dyn Core::<Block>>::ID, 3)]),
transaction_version: 3,
state_version: 4,
};
Expand All @@ -509,13 +510,13 @@ mod tests {
assert_eq!(3, version.transaction_version);
assert_eq!(0, version.state_version);

let old_runtime_version = sp_api::RuntimeVersion {
let old_runtime_version = RuntimeVersion {
spec_name: "test".into(),
impl_name: "test".into(),
authoring_version: 1,
spec_version: 1,
impl_version: 1,
apis: sp_api::create_apis_vec!([(<dyn Core::<Block>>::ID, 4)]),
apis: create_apis_vec!([(<dyn Core::<Block>>::ID, 4)]),
transaction_version: 3,
state_version: 4,
};
Expand All @@ -538,7 +539,7 @@ mod tests {
authoring_version: 100,
spec_version: 100,
impl_version: 100,
apis: sp_api::create_apis_vec!([(<dyn Core::<Block>>::ID, 4)]),
apis: create_apis_vec!([(<dyn Core::<Block>>::ID, 4)]),
transaction_version: 100,
state_version: 1,
};
Expand Down
4 changes: 2 additions & 2 deletions substrate/client/merkle-mountain-range/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ use jsonrpsee::{
};
use serde::{Deserialize, Serialize};

use sp_api::{ApiExt, NumberFor, ProvideRuntimeApi};
use sp_api::{ApiExt, ProvideRuntimeApi};
use sp_blockchain::HeaderBackend;
use sp_core::{
offchain::{storage::OffchainDb, OffchainDbExt, OffchainStorage},
Bytes,
};
use sp_mmr_primitives::{Error as MmrError, Proof};
use sp_runtime::traits::Block as BlockT;
use sp_runtime::traits::{Block as BlockT, NumberFor};

pub use sp_mmr_primitives::MmrApi as MmrRuntimeApi;

Expand Down
2 changes: 2 additions & 0 deletions substrate/client/rpc-spec-v2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ tokio = { version = "1.22.0", features = ["sync"] }
array-bytes = "6.1"
log = "0.4.17"
futures-util = { version = "0.3.19", default-features = false }

[dev-dependencies]
serde_json = "1.0.108"
tokio = { version = "1.22.0", features = ["macros"] }
substrate-test-runtime-client = { path = "../../test-utils/runtime/client" }
substrate-test-runtime = { path = "../../test-utils/runtime" }
sp-consensus = { path = "../../primitives/consensus/common" }
sp-externalities = { path = "../../primitives/externalities" }
sp-maybe-compressed-blob = { path = "../../primitives/maybe-compressed-blob" }
sc-block-builder = { path = "../block-builder" }
sc-service = { path = "../service", features = ["test-helpers"]}
Expand Down
4 changes: 2 additions & 2 deletions substrate/client/rpc-spec-v2/src/archive/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ use jsonrpsee::core::{async_trait, RpcResult};
use sc_client_api::{
Backend, BlockBackend, BlockchainEvents, CallExecutor, ExecutorProvider, StorageProvider,
};
use sp_api::{CallApiAt, CallContext, NumberFor};
use sp_api::{CallApiAt, CallContext};
use sp_blockchain::{
Backend as BlockChainBackend, Error as BlockChainError, HeaderBackend, HeaderMetadata,
};
use sp_core::Bytes;
use sp_runtime::{
traits::{Block as BlockT, Header as HeaderT},
traits::{Block as BlockT, Header as HeaderT, NumberFor},
SaturatedConversion,
};
use std::{collections::HashSet, marker::PhantomData, sync::Arc};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use std::{collections::VecDeque, marker::PhantomData, sync::Arc};

use sc_client_api::{Backend, ChildInfo, StorageKey, StorageProvider};
use sc_utils::mpsc::TracingUnboundedSender;
use sp_api::BlockT;
use sp_core::storage::well_known_keys;
use sp_runtime::traits::Block as BlockT;

use crate::chain_head::event::OperationStorageItems;

Expand Down
Loading

0 comments on commit 802528f

Please sign in to comment.