Skip to content

Commit 552ab02

Browse files
acatangiuserban300
andauthored
bump substrate+polkadot refs and fix builds (paritytech#1989)
* bump refs and fix build * more fixes * Fix rialto-parachain node * Update dependencies for tools/runtime-codegen * Regenerate rialto-parachain indirect runtime * Fix register_parachain * Fix clippy * Undo clippy allow --------- Co-authored-by: Serban Iorga <[email protected]>
1 parent 2b0fba7 commit 552ab02

21 files changed

Lines changed: 998 additions & 575 deletions

File tree

bin/millau/node/src/service.rs

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use sc_client_api::BlockBackend;
2222
use sc_consensus_aura::{CompatibilityMode, ImportQueueParams, SlotProportion, StartAuraParams};
2323
use sc_consensus_grandpa::SharedVoterState;
2424
pub use sc_executor::NativeElseWasmExecutor;
25-
use sc_keystore::LocalKeystore;
2625
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
2726
use sc_telemetry::{Telemetry, TelemetryWorker};
2827
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
@@ -78,10 +77,6 @@ pub fn new_partial(
7877
>,
7978
ServiceError,
8079
> {
81-
if config.keystore_remote.is_some() {
82-
return Err(ServiceError::Other("Remote Keystores are not supported.".into()))
83-
}
84-
8580
let telemetry = config
8681
.telemetry_endpoints
8782
.clone()
@@ -175,13 +170,6 @@ pub fn new_partial(
175170
})
176171
}
177172

178-
fn remote_keystore(_url: &str) -> Result<Arc<LocalKeystore>, &'static str> {
179-
// FIXME: here would the concrete keystore be built,
180-
// must return a concrete type (NOT `LocalKeystore`) that
181-
// implements `CryptoStore` and `SyncCryptoStore`
182-
Err("Remote Keystore not supported.")
183-
}
184-
185173
/// Builds a new service for a full client.
186174
pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError> {
187175
use sc_network_common::sync::warp::WarpSyncParams;
@@ -191,22 +179,12 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
191179
backend,
192180
mut task_manager,
193181
import_queue,
194-
mut keystore_container,
182+
keystore_container,
195183
select_chain,
196184
transaction_pool,
197185
other: (block_import, grandpa_link, beefy_voter_links, beefy_rpc_links, mut telemetry),
198186
} = new_partial(&config)?;
199187

200-
if let Some(url) = &config.keystore_remote {
201-
match remote_keystore(url) {
202-
Ok(k) => keystore_container.set_remote_keystore(k),
203-
Err(e) =>
204-
return Err(ServiceError::Other(format!(
205-
"Error hooking up remote keystore for {url}: {e}"
206-
))),
207-
};
208-
}
209-
210188
let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
211189

212190
// Note: GrandPa is pushed before the Polkadot-specific protocols. This doesn't change
@@ -332,7 +310,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
332310
let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
333311
network: network.clone(),
334312
client: client.clone(),
335-
keystore: keystore_container.sync_keystore(),
313+
keystore: keystore_container.keystore(),
336314
task_manager: &mut task_manager,
337315
transaction_pool: transaction_pool.clone(),
338316
sync_service: sync_service.clone(),
@@ -375,7 +353,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
375353
},
376354
force_authoring,
377355
backoff_authoring_blocks,
378-
keystore: keystore_container.sync_keystore(),
356+
keystore: keystore_container.keystore(),
379357
sync_oracle: sync_service.clone(),
380358
justification_sync_link: sync_service.clone(),
381359
block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32),
@@ -394,8 +372,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
394372

395373
// if the node isn't actively participating in consensus then it doesn't
396374
// need a keystore, regardless of which protocol we use below.
397-
let keystore =
398-
if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None };
375+
let keystore = if role.is_authority() { Some(keystore_container.keystore()) } else { None };
399376

400377
let justifications_protocol_name = beefy_on_demand_justifications_handler.protocol_name();
401378
let payload_provider = sp_consensus_beefy::mmr::MmrRootProvider::new(client.clone());

bin/millau/runtime/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ impl pallet_balances::Config for Runtime {
331331
type MaxLocks = ConstU32<50>;
332332
type MaxReserves = ConstU32<50>;
333333
type ReserveIdentifier = [u8; 8];
334+
type HoldIdentifier = ();
335+
type FreezeIdentifier = ();
336+
type MaxHolds = ConstU32<0>;
337+
type MaxFreezes = ConstU32<0>;
334338
}
335339

336340
parameter_types! {
@@ -655,6 +659,14 @@ impl_runtime_apis! {
655659
fn metadata() -> OpaqueMetadata {
656660
OpaqueMetadata::new(Runtime::metadata().into())
657661
}
662+
663+
fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> {
664+
Runtime::metadata_at_version(version)
665+
}
666+
667+
fn metadata_versions() -> sp_std::vec::Vec<u32> {
668+
Runtime::metadata_versions()
669+
}
658670
}
659671

660672
impl sp_block_builder::BlockBuilder<Block> for Runtime {

bin/millau/runtime/src/xcm_config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use frame_support::{
2828
traits::{ConstU32, Everything, Nothing},
2929
weights::Weight,
3030
};
31+
use frame_system::EnsureRoot;
3132
use xcm::latest::prelude::*;
3233
use xcm_builder::{
3334
AccountId32Aliases, CurrencyAdapter as XcmCurrencyAdapter, IsConcrete, MintLocation,
@@ -186,6 +187,7 @@ impl pallet_xcm::Config for Runtime {
186187
type WeightInfo = pallet_xcm::TestWeightInfo;
187188
#[cfg(feature = "runtime-benchmarks")]
188189
type ReachableDest = ReachableDest;
190+
type AdminOrigin = EnsureRoot<AccountId>;
189191
}
190192

191193
pub struct ToRialtoOrRialtoParachainSwitchExporter;

bin/rialto-parachain/node/src/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ pub fn run() -> Result<()> {
286286
let id = ParaId::from(cli.parachain_id.or(para_id).expect("Missing ParaId"));
287287

288288
let parachain_account =
289-
AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account_truncating(&id);
289+
AccountIdConversion::<polkadot_primitives::v4::AccountId>::into_account_truncating(&id);
290290

291291
let state_version =
292292
RelayChainCli::native_runtime_version(&config.chain_spec).state_version();

bin/rialto-parachain/node/src/service.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use sc_network_sync::SyncingService;
4747
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
4848
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
4949
use sp_api::ConstructRuntimeApi;
50-
use sp_keystore::SyncCryptoStorePtr;
50+
use sp_keystore::KeystorePtr;
5151
use sp_runtime::traits::BlakeTwo256;
5252
use substrate_prometheus_endpoint::Registry;
5353

@@ -237,7 +237,7 @@ where
237237
Arc<dyn RelayChainInterface>,
238238
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
239239
Arc<SyncingService<Block>>,
240-
SyncCryptoStorePtr,
240+
KeystorePtr,
241241
bool,
242242
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
243243
{
@@ -294,7 +294,7 @@ where
294294
transaction_pool: transaction_pool.clone(),
295295
task_manager: &mut task_manager,
296296
config: parachain_config,
297-
keystore: params.keystore_container.sync_keystore(),
297+
keystore: params.keystore_container.keystore(),
298298
backend: backend.clone(),
299299
network: network.clone(),
300300
sync_service: sync_service.clone(),
@@ -324,7 +324,7 @@ where
324324
relay_chain_interface.clone(),
325325
transaction_pool,
326326
sync_service,
327-
params.keystore_container.sync_keystore(),
327+
params.keystore_container.keystore(),
328328
force_authoring,
329329
)?;
330330

bin/rialto-parachain/runtime/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ impl pallet_balances::Config for Runtime {
304304
type MaxLocks = ConstU32<50>;
305305
type MaxReserves = ConstU32<50>;
306306
type ReserveIdentifier = [u8; 8];
307+
type HoldIdentifier = ();
308+
type FreezeIdentifier = ();
309+
type MaxHolds = ConstU32<0>;
310+
type MaxFreezes = ConstU32<0>;
307311
}
308312

309313
impl pallet_transaction_payment::Config for Runtime {
@@ -492,6 +496,7 @@ impl pallet_xcm::Config for Runtime {
492496
type WeightInfo = pallet_xcm::TestWeightInfo;
493497
#[cfg(feature = "runtime-benchmarks")]
494498
type ReachableDest = ReachableDest;
499+
type AdminOrigin = frame_system::EnsureRoot<AccountId>;
495500
}
496501

497502
impl cumulus_pallet_xcm::Config for Runtime {
@@ -637,6 +642,14 @@ impl_runtime_apis! {
637642
fn metadata() -> OpaqueMetadata {
638643
OpaqueMetadata::new(Runtime::metadata().into())
639644
}
645+
646+
fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> {
647+
Runtime::metadata_at_version(version)
648+
}
649+
650+
fn metadata_versions() -> sp_std::vec::Vec<u32> {
651+
Runtime::metadata_versions()
652+
}
640653
}
641654

642655
impl sp_block_builder::BlockBuilder<Block> for Runtime {

bin/rialto/node/src/chain_spec.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
1616

1717
use frame_support::weights::Weight;
18-
use polkadot_primitives::v2::{AssignmentId, ValidatorId};
18+
use polkadot_primitives::v4::{AssignmentId, ValidatorId};
1919
use rialto_runtime::{
2020
AccountId, BabeConfig, BalancesConfig, BeefyConfig, BridgeMillauMessagesConfig,
2121
ConfigurationConfig, GenesisConfig, GrandpaConfig, SessionConfig, SessionKeys, Signature,
@@ -244,8 +244,8 @@ fn testnet_genesis(
244244
validation_upgrade_cooldown: 2u32,
245245
validation_upgrade_delay: 2,
246246
code_retention_period: 1200,
247-
max_code_size: polkadot_primitives::v2::MAX_CODE_SIZE,
248-
max_pov_size: polkadot_primitives::v2::MAX_POV_SIZE,
247+
max_code_size: polkadot_primitives::v4::MAX_CODE_SIZE,
248+
max_pov_size: polkadot_primitives::v4::MAX_POV_SIZE,
249249
max_head_data_size: 32 * 1024,
250250
group_rotation_frequency: 20,
251251
chain_availability_period: 4,
@@ -255,7 +255,7 @@ fn testnet_genesis(
255255
max_downward_message_size: 1024 * 1024,
256256
ump_service_total_weight: Weight::from_parts(
257257
100_000_000_000,
258-
polkadot_primitives::v2::MAX_POV_SIZE as u64,
258+
polkadot_primitives::v4::MAX_POV_SIZE as u64,
259259
),
260260
max_upward_message_size: 50 * 1024,
261261
max_upward_message_num_per_candidate: 5,

0 commit comments

Comments
 (0)