git.delta.rocks / unique-network / refs/commits / 955f1bd67788

difftreelog

fix node for release

Yaroslav Bolyukin2024-06-24parents: #efce288 #5a77207.patch.diff
in: master

5 files changed

modifiedCargo.lockdiffbeforeafterboth
63046304
6305[[package]]6305[[package]]
6306name = "opal-runtime"6306name = "opal-runtime"
6307version = "1.3.0"6307version = "1.9.0"
6308dependencies = [6308dependencies = [
6309 "app-promotion-rpc",6309 "app-promotion-rpc",
6310 "cumulus-pallet-aura-ext",6310 "cumulus-pallet-aura-ext",
1018810188
10189[[package]]10189[[package]]
10190name = "quartz-runtime"10190name = "quartz-runtime"
10191version = "1.3.0"10191version = "1.9.0"
10192dependencies = [10192dependencies = [
10193 "app-promotion-rpc",10193 "app-promotion-rpc",
10194 "cumulus-pallet-aura-ext",10194 "cumulus-pallet-aura-ext",
1497614976
14977[[package]]14977[[package]]
14978name = "unique-node"14978name = "unique-node"
14979version = "1.3.0"14979version = "1.9.0"
14980dependencies = [14980dependencies = [
14981 "app-promotion-rpc",14981 "app-promotion-rpc",
14982 "clap",14982 "clap",
1506315063
15064[[package]]15064[[package]]
15065name = "unique-runtime"15065name = "unique-runtime"
15066version = "1.3.0"15066version = "1.9.0"
15067dependencies = [15067dependencies = [
15068 "app-promotion-rpc",15068 "app-promotion-rpc",
15069 "cumulus-pallet-aura-ext",15069 "cumulus-pallet-aura-ext",
1521015210
15211[[package]]15211[[package]]
15212name = "up-common"15212name = "up-common"
15213version = "1.3.0"15213version = "1.9.0"
15214dependencies = [15214dependencies = [
15215 "cumulus-primitives-core",15215 "cumulus-primitives-core",
15216 "fp-rpc",15216 "fp-rpc",
modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
185 .collect::<Vec<_>>(),185 .collect::<Vec<_>>(),
186 },186 },
187187
188 "session": {188 // We don't have Session pallet in production anywhere,
189 "keys": invulnerables.into_iter()189 // Adding this config makes baedeker think we have pallet-session, and it tries to
190 .map(|name| {190 // reconfigure chain using it, which makes no sense, because then aura knows no
191 let account = get_account_id_from_seed::<sr25519::Public>(name);191 // authority, as baedeker expects them to be configured by session pallet.
192 let aura = get_from_seed::<AuraId>(name);192 // "session": {
193193 // "keys": invulnerables.into_iter()
194 (194 // .map(|name| {
195 // let account = get_account_id_from_seed::<sr25519::Public>(name);
196 // let aura = get_from_seed::<AuraId>(name);
197 //
198 // (
195 /* account id: */ account.clone(),199 // /* account id: */ account.clone(),
196 /* validator id: */ account,200 // /* validator id: */ account,
197 /* session keys: */ SessionKeys { aura },201 // /* session keys: */ SessionKeys { aura },
198 )202 // )
199 })203 // })
200 .collect::<Vec<_>>()204 // .collect::<Vec<_>>()
201 },205 // },
202206
203 "sudo": {207 "sudo": {
204 "key": get_account_id_from_seed::<sr25519::Public>("Alice"),208 "key": get_account_id_from_seed::<sr25519::Public>("Alice"),
modifiednode/cli/src/rpc.rsdiffbeforeafterboth
43type FullBackend = sc_service::TFullBackend<Block>;43type FullBackend = sc_service::TFullBackend<Block>;
4444
45/// Full client dependencies.45/// Full client dependencies.
46pub struct FullDeps<C, P, SC> {46pub struct FullDeps<C, P> {
47 /// The client instance to use.47 /// The client instance to use.
48 pub client: Arc<C>,48 pub client: Arc<C>,
49 /// Transaction pool instance.49 /// Transaction pool instance.
50 pub pool: Arc<P>,50 pub pool: Arc<P>,
51 /// The SelectChain Strategy
52 pub select_chain: SC,
53 /// Whether to deny unsafe calls51 /// Whether to deny unsafe calls
54 pub deny_unsafe: DenyUnsafe,52 pub deny_unsafe: DenyUnsafe,
55
56 /// Runtime identification (read from the chain spec)
57 pub runtime_id: RuntimeId,
58 /// Executor params for PoV estimating53 /// Executor params for PoV estimating
59 #[cfg(feature = "pov-estimate")]54 #[cfg(feature = "pov-estimate")]
60 pub exec_params: uc_rpc::pov_estimate::ExecutorParams,55 pub exec_params: uc_rpc::pov_estimate::ExecutorParams,
64}59}
6560
66/// Instantiate all Full RPC extensions.61/// Instantiate all Full RPC extensions.
67pub fn create_full<C, P, SC, R, B>(62pub fn create_full<C, P, R, B>(
68 io: &mut RpcModule<()>,63 io: &mut RpcModule<()>,
69 deps: FullDeps<C, P, SC>,64 deps: FullDeps<C, P>,
70) -> Result<(), Box<dyn std::error::Error + Send + Sync>>65) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
71where66where
72 C: ProvideRuntimeApi<Block> + StorageProvider<Block, B> + AuxStore,67 C: ProvideRuntimeApi<Block> + StorageProvider<Block, B> + AuxStore,
93 let FullDeps {88 let FullDeps {
94 client,89 client,
95 pool,90 pool,
96 select_chain: _,
97 deny_unsafe,91 deny_unsafe,
98
99 runtime_id: _,
10092
101 #[cfg(feature = "pov-estimate")]93 #[cfg(feature = "pov-estimate")]
102 exec_params,94 exec_params,
modifiednode/cli/src/service.rsdiffbeforeafterboth
37use cumulus_client_consensus_proposer::Proposer;37use cumulus_client_consensus_proposer::Proposer;
38use cumulus_client_service::{38use cumulus_client_service::{
39 build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks, DARecoveryProfile,39 build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks,
40 StartRelayChainTasksParams,40 CollatorSybilResistance, DARecoveryProfile, StartRelayChainTasksParams,
41};41};
42use cumulus_primitives_core::ParaId;42use cumulus_primitives_core::ParaId;
43use cumulus_primitives_parachain_inherent::ParachainInherentData;43use cumulus_primitives_parachain_inherent::ParachainInherentData;
85use cumulus_primitives_core::PersistedValidationData;85use cumulus_primitives_core::PersistedValidationData;
86use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;86use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
8787
88use crate::{88use crate::rpc::{create_eth, create_full, EthDeps, FullDeps};
89 chain_spec::RuntimeIdentification,
90 rpc::{create_eth, create_full, EthDeps, FullDeps},
91};
9289
93/// Unique native executor instance.90/// Unique native executor instance.
94#[cfg(feature = "unique-runtime")]91#[cfg(feature = "unique-runtime")]
238 pub trait LookaheadApiDep: cumulus_primitives_aura::AuraUnincludedSegmentApi<Block> {}235 pub trait LookaheadApiDep: cumulus_primitives_aura::AuraUnincludedSegmentApi<Block> {}
239);236);
240237
241fn ethereum_parachain_inherent() -> ParachainInherentData {238fn ethereum_parachain_inherent() -> (sp_timestamp::InherentDataProvider, ParachainInherentData) {
242 let (relay_parent_storage_root, relay_chain_state) =239 let (relay_parent_storage_root, relay_chain_state) =
243 RelayStateSproofBuilder::default().into_state_root_and_proof();240 RelayStateSproofBuilder::default().into_state_root_and_proof();
244 let vfp = PersistedValidationData {241 let vfp = PersistedValidationData {
249 ..Default::default()246 ..Default::default()
250 };247 };
251248
249 (
250 sp_timestamp::InherentDataProvider::from_system_time(),
252 ParachainInherentData {251 ParachainInherentData {
253 validation_data: vfp,252 validation_data: vfp,
254 relay_chain_state,253 relay_chain_state,
255 downward_messages: Default::default(),254 downward_messages: Default::default(),
256 horizontal_messages: Default::default(),255 horizontal_messages: Default::default(),
257 }256 },
257 )
258}258}
259259
260/// Starts a `ServiceBuilder` for a full service.260/// Starts a `ServiceBuilder` for a full service.
426 .await426 .await
427 .map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;427 .map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
428
429 // Aura is sybil-resistant, collator-selection is generally too.
430 let block_announce_validator =
431 cumulus_client_network::AssumeSybilResistance::allow_seconded_messages();
432428
433 let validator = parachain_config.role.is_authority();429 let validator = parachain_config.role.is_authority();
434 let prometheus_registry = parachain_config.prometheus_registry().cloned();430 let prometheus_registry = parachain_config.prometheus_registry().cloned();
435 let transaction_pool = params.transaction_pool.clone();431 let transaction_pool = params.transaction_pool.clone();
436 let import_queue_service = params.import_queue.service();432 let import_queue_service = params.import_queue.service();
437433
438 let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =434 let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
439 sc_service::build_network(sc_service::BuildNetworkParams {435 cumulus_client_service::build_network(cumulus_client_service::BuildNetworkParams {
440 config: &parachain_config,436 parachain_config: &parachain_config,
441 net_config,437 net_config,
442 client: client.clone(),438 client: client.clone(),
443 transaction_pool: transaction_pool.clone(),439 transaction_pool: transaction_pool.clone(),
440 para_id,
444 spawn_handle: task_manager.spawn_handle(),441 spawn_handle: task_manager.spawn_handle(),
442 relay_chain_interface: relay_chain_interface.clone(),
445 import_queue: params.import_queue,443 import_queue: params.import_queue,
444 // Aura is sybil-resistant, collator-selection is generally too.
446 block_announce_validator_builder: Some(Box::new(|_| {445 sybil_resistance_level: CollatorSybilResistance::Resistant,
447 Box::new(block_announce_validator)
448 })),
449 warp_sync_params: None,
450 block_relay: None,
451 })?;446 })
452447 .await?;
453 let select_chain = params.select_chain.clone();
454
455 let runtime_id = parachain_config.chain_spec.runtime_id();
456448
457 // Frontier449 // Frontier
458 let fee_history_cache: FeeHistoryCache = Arc::new(Mutex::new(BTreeMap::new()));450 let fee_history_cache: FeeHistoryCache = Arc::new(Mutex::new(BTreeMap::new()));
505 fee_history_cache,497 fee_history_cache,
506 eth_block_data_cache,498 eth_block_data_cache,
507 network,499 network,
508 runtime_id,
509 transaction_pool,500 transaction_pool,
510 select_chain,
511 overrides,501 overrides,
512 );502 );
513503
518508
519 let full_deps = FullDeps {509 let full_deps = FullDeps {
520 client: client.clone(),510 client: client.clone(),
521 runtime_id,
522511
523 #[cfg(feature = "pov-estimate")]512 #[cfg(feature = "pov-estimate")]
524 exec_params: uc_rpc::pov_estimate::ExecutorParams {513 exec_params: uc_rpc::pov_estimate::ExecutorParams {
533522
534 deny_unsafe,523 deny_unsafe,
535 pool: transaction_pool.clone(),524 pool: transaction_pool.clone(),
536 select_chain,
537 };525 };
538526
539 create_full::<_, _, _, Runtime, _>(&mut rpc_handle, full_deps)?;527 create_full::<_, _, Runtime, _>(&mut rpc_handle, full_deps)?;
540528
541 let eth_deps = EthDeps {529 let eth_deps = EthDeps {
542 client,530 client,
557 overrides,545 overrides,
558 sync: sync_service.clone(),546 sync: sync_service.clone(),
559 pending_create_inherent_data_providers: |_, ()| async move {547 pending_create_inherent_data_providers: |_, ()| async move {
560 Ok((ethereum_parachain_inherent(),))548 Ok(ethereum_parachain_inherent())
561 },549 },
562 };550 };
563551
1041 #[cfg(feature = "pov-estimate")]1029 #[cfg(feature = "pov-estimate")]
1042 let rpc_backend = backend.clone();1030 let rpc_backend = backend.clone();
1043
1044 let runtime_id = config.chain_spec.runtime_id();
10451031
1046 // Frontier1032 // Frontier
1047 let fee_history_cache: FeeHistoryCache = Arc::new(Mutex::new(BTreeMap::new()));1033 let fee_history_cache: FeeHistoryCache = Arc::new(Mutex::new(BTreeMap::new()));
1094 fee_history_cache,1080 fee_history_cache,
1095 eth_block_data_cache,1081 eth_block_data_cache,
1096 network,1082 network,
1097 runtime_id,
1098 transaction_pool,1083 transaction_pool,
1099 select_chain,
1100 overrides,1084 overrides,
1101 );1085 );
11021086
1106 let mut rpc_module = RpcModule::new(());1090 let mut rpc_module = RpcModule::new(());
11071091
1108 let full_deps = FullDeps {1092 let full_deps = FullDeps {
1109 runtime_id,
1110
1111 #[cfg(feature = "pov-estimate")]1093 #[cfg(feature = "pov-estimate")]
1112 exec_params: uc_rpc::pov_estimate::ExecutorParams {1094 exec_params: uc_rpc::pov_estimate::ExecutorParams {
1122 deny_unsafe,1104 deny_unsafe,
1123 client: client.clone(),1105 client: client.clone(),
1124 pool: transaction_pool.clone(),1106 pool: transaction_pool.clone(),
1125 select_chain,
1126 };1107 };
11271108
1128 create_full::<_, _, _, Runtime, _>(&mut rpc_module, full_deps)?;1109 create_full::<_, _, Runtime, _>(&mut rpc_module, full_deps)?;
11291110
1130 let eth_deps = EthDeps {1111 let eth_deps = EthDeps {
1131 client,1112 client,
1147 sync: sync_service.clone(),1128 sync: sync_service.clone(),
1148 // We don't have any inherents except parachain built-ins, which we can't even extract from inside `run_aura`.1129 // We don't have any inherents except parachain built-ins, which we can't even extract from inside `run_aura`.
1149 pending_create_inherent_data_providers: |_, ()| async move {1130 pending_create_inherent_data_providers: |_, ()| async move {
1150 Ok((ethereum_parachain_inherent(),))1131 Ok(ethereum_parachain_inherent())
1151 },1132 },
1152 };1133 };
11531134
modifiedruntime/common/config/substrate.rsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17use frame_support::{17use frame_support::{
18 derive_impl,
18 dispatch::DispatchClass,19 dispatch::DispatchClass,
19 ord_parameter_types, parameter_types,20 ord_parameter_types, parameter_types,
20 traits::{21 traits::{
4243
43use crate::{44use crate::{
44 runtime_common::DealWithFees, Balances, Block, OriginCaller, PalletInfo, Runtime, RuntimeCall,45 runtime_common::DealWithFees, Balances, Block, OriginCaller, PalletInfo, Runtime, RuntimeCall,
45 RuntimeEvent, RuntimeFreezeReason, RuntimeHoldReason, RuntimeOrigin, SS58Prefix, System,46 RuntimeEvent, RuntimeFreezeReason, RuntimeHoldReason, RuntimeOrigin, RuntimeTask, SS58Prefix,
46 Treasury, Version,47 System, Treasury, Version,
47};48};
4849
72 .build_or_panic();73 .build_or_panic();
73}74}
7475
76#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)]
75impl frame_system::Config for Runtime {77impl frame_system::Config for Runtime {
76 /// The data to be stored in an account.78 /// The data to be stored in an account.
77 type AccountData = pallet_balances::AccountData<Balance>;79 type AccountData = pallet_balances::AccountData<Balance>;
78 /// The identifier used to distinguish between accounts.80 /// The identifier used to distinguish between accounts.
79 type AccountId = AccountId;81 type AccountId = AccountId;
80 /// The basic call filter to use in dispatchable.
81 type BaseCallFilter = Everything;
82 /// Maximum number of block number to block hash mappings to keep (oldest pruned first).82 /// Maximum number of block number to block hash mappings to keep (oldest pruned first).
83 type BlockHashCount = BlockHashCount;83 type BlockHashCount = BlockHashCount;
84 /// The block type.84 /// The block type.
87 type BlockLength = RuntimeBlockLength;87 type BlockLength = RuntimeBlockLength;
88 /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.88 /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.
89 type BlockWeights = RuntimeBlockWeights;89 type BlockWeights = RuntimeBlockWeights;
90 /// The aggregated dispatch type that is available for extrinsics.
91 type RuntimeCall = RuntimeCall;
92 /// The weight of database operations that the runtime can invoke.90 /// The weight of database operations that the runtime can invoke.
93 type DbWeight = RocksDbWeight;91 type DbWeight = RocksDbWeight;
94 /// The ubiquitous event type.
95 type RuntimeEvent = RuntimeEvent;
96 /// The type for hashing blocks and tries.92 /// The type for hashing blocks and tries.
97 type Hash = Hash;93 type Hash = Hash;
98 /// The hashing algorithm used.94 /// The hashing algorithm used.
101 type Nonce = Nonce;97 type Nonce = Nonce;
102 /// The lookup mechanism to get account ID from whatever is passed in dispatchers.98 /// The lookup mechanism to get account ID from whatever is passed in dispatchers.
103 type Lookup = AccountIdLookup<AccountId, ()>;99 type Lookup = AccountIdLookup<AccountId, ()>;
104 /// What to do if an account is fully reaped from the system.
105 type OnKilledAccount = ();
106 /// What to do if a new account is created.
107 type OnNewAccount = ();
108 type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;100 type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
109 /// The ubiquitous origin type.101 /// The ubiquitous origin type.
110 type RuntimeOrigin = RuntimeOrigin;102 type RuntimeOrigin = RuntimeOrigin;
118 type Version = Version;110 type Version = Version;
119 type MaxConsumers = ConstU32<16>;111 type MaxConsumers = ConstU32<16>;
120
121 type RuntimeTask = ();
122
123 type SingleBlockMigrations = ();
124 type MultiBlockMigrator = ();
125 type PreInherents = ();
126 type PostInherents = ();
127 type PostTransactions = ();
128}112}
129113
130parameter_types! {114parameter_types! {