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

Update polkadot-sdk to stable2407 #52

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3,948 changes: 1,862 additions & 2,086 deletions Cargo.lock

Large diffs are not rendered by default.

283 changes: 141 additions & 142 deletions Cargo.toml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions client/consensus/nimbus-consensus/src/import_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ where
CIDP: CreateInherentDataProviders<Block, ()>,
{
async fn verify(
&mut self,
&self,
mut block_params: BlockImportParams<Block>,
) -> Result<BlockImportParams<Block>, String> {
// Skip checks that include execution, if being told so or when importing only state.
Expand Down Expand Up @@ -251,12 +251,12 @@ impl<I> NimbusBlockImport<I> {
impl<Block, I> BlockImport<Block> for NimbusBlockImport<I>
where
Block: BlockT,
I: BlockImport<Block> + Send,
I: BlockImport<Block> + Send + Sync,
{
type Error = I::Error;

async fn check_block(
&mut self,
&self,
block: sc_consensus::BlockCheckParams<Block>,
) -> Result<sc_consensus::ImportResult, Self::Error> {
self.inner.check_block(block).await
Expand Down
2 changes: 1 addition & 1 deletion pallets/async-backing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
version = "0.9.0"

[dependencies]
cumulus-pallet-parachain-system = { workspace = true, features = [ "parameterized-consensus-hook" ] }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-primitives-core = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion pallets/emergency-para-xcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sp-std = { workspace = true }

# Cumulus
cumulus-primitives-core = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true, features = ["parameterized-consensus-hook"] }
cumulus-pallet-parachain-system = { workspace = true }

# Polkadot
polkadot-parachain-primitives = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions precompiles/balances-erc20/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ fn transfer() {
value: 400.into(),
},
)
.expect_cost(176215756) // 1 weight => 1 gas in mock
.expect_cost(173364756) // 1 weight => 1 gas in mock
.expect_log(log3(
Precompile1,
SELECTOR_LOG_TRANSFER,
Expand Down Expand Up @@ -370,7 +370,7 @@ fn transfer_from() {
value: 400.into(),
},
)
.expect_cost(176215756) // 1 weight => 1 gas in mock
.expect_cost(173364756) // 1 weight => 1 gas in mock
.expect_log(log3(
Precompile1,
SELECTOR_LOG_TRANSFER,
Expand Down Expand Up @@ -466,7 +466,7 @@ fn transfer_from_self() {
value: 400.into(),
},
)
.expect_cost(176215756) // 1 weight => 1 gas in mock
.expect_cost(173364756) // 1 weight => 1 gas in mock
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had to change this value because these tests failed, I don't know if this will break anything

.expect_log(log3(
Precompile1,
SELECTOR_LOG_TRANSFER,
Expand Down
1 change: 1 addition & 0 deletions precompiles/pallet-xcm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ impl xcm_executor::Config for XcmConfig {
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
type XcmRecorder = PolkadotXcm;
}

pub fn root_origin() -> <Runtime as frame_system::Config>::RuntimeOrigin {
Expand Down
1 change: 1 addition & 0 deletions precompiles/xcm-utils/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ impl xcm_executor::Config for XcmConfig {
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
type XcmRecorder = PolkadotXcm;
}

pub(crate) struct ExtBuilder {
Expand Down
3 changes: 1 addition & 2 deletions template/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use sp_core::{sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
sc_service::GenericChainSpec<moonkit_template_runtime::RuntimeGenesisConfig, Extensions>;
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;

/// Helper function to generate a crypto pair from seed
pub fn get_pair_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
Expand Down
12 changes: 6 additions & 6 deletions template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ where
crate::rpc::create_full(deps).map_err(Into::into)
})
};
let para_id = crate::chain_spec::Extensions::try_get(&*config.chain_spec)
.map(|e| e.para_id)
.ok_or_else(|| "Could not find parachain ID in chain-spec.")?;

sc_service::spawn_tasks(sc_service::SpawnTasksParams {
network,
Expand Down Expand Up @@ -555,18 +558,15 @@ where
let mocked_parachain = MockValidationDataInherentDataProvider {
additional_key_values: None,
current_para_block: 0,
current_para_block_head: None,
relay_offset: 0,
relay_blocks_per_para_block: 0,
para_blocks_per_relay_epoch: 0,
relay_randomness_config: (),
xcm_config: MockXcmConfig::new(
&*client_for_xcm,
block,
Default::default(),
Default::default(),
),
xcm_config: MockXcmConfig::new(&*client_for_xcm, block, Default::default()),
raw_downward_messages: downward_xcm_receiver.drain().collect(),
raw_horizontal_messages: hrmp_xcm_receiver.drain().collect(),
para_id: para_id.into(),
};

Ok((time, mocked_parachain))
Expand Down
2 changes: 1 addition & 1 deletion template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ staging-xcm-builder = { workspace = true }
staging-xcm-executor = { workspace = true }

# Cumulus dependencies
cumulus-pallet-parachain-system = { workspace = true, features = [ "parameterized-consensus-hook" ] }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-primitives-core = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ impl Config for XcmConfig {
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
type XcmRecorder = PolkadotXcm;
}

/// No local origins on this chain are allowed to dispatch XCM sends/executions.
Expand Down Expand Up @@ -612,6 +613,8 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type WeightInfo = ();
type PriceForSiblingDelivery = NoPriceForMessageDelivery<ParaId>;
type MaxActiveOutboundChannels = ConstU32<128>;
type MaxPageSize = ConstU32<{ 103 * 1024 }>;
}

parameter_types! {
Expand Down
Loading