Implement basic upward & downward messages (#118)

* Start by replacing branch names and set `DownwardMessage`

* Add the upward-message crate

* Add Kusama & Polkadot

* More work on getting the upward messages working

* Fix build

* Begin to integrate it into the test Parachain

* Update

* Make everything compile again

* Switch to westend and print parachain account on startup

* Use MultiSignature etc

* Fix validate block

* Some downward messages work

* Update git reference

* More downward messages integration

* Update test runtime for downward messages

* Enable downward message handler and withdraw send tokens

* Add some docs

* Begin to implement simple XCMP

* More work

* Fixes and make parachain id configurable

* Make parachain ID be part of the genesis

* Finishing the XCMP message demo

* Update and fixes tests

* Update branch
This commit is contained in:
Bastian Köcher authored and GitHub committed 2020-06-18 12:10:20 +02:00
1 parent 071d7a11c4
commit c9aaddf667
30 files changed
+1037 -391

No files matched your search

+53 -20
View File
@@ -864,10 +864,14 @@ name = "cumulus-message-broker"
version = "0.1.0"
dependencies = [
"cumulus-primitives",
"cumulus-upward-message",
"frame-support",
"frame-system",
"parity-scale-codec",
"sp-inherents",
"sp-io",
"sp-runtime",
"sp-std",
]
[[package]]
@@ -923,6 +927,7 @@ version = "0.1.0"
dependencies = [
"impl-trait-for-tuples",
"parity-scale-codec",
"polkadot-core-primitives",
"polkadot-parachain",
"polkadot-primitives",
"sp-inherents",
@@ -947,7 +952,6 @@ dependencies = [
"sp-blockchain",
"sp-consensus",
"sp-core",
"sp-inherents",
"sp-io",
"sp-keyring",
"sp-runtime",
@@ -981,6 +985,7 @@ dependencies = [
"cumulus-collator",
"cumulus-consensus",
"cumulus-network",
"cumulus-primitives",
"cumulus-test-parachain-runtime",
"derive_more 0.15.0",
"exit-future 0.1.4",
@@ -997,6 +1002,7 @@ dependencies = [
"parking_lot 0.9.0",
"polkadot-cli",
"polkadot-collator",
"polkadot-parachain",
"polkadot-primitives",
"polkadot-runtime",
"polkadot-runtime-common",
@@ -1030,18 +1036,21 @@ dependencies = [
name = "cumulus-test-parachain-runtime"
version = "0.1.0"
dependencies = [
"cumulus-message-broker",
"cumulus-parachain-upgrade",
"cumulus-primitives",
"cumulus-runtime",
"cumulus-upward-message",
"frame-executive",
"frame-support",
"frame-system",
"pallet-balances",
"pallet-indices",
"pallet-randomness-collective-flip",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
"parity-scale-codec",
"polkadot-parachain",
"serde",
"sp-api",
"sp-block-builder",
@@ -1066,6 +1075,18 @@ dependencies = [
"substrate-wasm-builder-runner 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cumulus-upward-message"
version = "0.1.0"
dependencies = [
"kusama-runtime",
"polkadot-core-primitives",
"polkadot-parachain",
"polkadot-runtime",
"sp-std",
"westend-runtime",
]
[[package]]
name = "curve25519-dalek"
version = "2.1.0"
@@ -2483,7 +2504,7 @@ dependencies = [
[[package]]
name = "kusama-runtime"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"bitvec",
"frame-executive",
@@ -4320,7 +4341,7 @@ checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e"
[[package]]
name = "polkadot-availability-store"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"derive_more 0.99.7",
"exit-future 0.2.0",
@@ -4347,7 +4368,7 @@ dependencies = [
[[package]]
name = "polkadot-cli"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"frame-benchmarking-cli",
"futures 0.3.5",
@@ -4369,7 +4390,7 @@ dependencies = [
[[package]]
name = "polkadot-collator"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"futures 0.3.5",
"futures-timer 2.0.2",
@@ -4393,10 +4414,21 @@ dependencies = [
"tokio 0.2.21",
]
[[package]]
name = "polkadot-core-primitives"
version = "0.7.30"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"parity-scale-codec",
"sp-core",
"sp-runtime",
"sp-std",
]
[[package]]
name = "polkadot-erasure-coding"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"derive_more 0.15.0",
"parity-scale-codec",
@@ -4409,7 +4441,7 @@ dependencies = [
[[package]]
name = "polkadot-network"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"arrayvec 0.4.12",
"bytes 0.5.4",
@@ -4436,19 +4468,19 @@ dependencies = [
[[package]]
name = "polkadot-parachain"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"derive_more 0.99.7",
"log 0.4.8",
"parity-scale-codec",
"parking_lot 0.10.2",
"polkadot-core-primitives",
"sc-executor",
"serde",
"shared_memory",
"sp-core",
"sp-externalities",
"sp-io",
"sp-runtime-interface",
"sp-std",
"sp-wasm-interface",
]
@@ -4456,11 +4488,12 @@ dependencies = [
[[package]]
name = "polkadot-primitives"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"bitvec",
"frame-system",
"parity-scale-codec",
"polkadot-core-primitives",
"polkadot-parachain",
"serde",
"sp-api",
@@ -4477,7 +4510,7 @@ dependencies = [
[[package]]
name = "polkadot-rpc"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"jsonrpc-core",
"pallet-transaction-payment-rpc",
@@ -4503,7 +4536,7 @@ dependencies = [
[[package]]
name = "polkadot-runtime"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"bitvec",
"frame-executive",
@@ -4567,7 +4600,7 @@ dependencies = [
[[package]]
name = "polkadot-runtime-common"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"bitvec",
"frame-support",
@@ -4599,7 +4632,7 @@ dependencies = [
[[package]]
name = "polkadot-service"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"frame-benchmarking",
"frame-system-rpc-runtime-api",
@@ -4657,7 +4690,7 @@ dependencies = [
[[package]]
name = "polkadot-statement-table"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"parity-scale-codec",
"polkadot-primitives",
@@ -4667,7 +4700,7 @@ dependencies = [
[[package]]
name = "polkadot-test-runtime"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"bitvec",
"frame-executive",
@@ -4717,7 +4750,7 @@ dependencies = [
[[package]]
name = "polkadot-test-runtime-client"
version = "2.0.0"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"futures 0.3.5",
"pallet-timestamp",
@@ -4740,7 +4773,7 @@ dependencies = [
[[package]]
name = "polkadot-validation"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"bitvec",
"derive_more 0.14.1",
@@ -8638,7 +8671,7 @@ dependencies = [
[[package]]
name = "westend-runtime"
version = "0.8.8"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#abc1db331ac1fc4f73138bb059c107ee4011a069"
source = "git+https://github.com/paritytech/polkadot?branch=cumulus-branch#91f3e68f5750dff7bddedeb846ff55447e8cf8f8"
dependencies = [
"bitvec",
"frame-executive",
+1
View File
@@ -10,6 +10,7 @@ members = [
"test/client",
"test/parachain/runtime",
"test/parachain/",
"upward-message",
]
[profile.release]
+100 -92
View File
@@ -20,39 +20,39 @@ use cumulus_network::{
DelayedBlockAnnounceValidator, JustifiedBlockAnnounceValidator, WaitToAnnounce,
};
use cumulus_primitives::{
HeadData, inherents::VALIDATION_FUNCTION_PARAMS_IDENTIFIER as VFP_IDENT,
validation_function_params::ValidationFunctionParams,
inherents::{VALIDATION_FUNCTION_PARAMS_IDENTIFIER as VFP_IDENT, DOWNWARD_MESSAGES_IDENTIFIER, DownwardMessagesType},
validation_function_params::ValidationFunctionParams, HeadData,
};
use cumulus_runtime::ParachainBlockData;
use sc_client_api::{BlockchainEvents, Finalizer, StateBackend, UsageProvider};
use sc_service::Configuration;
use sp_api::{ApiExt, ProvideRuntimeApi};
use sp_blockchain::HeaderBackend;
use sp_consensus::{
BlockImport, BlockImportParams, BlockOrigin, Environment, Error as ConsensusError,
ForkChoiceStrategy, Proposal, Proposer, RecordProof,
};
use sp_inherents::{InherentData, InherentDataProviders};
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, HashFor};
use sp_api::{ApiExt, ProvideRuntimeApi};
use sc_client_api::{StateBackend, UsageProvider, Finalizer, BlockchainEvents};
use sc_service::Configuration;
use sp_runtime::traits::{Block as BlockT, HashFor, Header as HeaderT};
use polkadot_collator::{
BuildParachainContext, InvalidHead, Network as CollatorNetwork, ParachainContext,
RuntimeApiCollection,
};
use polkadot_primitives::{
parachain::{self, BlockData, GlobalValidationSchedule, LocalValidationData, Id as ParaId},
Block as PBlock, Hash as PHash,
parachain::{self, BlockData, GlobalValidationSchedule, Id as ParaId, LocalValidationData},
Block as PBlock, DownwardMessage, Hash as PHash,
};
use codec::{Decode, Encode};
use log::{error, trace};
use futures::task::Spawn;
use futures::prelude::*;
use futures::task::Spawn;
use std::{marker::PhantomData, sync::Arc, time::Duration, pin::Pin};
use std::{marker::PhantomData, pin::Pin, sync::Arc, time::Duration};
use parking_lot::Mutex;
@@ -98,29 +98,44 @@ impl<Block: BlockT, PF, BI> Collator<Block, PF, BI> {
inherent_providers: InherentDataProviders,
global_validation: GlobalValidationSchedule,
local_validation: LocalValidationData,
downward_messages: DownwardMessagesType,
) -> Result<InherentData, InvalidHead> {
let mut inherent_data = inherent_providers
.create_inherent_data()
let mut inherent_data = inherent_providers.create_inherent_data().map_err(|e| {
error!(
target: "cumulus-collator",
"Failed to create inherent data: {:?}",
e,
);
InvalidHead
})?;
inherent_data
.put_data(
VFP_IDENT,
&ValidationFunctionParams::from((global_validation, local_validation)),
)
.map_err(|e| {
error!(
target: "cumulus-collator",
"Failed to create inherent data: {:?}",
"Failed to put validation function params into inherent data: {:?}",
e,
);
InvalidHead
})?;
inherent_data.put_data(
VFP_IDENT,
&ValidationFunctionParams::from((global_validation, local_validation))
).map_err(|e| {
error!(
target: "cumulus-collator",
"Failed to inject validation function params into inherents: {:?}",
e,
);
InvalidHead
})?;
inherent_data
.put_data(
DOWNWARD_MESSAGES_IDENTIFIER,
&downward_messages,
)
.map_err(|e| {
error!(
target: "cumulus-collator",
"Failed to put downward messages into inherent data: {:?}",
e,
);
InvalidHead
})?;
Ok(inherent_data)
}
@@ -152,16 +167,15 @@ where
+ Sync
+ 'static,
{
type ProduceCandidate = Pin<Box<
dyn Future<Output=Result<(BlockData, parachain::HeadData), InvalidHead>>
+ Send,
>>;
type ProduceCandidate =
Pin<Box<dyn Future<Output = Result<(BlockData, parachain::HeadData), InvalidHead>> + Send>>;
fn produce_candidate(
&mut self,
relay_chain_parent: PHash,
global_validation: GlobalValidationSchedule,
local_validation: LocalValidationData,
downward_messages: Vec<DownwardMessage>,
) -> Self::ProduceCandidate {
let factory = self.proposer_factory.clone();
let inherent_providers = self.inherent_data_providers.clone();
@@ -177,27 +191,28 @@ where
}
};
let proposer_future = factory
.lock()
.init(&last_head.header);
let proposer_future = factory.lock().init(&last_head.header);
let wait_to_announce = self.wait_to_announce.clone();
Box::pin(async move {
let parent_state_root = *last_head.header.state_root();
let proposer = proposer_future
.await
.map_err(|e| {
error!(
target: "cumulus-collator",
"Could not create proposer: {:?}",
e,
);
InvalidHead
})?;
let proposer = proposer_future.await.map_err(|e| {
error!(
target: "cumulus-collator",
"Could not create proposer: {:?}",
e,
);
InvalidHead
})?;
let inherent_data = Self::inherent_data(inherent_providers, global_validation, local_validation)?;
let inherent_data = Self::inherent_data(
inherent_providers,
global_validation,
local_validation,
downward_messages,
)?;
let Proposal {
block,
@@ -221,14 +236,13 @@ where
InvalidHead
})?;
let proof = proof
.ok_or_else(|| {
error!(
target: "cumulus-collator",
"Proposer did not return the requested proof.",
);
InvalidHead
})?;
let proof = proof.ok_or_else(|| {
error!(
target: "cumulus-collator",
"Proposer did not return the requested proof.",
);
InvalidHead
})?;
let (header, extrinsics) = block.deconstruct();
@@ -262,20 +276,13 @@ where
let header = b.into_header();
let encoded_header = header.encode();
let hash = header.hash();
let head_data = HeadData::<Block> {
header,
};
let head_data = HeadData::<Block> { header };
let candidate = (
block_data,
parachain::HeadData(head_data.encode()),
);
let candidate = (block_data, parachain::HeadData(head_data.encode()));
wait_to_announce.lock().wait_to_announce(
hash,
relay_chain_parent,
encoded_header,
);
wait_to_announce
.lock()
.wait_to_announce(hash, relay_chain_parent, encoded_header);
trace!(target: "cumulus-collator", "Produced candidate: {:?}", candidate);
@@ -296,9 +303,7 @@ pub struct CollatorBuilder<Block: BlockT, PF, BI, Backend, Client> {
_marker: PhantomData<(Block, Backend)>,
}
impl<Block: BlockT, PF, BI, Backend, Client>
CollatorBuilder<Block, PF, BI, Backend, Client>
{
impl<Block: BlockT, PF, BI, Backend, Client> CollatorBuilder<Block, PF, BI, Backend, Client> {
/// Create a new instance of self.
pub fn new(
proposer_factory: PF,
@@ -334,7 +339,9 @@ where
+ Sync
+ 'static,
Backend: sc_client_api::Backend<Block> + 'static,
Client: Finalizer<Block, Backend> + UsageProvider<Block> + HeaderBackend<Block>
Client: Finalizer<Block, Backend>
+ UsageProvider<Block>
+ HeaderBackend<Block>
+ Send
+ Sync
+ 'static,
@@ -348,16 +355,22 @@ where
polkadot_network: impl CollatorNetwork + Clone + 'static,
) -> Result<Self::ParachainContext, ()>
where
PClient: ProvideRuntimeApi<PBlock> + BlockchainEvents<PBlock> + HeaderBackend<PBlock>
+ Send + Sync + 'static,
PClient: ProvideRuntimeApi<PBlock>
+ BlockchainEvents<PBlock>
+ HeaderBackend<PBlock>
+ Send
+ Sync
+ 'static,
PClient::Api: RuntimeApiCollection<Extrinsic>,
<PClient::Api as ApiExt<PBlock>>::StateBackend: StateBackend<HashFor<PBlock>>,
Spawner: Spawn + Clone + Send + Sync + 'static,
Extrinsic: codec::Codec + Send + Sync + 'static,
{
self.delayed_block_announce_validator.set(
Box::new(JustifiedBlockAnnounceValidator::new(polkadot_client.clone(), self.para_id)),
);
self.delayed_block_announce_validator
.set(Box::new(JustifiedBlockAnnounceValidator::new(
polkadot_client.clone(),
self.para_id,
)));
let follow =
match cumulus_consensus::follow_polkadot(self.para_id, self.client, polkadot_client) {
@@ -368,12 +381,7 @@ where
};
spawner
.spawn_obj(
Box::new(
follow.map(|_| ()),
)
.into(),
)
.spawn_obj(Box::new(follow.map(|_| ())).into())
.map_err(|_| error!("Could not spawn parachain server!"))?;
Ok(Collator::new(
@@ -415,12 +423,10 @@ mod tests {
use sp_state_machine::StorageProof;
use substrate_test_client::{NativeExecutor, WasmExecutionMethod::Interpreted};
use test_client::{
DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt,
};
use test_client::{DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt};
use test_runtime::{Block, Header};
use futures::{Stream, future};
use futures::{future, Stream};
#[derive(Debug)]
struct Error;
@@ -436,9 +442,9 @@ mod tests {
impl Environment<Block> for DummyFactory {
type Proposer = DummyProposer;
type Error = Error;
type CreateProposer = Pin<Box<
dyn Future<Output = Result<Self::Proposer, Self::Error>> + Send + Unpin + 'static
>>;
type CreateProposer = Pin<
Box<dyn Future<Output = Result<Self::Proposer, Self::Error>> + Send + Unpin + 'static>,
>;
fn init(&mut self, _: &Header) -> Self::CreateProposer {
Box::pin(future::ready(Ok(DummyProposer)))
@@ -479,7 +485,10 @@ mod tests {
struct DummyCollatorNetwork;
impl CollatorNetwork for DummyCollatorNetwork {
fn checked_statements(&self, _: PHash) -> Pin<Box<dyn Stream<Item = SignedStatement> + Send>> {
fn checked_statements(
&self,
_: PHash,
) -> Pin<Box<dyn Stream<Item = SignedStatement> + Send>> {
unimplemented!("Not required in tests")
}
}
@@ -526,13 +535,11 @@ mod tests {
Arc::new(
substrate_test_client::TestClientBuilder::<_, _, _, ()>::default()
.build_with_native_executor::<polkadot_service::polkadot_runtime::RuntimeApi, _>(
Some(
NativeExecutor::<polkadot_service::PolkadotExecutor>::new(
Interpreted,
None,
1,
)
)
Some(NativeExecutor::<polkadot_service::PolkadotExecutor>::new(
Interpreted,
None,
1,
)),
)
.0,
),
@@ -562,6 +569,7 @@ mod tests {
balance: 10,
code_upgrade_allowed: None,
},
Vec::new(),
context,
Arc::new(Sr25519Keyring::Alice.pair().into()),
);
+8
View File
@@ -9,12 +9,16 @@ edition = "2018"
frame-support = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
# Other dependencies
codec = { package = "parity-scale-codec", version = "1.3.0", features = [ "derive" ], default-features = false }
# Cumulus dependencies
cumulus-primitives = { path = "../primitives", default-features = false }
cumulus-upward-message = { path = "../upward-message", default-features = false }
[features]
default = [ "std" ]
@@ -22,6 +26,10 @@ std = [
"frame-support/std",
"frame-system/std",
"sp-inherents/std",
"sp-io/std",
"sp-std/std",
"sp-runtime/std",
"codec/std",
"cumulus-primitives/std",
"cumulus-upward-message/std",
]
+85 -9
View File
@@ -16,52 +16,128 @@
//! Cumulus message broker pallet.
//!
//! This pallet provides support for handling downward and upward messages.
//! This pallet provides support for handling downward, upward messages and
//! XMCP messages.
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Encode, Decode};
use cumulus_primitives::{
inherents::{DownwardMessagesType, DOWNWARD_MESSAGES_IDENTIFIER},
well_known_keys, DownwardMessageHandler, UpwardMessageSender,
well_known_keys,
xcmp::{RawXCMPMessage, XCMPMessageHandler, XCMPMessageSender},
DownwardMessage, DownwardMessageHandler, GenericUpwardMessage, ParaId, UpwardMessageOrigin,
UpwardMessageSender,
};
use cumulus_upward_message::XCMPMessage;
use frame_support::{
decl_module, storage,
decl_event, decl_module, storage,
traits::Get,
weights::{DispatchClass, Weight},
};
use frame_system::ensure_none;
use sp_inherents::{InherentData, InherentIdentifier, MakeFatalError, ProvideInherent};
use sp_runtime::traits::Hash;
use sp_std::vec::Vec;
/// Configuration trait of this pallet.
pub trait Trait: frame_system::Trait {
/// Event type used by the runtime.
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
/// The downward message handlers that will be informed when a message is received.
type DownwardMessageHandlers: DownwardMessageHandler;
/// The upward message type used by the Parachain runtime.
type UpwardMessage: codec::Codec + XCMPMessage;
/// The XCMP message handlers that will be informed when a XCMP message is received.
type XCMPMessageHandlers: XCMPMessageHandler<Self::XCMPMessage>;
/// The XCMP message type used by the Parachain runtime.
type XCMPMessage: codec::Codec;
/// The Id of the parachain.
type ParachainId: Get<ParaId>;
}
decl_event! {
pub enum Event<T> where Hash = <T as frame_system::Trait>::Hash {
/// An upward message was sent to the relay chain.
///
/// The hash corresponds to the hash of the encoded upward message.
UpwardMessageSent(Hash),
}
}
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system = frame_system {
/// Executes the given downward messages by calling the message handlers.
///
/// The origin of this call needs to be `None` as this is an inherent.
#[weight = (10, DispatchClass::Mandatory)]
fn execute_downward_messages(origin, messages: Vec<()>) {
fn execute_downward_messages(origin, messages: Vec<DownwardMessage>) {
ensure_none(origin)?;
messages.iter().for_each(T::DownwardMessageHandlers::handle_downward_message);
//TODO: max messages should not be hardcoded. It should be determined based on the
// weight used by the handlers.
let max_messages = 10;
messages.iter().take(max_messages).for_each(|msg| {
match msg {
DownwardMessage::XCMPMessage(msg) => {
if let Ok(msg) = RawXCMPMessage::decode(&mut &msg[..]) {
if let Ok(xcmp_msg) = T::XCMPMessage::decode(&mut &msg.data[..]) {
T::XCMPMessageHandlers::handle_xcmp_message(msg.from, &xcmp_msg);
}
}
},
msg => T::DownwardMessageHandlers::handle_downward_message(msg),
}
});
let processed = sp_std::cmp::min(messages.len(), max_messages) as u32;
storage::unhashed::put(well_known_keys::PROCESSED_DOWNWARD_MESSAGES, &processed);
}
fn on_initialize() -> Weight {
storage::unhashed::kill(well_known_keys::UPWARD_MESSAGES);
0
T::DbWeight::get().writes(1)
}
fn deposit_event() = default;
}
}
impl<T: Trait> UpwardMessageSender for Module<T> {
fn send_upward_message(_: &()) -> Result<(), ()> {
impl<T: Trait> UpwardMessageSender<T::UpwardMessage> for Module<T> {
fn send_upward_message(msg: &T::UpwardMessage, origin: UpwardMessageOrigin) -> Result<(), ()> {
//TODO: check fee schedule
let data = msg.encode();
let data_hash = T::Hashing::hash(&data);
let msg = GenericUpwardMessage { origin, data };
sp_io::storage::append(well_known_keys::UPWARD_MESSAGES, msg.encode());
Self::deposit_event(RawEvent::UpwardMessageSent(data_hash));
Ok(())
}
}
impl<T: Trait> XCMPMessageSender<T::XCMPMessage> for Module<T> {
fn send_xcmp_message(dest: ParaId, msg: &T::XCMPMessage) -> Result<(), ()> {
let message = RawXCMPMessage {
from: T::ParachainId::get(),
data: msg.encode(),
};
Self::send_upward_message(
&T::UpwardMessage::send_message(dest, message.encode()),
UpwardMessageOrigin::Parachain,
)
}
}
impl<T: Trait> ProvideInherent for Module<T> {
type Call = Call<T>;
type Error = MakeFatalError<()>;
+4
View File
@@ -439,6 +439,10 @@ sp_api::mock_impl_runtime_apis! {
parent_hash: Default::default(),
}
}
fn downward_messages(_: ParaId) -> Vec<polkadot_primitives::DownwardMessage> {
Vec::new()
}
}
}
+12 -11
View File
@@ -14,23 +14,24 @@ cumulus-runtime = { path = "../runtime", default-features = false }
parachain = { package = "polkadot-parachain", git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch", default-features = false }
# Substrate dependencies
frame-support = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", version = "2.0.0-dev", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", version = "2.0.0-dev", default-features = false }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", version = "2.0.0-dev", default-features = false }
sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
system = { package = "frame-system", git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
# Other Dependencies
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"]}
serde = { version = "1.0.101", optional = true, features = ["derive"] }
[dev-dependencies]
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
substrate-test-runtime-client = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
sp-version = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
sp-externalities = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
substrate-test-runtime-client = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "cumulus-branch", default-features = false }
[features]
default = ['std']
+4
View File
@@ -18,6 +18,9 @@ polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch =
codec = { package = "parity-scale-codec", version = "1.0.5", default-features = false, features = [ "derive" ] }
impl-trait-for-tuples = "0.1.3"
# Polkadot dependencies
polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch", default-features = false }
[features]
default = [ "std" ]
std = [
@@ -26,5 +29,6 @@ std = [
"polkadot-primitives/std",
"polkadot-parachain/std",
"sp-inherents/std",
"polkadot-core-primitives/std",
"sp-runtime/std",
]
+23 -7
View File
@@ -18,7 +18,18 @@
#![cfg_attr(not(feature = "std"), no_std)]
pub use polkadot_core_primitives as relay_chain;
pub use polkadot_core_primitives::DownwardMessage;
/// A generic upward message from a Parachain to the Relay Chain.
///
/// It is "generic" in such a way, that the actual message is encoded in the `data` field.
/// Besides the `data` it also holds the `origin` of the message.
pub use polkadot_parachain::primitives::UpwardMessage as GenericUpwardMessage;
pub use polkadot_parachain::primitives::ParachainDispatchOrigin as UpwardMessageOrigin;
pub use polkadot_parachain::primitives::Id as ParaId;
pub mod validation_function_params;
pub mod xcmp;
use codec::{Decode, Encode};
use sp_runtime::traits::Block as BlockT;
@@ -31,7 +42,7 @@ pub mod inherents {
pub const DOWNWARD_MESSAGES_IDENTIFIER: InherentIdentifier = *b"cumdownm";
/// The type of the inherent downward messages.
pub type DownwardMessagesType = sp_std::vec::Vec<()>;
pub type DownwardMessagesType = sp_std::vec::Vec<crate::DownwardMessage>;
/// The identifier for the `validation_function_params` inherent.
pub const VALIDATION_FUNCTION_PARAMS_IDENTIFIER: InherentIdentifier = *b"valfunp0";
@@ -43,29 +54,34 @@ pub mod inherents {
pub mod well_known_keys {
/// The storage key for the upward messages.
///
/// The upward messages are stored as SCALE encoded `Vec<()>`.
/// The upward messages are stored as SCALE encoded `Vec<GenericUpwardMessage>`.
pub const UPWARD_MESSAGES: &'static [u8] = b":cumulus_upward_messages:";
/// Current validation function parameters.
pub const VALIDATION_FUNCTION_PARAMS: &'static [u8] = b":validation_function_params";
pub const VALIDATION_FUNCTION_PARAMS: &'static [u8] = b":cumulus_validation_function_params";
/// Code upgarde (set as appropriate by a pallet).
pub const NEW_VALIDATION_CODE: &'static [u8] = b":new_validation_code";
pub const NEW_VALIDATION_CODE: &'static [u8] = b":cumulus_new_validation_code";
/// The storage key for the processed downward messages.
///
/// The value is stored as SCALE encoded `u32`.
pub const PROCESSED_DOWNWARD_MESSAGES: &'static [u8] = b":cumulus_processed_downward_messages:";
}
/// Something that should be called when a downward message is received.
#[impl_trait_for_tuples::impl_for_tuples(30)]
pub trait DownwardMessageHandler {
/// Handle the given downward message.
fn handle_downward_message(msg: &());
fn handle_downward_message(msg: &DownwardMessage);
}
/// Something that can send upward messages.
pub trait UpwardMessageSender {
pub trait UpwardMessageSender<UpwardMessage> {
/// Send an upward message to the relay chain.
///
/// Returns an error if sending failed.
fn send_upward_message(msg: &()) -> Result<(), ()>;
fn send_upward_message(msg: &UpwardMessage, origin: UpwardMessageOrigin) -> Result<(), ()>;
}
/// The head data of the parachain, stored in the relay chain.
+42
View File
@@ -0,0 +1,42 @@
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Substrate is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! XMCP related primitives
use polkadot_primitives::parachain::Id as ParaId;
use sp_std::vec::Vec;
/// A raw XCMP message that is being send between two Parachain's.
#[derive(codec::Encode, codec::Decode)]
pub struct RawXCMPMessage {
/// Parachain sending the message.
pub from: ParaId,
/// SCALE encoded message.
pub data: Vec<u8>,
}
/// Something that can handle XCMP messages.
#[impl_trait_for_tuples::impl_for_tuples(30)]
pub trait XCMPMessageHandler<Message: codec::Decode> {
/// Handle a XCMP message.
fn handle_xcmp_message(src: ParaId, msg: &Message);
}
/// Something that can send XCMP messages.
pub trait XCMPMessageSender<Message: codec::Encode> {
/// Send a XCMP message to the given parachain.
fn send_xcmp_message(dest: ParaId, msg: &Message) -> Result<(), ()>;
}
-1
View File
@@ -22,7 +22,6 @@ sp-core = { git = "https://github.com/paritytech/substrate", default-features =
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
sp-trie = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
# Polkadot dependencies
parachain = { package = "polkadot-parachain", git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch", default-features = false, features = [ "wasm-api" ] }
@@ -33,7 +33,11 @@ use codec::{Decode, Encode, EncodeAppend};
use cumulus_primitives::{
validation_function_params::ValidationFunctionParams,
well_known_keys::{NEW_VALIDATION_CODE, VALIDATION_FUNCTION_PARAMS},
well_known_keys::{
NEW_VALIDATION_CODE, PROCESSED_DOWNWARD_MESSAGES, UPWARD_MESSAGES,
VALIDATION_FUNCTION_PARAMS,
},
GenericUpwardMessage,
};
/// Stores the global [`Storage`] instance.
@@ -92,11 +96,11 @@ pub fn validate_block<B: BlockT, E: ExecuteBlock<B>>(params: ValidationParams) -
let block_data = crate::ParachainBlockData::<B>::decode(&mut &params.block_data.0[..])
.expect("Invalid parachain block data");
let parent_head = B::Header::decode(&mut &params.parent_head.0[..]).expect("Invalid parent head");
// TODO: Use correct head data
let parent_head =
B::Header::decode(&mut &params.parent_head.0[..]).expect("Invalid parent head");
let head_data = HeadData(block_data.header.encode());
// TODO: Add `PolkadotInherent`.
let block = B::new(block_data.header, block_data.extrinsics);
assert!(
parent_head.hash() == *block.header().parent_hash(),
@@ -131,16 +135,30 @@ pub fn validate_block<B: BlockT, E: ExecuteBlock<B>>(params: ValidationParams) -
E::execute_block(block);
// if in the course of block execution new validation code was set, insert
// its scheduled upgrade so we can validate that block number later
// If in the course of block execution new validation code was set, insert
// its scheduled upgrade so we can validate that block number later.
let new_validation_code = storage().get(NEW_VALIDATION_CODE).map(ValidationCode);
if new_validation_code.is_some() && validation_function_params.code_upgrade_allowed.is_none() {
panic!("attempt to upgrade validation function when not permitted");
panic!("Attempt to upgrade validation function when not permitted!");
}
// Extract potential upward messages from the storage.
let upward_messages = match storage().get(UPWARD_MESSAGES) {
Some(encoded) => Vec::<GenericUpwardMessage>::decode(&mut &encoded[..])
.expect("Upward messages vec is not correctly encoded in the storage!"),
None => Vec::new(),
};
let processed_downward_messages = storage()
.get(PROCESSED_DOWNWARD_MESSAGES)
.and_then(|v| Decode::decode(&mut &v[..]).ok())
.unwrap_or_default();
ValidationResult {
head_data,
new_validation_code,
upward_messages,
processed_downward_messages,
}
}
@@ -157,7 +175,11 @@ impl<B: BlockT> WitnessStorage<B> {
/// Initialize from the given witness data and storage root.
///
/// Returns an error if given storage root was not found in the witness data.
fn new(data: WitnessData, storage_root: B::Hash, params: ValidationFunctionParams) -> Result<Self, &'static str> {
fn new(
data: WitnessData,
storage_root: B::Hash,
params: ValidationFunctionParams,
) -> Result<Self, &'static str> {
let mut db = MemoryDB::default();
data.into_iter().for_each(|i| {
db.insert(EMPTY_PREFIX, &i);
@@ -180,20 +202,19 @@ impl<B: BlockT> Storage for WitnessStorage<B> {
fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
match key {
VALIDATION_FUNCTION_PARAMS => Some(self.params.encode()),
key => {
self.overlay
.get(key)
.cloned()
.or_else(|| {
read_trie_value::<Layout<HashFor<B>>, _>(
&self.witness_data,
&self.storage_root,
key,
)
.ok()
})
.unwrap_or(None)
}
key => self
.overlay
.get(key)
.cloned()
.or_else(|| {
read_trie_value::<Layout<HashFor<B>>, _>(
&self.witness_data,
&self.storage_root,
key,
)
.ok()
})
.unwrap_or(None),
}
}
@@ -209,8 +230,11 @@ impl<B: BlockT> Storage for WitnessStorage<B> {
let root = delta_trie_root::<Layout<HashFor<B>>, _, _, _, _, _>(
&mut self.witness_data,
self.storage_root.clone(),
self.overlay.iter().map(|(k, v)| (k.as_ref(), v.as_ref().map(|v| v.as_ref()))),
).expect("Calculates storage root");
self.overlay
.iter()
.map(|(k, v)| (k.as_ref(), v.as_ref().map(|v| v.as_ref()))),
)
.expect("Calculates storage root");
root.encode()
}
@@ -222,8 +246,7 @@ impl<B: BlockT> Storage for WitnessStorage<B> {
}
});
let trie = match TrieDB::<Layout<HashFor<B>>>::new(&self.witness_data, &self.storage_root)
{
let trie = match TrieDB::<Layout<HashFor<B>>>::new(&self.witness_data, &self.storage_root) {
Ok(r) => r,
Err(_) => panic!(),
};
@@ -239,10 +262,12 @@ impl<B: BlockT> Storage for WitnessStorage<B> {
let current_value = self.overlay.entry(key.to_vec()).or_default();
let item = current_value.take().unwrap_or_default();
*current_value = Some(match Vec::<EncodeOpaqueValue>::append_or_new(item, &value_vec) {
Ok(item) => item,
Err(_) => value_vec.encode(),
});
*current_value = Some(
match Vec::<EncodeOpaqueValue>::append_or_new(item, &value_vec) {
Ok(item) => item,
Err(_) => value_vec.encode(),
},
);
}
}
+2 -1
View File
@@ -26,7 +26,8 @@ mod tests;
#[doc(hidden)]
pub use parachain;
/// Register the `validate_block` function that is used by parachains to validate blocks on a validator.
/// Register the `validate_block` function that is used by parachains to validate blocks on a
/// validator.
///
/// Does *nothing* when `std` feature is enabled.
///
+3 -1
View File
@@ -44,9 +44,11 @@ sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch
cumulus-consensus = { path = "../../consensus" }
cumulus-collator = { path = "../../collator" }
cumulus-network = { path = "../../network" }
cumulus-primitives = { path = "../../primitives" }
# Polkadot dependencies
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch" }
polkadot-collator = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch" }
@@ -70,8 +72,8 @@ polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "c
# Substrate dependencies
substrate-test-runtime-client = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sp-version = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
@@ -1,6 +1,6 @@
{
"name": "Local Testnet",
"id": "local_testnet",
"name": "Westend Local Testnet",
"id": "westend_local_testnet",
"chainType": "Local",
"bootNodes": [],
"telemetryEndpoints": null,
@@ -12,83 +12,83 @@
"genesis": {
"raw": {
"top": {
"0x5f3e4907f716ac89b6347d15ececedcac29a0310e1bb45d20cace77ccb62c97d": "0x00e1f505",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca487df464e44a534ba6b0cbb32407b587": "0x0000000000",
"0x5f3e4907f716ac89b6347d15ececedcaad811cd65a470ddc5f1d628ff0550982b4def25cfda6ef3a00000000": "0x00000000",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950246b6699fb8b8db670617261808eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0xf2794c22e353e9a839f12faab03a911b7f17cdfbfa73331856cca0acddd7842e": "0x00000000",
"0xf2794c22e353e9a839f12faab03a911be2f6cb0456905c189bcb0458f9440f13": "0x00000000",
"0x2099d7f109d6e535fb000bba623fd4409f99a2ce711f3a31b2fc05604c93f179": "0x088eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x5f3e4907f716ac89b6347d15ececedca422adb579f1dbf4f3886c5cfa3bb8cc4de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f0b00407a10f35a0b00407a10f35a0000",
"0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb3e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0eed43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0xc2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80": "0x0000b0d86b9088a60000000000000000",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da98578796c363c105114787203e4d93ca6101191192fc877c24d725b337120fa3edc63d227bbc92705db1e2cb65f56981a": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x492a52699edf49c972c21db794cfcf57ba7fb8745735dc3be2a2c61a72c39e78": "0x00",
"0x5f3e4907f716ac89b6347d15ececedca682db92dde20a10d96d00ff0e9e221c0b4def25cfda6ef3a00000000e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x00",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950f5537bdb2a1f626b6772616e8088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x3fba98689ebed1138735e0e7a5a790ab0b76934f4cc08dee01012d059e1b83ee": "0x00",
"0x5f3e4907f716ac89b6347d15ececedca9220e172bed316605f73f1ff7b4ade980e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x00",
"0x5f3e4907f716ac89b6347d15ececedca42982b9d6c7acc99faa9094c912372c2b4def25cfda6ef3a00000000e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x0b00407a10f35a0b00407a10f35a00",
"0x0b76934f4cc08dee01012d059e1b83ee5e0621c4869aa60c02be9adcc98a0d1d": "0x088eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x3a6772616e6470615f617574686f726974696573": "0x0108d17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae69010000000000000088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0100000000000000",
"0x2b06af9719ac64d755623cda8ddd9b949f99a2ce711f3a31b2fc05604c93f179": "0x088eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x5f3e4907f716ac89b6347d15ececedca28dccb559b95c40168a1b2696581b5a7": "0x00000000000000000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca3ed14b45ed20d054f05e37e2542cfe70e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0xcec5070d609dd3497f72bde07fc96ba0e0cdd062e6eaf24295ad4ccfc41d4609": "0x08fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860ed17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae698eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0eed43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x5f3e4907f716ac89b6347d15ececedca682db92dde20a10d96d00ff0e9e221c0b4def25cfda6ef3a000000000e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x00",
"0x5f3e4907f716ac89b6347d15ececedcaea07de2b8f010516dca3f7ef52f7ac5a": "0x040000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca88dcde934c658227ee1dfafcd6e16903e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x00",
"0x3a636f6465": "0x0061736d0100000001c6022f60037f7f7f017f60027f7f017f60027f7f0060017f017e60057f7f7f7f7f0060037f7f7f0060047f7f7f7f0060017f0060037f7e7e0060017e017f60027f7e017f60027f7f017e60037f7f7e017e60037e7e7f017e6000017e60017e017e60017f017f60017e0060027e7e0060037f7e7f017f60027f7e017e60047f7e7e7e017f6000017f60000060027e7f017f60057f7f7f7f7f017f60047f7f7f7f017f60077f7f7f7f7f7f7f017f60047f7f7f7e0060087e7e7e7e7e7e7e7e017f60077f7e7e7e7e7e7e0060027f7e0060067f7f7f7f7f7f0060057f7e7e7f7f0060057f7f7f7e7e0060057f7f7e7e7f0060047e7e7e7e017f60047f7f7e7e0060087f7f7f7f7f7f7f7f0060067f7f7f7e7e7f0060037e7f7f017f60067f7f7e7e7e7f0060047f7e7f7f0060057f7e7e7e7e0060027e7e017e60067f7e7e7e7e7f0060047f7e7e7f0002f50b2603656e76066d656d6f727902001303656e76196578745f6c6f6767696e675f6c6f675f76657273696f6e5f31000803656e762a6578745f747269655f626c616b65325f3235365f6f7264657265645f726f6f745f76657273696f6e5f31000903656e76256578745f63727970746f5f656432353531395f67656e65726174655f76657273696f6e5f31000a03656e76376578745f63727970746f5f736563703235366b315f65636473615f7265636f7665725f636f6d707265737365645f76657273696f6e5f31000b03656e76256578745f63727970746f5f737232353531395f67656e65726174655f76657273696f6e5f31000a03656e76286578745f63727970746f5f737232353531395f7075626c69635f6b6579735f76657273696f6e5f31000303656e76216578745f63727970746f5f737232353531395f7369676e5f76657273696f6e5f31000c03656e761a6578745f73746f726167655f726561645f76657273696f6e5f31000d03656e76246578745f6f6666636861696e5f6e6574776f726b5f73746174655f76657273696f6e5f31000e03656e76296578745f6f6666636861696e5f7375626d69745f7472616e73616374696f6e5f76657273696f6e5f31000f03656e761e6578745f616c6c6f6361746f725f6d616c6c6f635f76657273696f6e5f31001003656e761c6578745f616c6c6f6361746f725f667265655f76657273696f6e5f31000703656e761d6578745f6d6973635f7072696e745f757466385f76657273696f6e5f31001103656e761c6578745f6d6973635f7072696e745f6e756d5f76657273696f6e5f31001103656e761e6578745f68617368696e675f74776f785f3132385f76657273696f6e5f31000903656e761d6578745f68617368696e675f74776f785f36345f76657273696f6e5f31000903656e76196578745f73746f726167655f7365745f76657273696f6e5f31001203656e76206578745f68617368696e675f626c616b65325f3132385f76657273696f6e5f31000903656e76196578745f73746f726167655f6765745f76657273696f6e5f31000f03656e76226578745f73746f726167655f636c6561725f7072656669785f76657273696f6e5f31001103656e761b6578745f73746f726167655f636c6561725f76657273696f6e5f31001103656e761c6578745f73746f726167655f617070656e645f76657273696f6e5f31001203656e76206578745f68617368696e675f626c616b65325f3235365f76657273696f6e5f31000903656e76236578745f63727970746f5f737232353531395f7665726966795f76657273696f6e5f32001303656e76286578745f6f6666636861696e5f6c6f63616c5f73746f726167655f6765745f76657273696f6e5f31001403656e76346578745f6f6666636861696e5f6c6f63616c5f73746f726167655f636f6d706172655f616e645f7365745f76657273696f6e5f31001503656e76286578745f6f6666636861696e5f6c6f63616c5f73746f726167655f7365745f76657273696f6e5f31000803656e761e6578745f73746f726167655f6e6578745f6b65795f76657273696f6e5f31000f03656e76226578745f6f6666636861696e5f72616e646f6d5f736565645f76657273696f6e5f31001603656e761a6578745f73746f726167655f726f6f745f76657273696f6e5f31000e03656e76226578745f73746f726167655f6368616e6765735f726f6f745f76657273696f6e5f31000f03656e76226578745f6d6973635f72756e74696d655f76657273696f6e5f76657273696f6e5f31000f03656e761c6578745f6d6973635f7072696e745f6865785f76657273696f6e5f31001103656e76276578745f63727970746f5f73746172745f62617463685f7665726966795f76657273696f6e5f31001703656e76286578745f63727970746f5f66696e6973685f62617463685f7665726966795f76657273696f6e5f31001603656e76236578745f6f6666636861696e5f69735f76616c696461746f725f76657273696f6e5f31001603656e76236578745f63727970746f5f656432353531395f7665726966795f76657273696f6e5f31001303a906a70610100707000010100b171717050502050017170400010102010202020201180703191a05050004010101101b0101010501010100060101000101000001000701010102050510020202020502050200010105010207010207050501041c040702020101020505020207050505100101021d011e0101010204020505050202041f200700010201070105050101020205021a0505020202070505050505050505050505050505050505050505020502050505050505050505050202010702050102070505050202020202020202050305050502020207171007020202050202020202020205020501070202070205020502052108120202020207060220020205102202020202070202020502040217060505050702050502020502070205230502050102242526070606050207010707050605020205020505020202020227050505051902020505020705020202020505020205020502020502020505010205020202020507070202000202050702020707070207070202070707020202062001070202070207070702110403020602020216280229020202070205050202062007070102020220200406200204040605050616022401050201020101020101070702070701020207070702070707020201010101010202020217020202020202050502020707070001010602070202020202070707070202022a050502071702020204020202020707020702070205020202050305020202040405060107060005020205060005020202021a070702020207070707020707020207020207020205010202020202020202050502020207021005020202020505170e021f0402020202020205020205Line truncated
"0x2371e21684d2fae99bcb4d579242f74ad47cb8f5328af743ddfb361e7180e7fcbb1bdbcacd6ac9340000000000000000": "0x00000000",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950c9b0c13125732d276175646980d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x5f3e4907f716ac89b6347d15ececedca0b6a45321efae92aea15e0740ec7afe7": "0x00000000",
"0xcec5070d609dd3497f72bde07fc96ba088dcde934c658227ee1dfafcd6e16903": "0x08fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860ebe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x9c5d795d0297be56027a4b2464e33397f43d6436dec51f09c3b71287a8fc9d48": "0x00000000000000000000000000000000",
"0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb30e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0xd17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae698eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48",
"0x2371e21684d2fae99bcb4d579242f74a8a2d09463effcc78a22d75b9cb87dffc": "0x0000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca8bde0a0ea8864605e3b68ed9cb2da01bb4def25cfda6ef3a000000000e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x0b00407a10f35a0b00407a10f35a00",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa195079b38849014a07307061726180d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da94f9aea1afa791265fae359272badc1cf8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca88dcde934c658227ee1dfafcd6e169030e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x00",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da932a5935f6edc617ae178fef9eb1e211fbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x0000000003000064a7b3b6e00d00000000000000000000000000000000000000000000000000407a10f35a0000000000000000000000407a10f35a00000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca308ce9615de0775a82f8a94dc3d285a1": "0x02",
"0x5f3e4907f716ac89b6347d15ececedca9220e172bed316605f73f1ff7b4ade98e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x00",
"0xc2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80": "0x0000b0d86b9088a60000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca3ed14b45ed20d054f05e37e2542cfe700e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950d62c40514b41f31962616265808eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9f3f619a1c2956443880db9cc9a13d058e860f1b1c7227f7c22602f53f15af80747814dffd839719731ee3bba6edc126c": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x1cb6f36e027abb2091cfb5110ab5087f5e0621c4869aa60c02be9adcc98a0d1d": "0x088eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a480100000000000000d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0100000000000000",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9edeaa42c2163f68084a988529a0e2ec5e659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4e": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc": "0x4545454545454545454545454545454545454545454545454545454545454545",
"0x5f3e4907f716ac89b6347d15ececedca5579297f4dfb9609e7e4c2ebab9ce40a": "0x08be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25ffe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa19509d4a4cfe1c2ef0b961756469808eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa19500e3a507571a62417696d6f6e808eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0x2b06af9719ac64d755623cda8ddd9b949f99a2ce711f3a31b2fc05604c93f179": "0x088eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4": "0x00000000",
"0x3a636f6465": "0x0061736d0100000001bf022e60037f7f7f017f60027f7f017f60027f7f0060047f7f7f7f0060017f0060017f017e60017e017f60017e0060037f7e7e0060027e7e0060027f7e017e60047f7e7e7e017f60017e017e60037f7e7f017f6000017e6000017f60027f7e017f60017f017f60037e7e7f017e60027f7f017e60037f7f7e017e60000060037f7f7f0060057f7f7f7f7f0060027e7f017f60057f7f7f7f7f017f60047f7f7f7f017f60027f7e0060077f7e7e7e7e7e7e0060087e7e7e7e7e7e7e7e017f60047e7e7e7e017f60047f7f7e7e0060057f7e7e7f7f0060047f7e7e7e0060057f7f7f7e7e0060067f7f7f7f7f7f0060057f7f7e7e7f0060077f7f7f7f7f7e7e0060067f7f7f7e7e7f0060077f7f7e7e7e7e7f0060067f7f7f7f7e7e0060057f7e7e7e7e0060077f7e7e7f7f7f7f0060027e7f0060047f7e7e7f0060067f7e7e7e7e7f0002a60b2403656e76066d656d6f727902001303656e761e6578745f68617368696e675f74776f785f3132385f76657273696f6e5f31000603656e76226578745f73746f726167655f636c6561725f7072656669785f76657273696f6e5f31000703656e76196578745f6c6f6767696e675f6c6f675f76657273696f6e5f31000803656e761d6578745f68617368696e675f74776f785f36345f76657273696f6e5f31000603656e76196578745f73746f726167655f7365745f76657273696f6e5f31000903656e761b6578745f73746f726167655f636c6561725f76657273696f6e5f31000703656e76206578745f68617368696e675f626c616b65325f3235365f76657273696f6e5f31000603656e76286578745f6f6666636861696e5f6c6f63616c5f73746f726167655f6765745f76657273696f6e5f31000a03656e76346578745f6f6666636861696e5f6c6f63616c5f73746f726167655f636f6d706172655f616e645f7365745f76657273696f6e5f31000b03656e76206578745f68617368696e675f626c616b65325f3132385f76657273696f6e5f31000603656e76196578745f73746f726167655f6765745f76657273696f6e5f31000c03656e761d6578745f6d6973635f7072696e745f757466385f76657273696f6e5f31000703656e76226578745f6d6973635f72756e74696d655f76657273696f6e5f76657273696f6e5f31000c03656e761e6578745f73746f726167655f6e6578745f6b65795f76657273696f6e5f31000c03656e76236578745f63727970746f5f737232353531395f7665726966795f76657273696f6e5f32000d03656e76286578745f6f6666636861696e5f6c6f63616c5f73746f726167655f7365745f76657273696f6e5f31000803656e76236578745f63727970746f5f656432353531395f7665726966795f76657273696f6e5f31000d03656e761c6578745f6d6973635f7072696e745f6e756d5f76657273696f6e5f31000703656e76206578745f68617368696e675f6b656363616b5f3235365f76657273696f6e5f31000603656e761a6578745f73746f726167655f726f6f745f76657273696f6e5f31000e03656e76226578745f73746f726167655f6368616e6765735f726f6f745f76657273696f6e5f31000c03656e761c6578745f6d6973635f7072696e745f6865785f76657273696f6e5f31000703656e76236578745f6f6666636861696e5f69735f76616c696461746f725f76657273696f6e5f31000f03656e76256578745f63727970746f5f656432353531395f67656e65726174655f76657273696f6e5f31001003656e76256578745f63727970746f5f737232353531395f67656e65726174655f76657273696f6e5f31001003656e762a6578745f747269655f626c616b65325f3235365f6f7264657265645f726f6f745f76657273696f6e5f31000603656e76246578745f6f6666636861696e5f6e6574776f726b5f73746174655f76657273696f6e5f31000e03656e76296578745f6f6666636861696e5f7375626d69745f7472616e73616374696f6e5f76657273696f6e5f31000c03656e761e6578745f616c6c6f6361746f725f6d616c6c6f635f76657273696f6e5f31001103656e761c6578745f616c6c6f6361746f725f667265655f76657273696f6e5f31000403656e761a6578745f73746f726167655f726561645f76657273696f6e5f31001203656e762c6578745f63727970746f5f736563703235366b315f65636473615f7265636f7665725f76657273696f6e5f31001303656e76376578745f63727970746f5f736563703235366b315f65636473615f7265636f7665725f636f6d707265737365645f76657273696f6e5f31001303656e76286578745f63727970746f5f737232353531395f7075626c69635f6b6579735f76657273696f6e5f31000503656e76216578745f63727970746f5f737232353531395f7369676e5f76657273696f6e5f310014039c069a06111104040000111113151515160216001517000101010201180405191a02020003010101020101011601010100030101000101000100040101020216021602020001010102010204010216031616161616161602161616161616161616161616161616161616161616161616161602021102111102020216021604040416160216021502160402161616041b0202021602161c1d0102041e1704030202001601031616020202020202020216020202040202020117161f02160203161616041604021602021620080804020204150402020202211602020202020201040202020202040202190216112202161602021623020424020201021e1f1904030316040402020211161602020f021616160202161603110216170202160202021602021603161502020216021616020202020211021616160404020302020202251601020401020202020202020302040404040404040404040404040404040404040215161602160216262602020216021602161602030202020216031102021611020302160304160316020216021602020216160302022702021616190409020202020202020402020202020217040404020404160216010204020204160202020216160202161602160102010402020001020402160202040402021616020201020302020417010101020104040402160104040402020204020202020204040202020302160216020216022802020216031f290204040402021602020202020204020102020216160202150202020202040001010416040204020204170216020302020f002a02020402021a020404040204040402040404032301021602040202020304040417020404020404020204040404040202020202020204040216020202160204040404020402011602030e020216040402022b170202021604040402020201030202010402040104040202020202150403161602160404020104Line truncated
"0x5f3e4907f716ac89b6347d15ececedca138e71612491192d68deab7e6f563fe1": "0x02000000",
"0x5f3e4907f716ac89b6347d15ececedcae1791577e4efcb083fdc3cb21e85b2e4": "0x00",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950ed43a85541921049696d6f6e80d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da96f2e33376834a63c86a195bcf685aebbfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x0000000003000064a7b3b6e00d00000000000000000000000000000000000000000000000000407a10f35a0000000000000000000000407a10f35a00000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca28dccb559b95c40168a1b2696581b5a7": "0x00000000000000000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca422adb579f1dbf4f3886c5cfa3bb8cc44f9aea1afa791265fae359272badc1cf8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e0b00407a10f35a0b00407a10f35a0000",
"0xf2794c22e353e9a839f12faab03a911bbdcb0c5143a8617ed38ae3810dd45bc6": "0x00000000",
"0x5f3e4907f716ac89b6347d15ececedca3ed14b45ed20d054f05e37e2542cfe70e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9007cbc1270b5b091758f9c42f5915b3e8ac59e11963af19174d0b94d5d78041c233f55d2e19324665bafdfb62925af2d": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da923a05cabf6d3bde7ca3ef0d11596b5611cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0xc2261276cc9d1f8598ea4b6a74b15c2f218f26c73add634897550b4003b26bc632a5935f6edc617ae178fef9eb1e211fbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x047374616b696e672000407a10f35a0000000000000000000002",
"0xc2261276cc9d1f8598ea4b6a74b15c2f218f26c73add634897550b4003b26bc66f2e33376834a63c86a195bcf685aebbfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x047374616b696e672000407a10f35a0000000000000000000002",
"0x5f3e4907f716ac89b6347d15ececedca682db92dde20a10d96d00ff0e9e221c0b4def25cfda6ef3a000000000e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x00",
"0x3a6772616e6470615f617574686f726974696573": "0x0108d17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae69010000000000000088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0100000000000000",
"0x5c0d1176a568c1f92944340dbfed9e9c530ebca703c85910e7164cb7d1c9e47b": "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x5f3e4907f716ac89b6347d15ececedca42982b9d6c7acc99faa9094c912372c2b4def25cfda6ef3a000000000e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x0b00407a10f35a0b00407a10f35a00",
"0x5f3e4907f716ac89b6347d15ececedcaa141c4fe67c2d11f4a10c6aca7a79a04b4def25cfda6ef3a00000000": "0x0080f420e6b500000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedcaf7dad0317324aecae8744b87fc95f2f3": "0x00",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa19505905fe216cc5924c6772616e80d17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae69": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0xcec5070d609dd3497f72bde07fc96ba0e0cdd062e6eaf24295ad4ccfc41d4609": "0x08fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860ed17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae698eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0eed43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x5f3e4907f716ac89b6347d15ececedcaea07de2b8f010516dca3f7ef52f7ac5a": "0x040000000000000000",
"0xc2261276cc9d1f8598ea4b6a74b15c2f308ce9615de0775a82f8a94dc3d285a1": "0x01",
"0x3a65787472696e7369635f696e646578": "0x00000000",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9b321d16960ce1d9190b61e2421cc60131e07379407fecc4b89eb7dbd287c2c781cfb1907a96947a3eb18e4f8e7198625": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa195066b8d48da86b869b6261626580d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x5f3e4907f716ac89b6347d15ececedca88dcde934c658227ee1dfafcd6e16903e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x00",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9e5e802737cce3a54b0bc9e3d3e6be26e306721211d5404bd9da88e0204360a1a9ab8b87c66c1bc2fcdd37f3c2222cc20": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedcaac0a2cbf8e355f5ea6cb2de8727bfb0c": "0x54000000",
"0x0b76934f4cc08dee01012d059e1b83ee5e0621c4869aa60c02be9adcc98a0d1d": "0x088eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x26aa394eea5630e07c48ae0c9558cef7a44704b568d21667356a5a050c118746b4def25cfda6ef3a00000000": "0x4545454545454545454545454545454545454545454545454545454545454545",
"0x5f3e4907f716ac89b6347d15ececedcab49a2738eeb30896aacb8b3fb46471bd": "0x01000000",
"0x5f3e4907f716ac89b6347d15ececedca422adb579f1dbf4f3886c5cfa3bb8cc4de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f0b00407a10f35a0b00407a10f35a0000",
"0x5f3e4907f716ac89b6347d15ececedca9220e172bed316605f73f1ff7b4ade98e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x00",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da932a5935f6edc617ae178fef9eb1e211fbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x0000000003000064a7b3b6e00d00000000000000000000000000000000000000000000000000407a10f35a0000000000000000000000407a10f35a00000000000000000000",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedcaad811cd65a470ddc5f1d628ff0550982b4def25cfda6ef3a00000000": "0x00000000",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950d62c40514b41f31962616265808eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950ed43a85541921049696d6f6e80d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x5f3e4907f716ac89b6347d15ececedca42982b9d6c7acc99faa9094c912372c2b4def25cfda6ef3a00000000e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x0b00407a10f35a0b00407a10f35a00",
"0xcec5070d609dd3497f72bde07fc96ba0ff3ae12770bea2e48d9bde7385e7a25f": "0x0000000002000000",
"0x5f3e4907f716ac89b6347d15ececedca8bde0a0ea8864605e3b68ed9cb2da01bb4def25cfda6ef3a000000000e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x0b00407a10f35a0b00407a10f35a00",
"0x1cb6f36e027abb2091cfb5110ab5087f5e0621c4869aa60c02be9adcc98a0d1d": "0x088eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a480100000000000000d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0100000000000000",
"0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb3e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0eed43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x5f3e4907f716ac89b6347d15ececedcae1791577e4efcb083fdc3cb21e85b2e4": "0x00",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da96f2e33376834a63c86a195bcf685aebbfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x0000000003000064a7b3b6e00d00000000000000000000000000000000000000000000000000407a10f35a0000000000000000000000407a10f35a00000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca8bde0a0ea8864605e3b68ed9cb2da01bb4def25cfda6ef3a00000000e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x0b00407a10f35a0b00407a10f35a00",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da923a05cabf6d3bde7ca3ef0d11596b5611cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedca42982b9d6c7acc99faa9094c912372c2b4def25cfda6ef3a000000000e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x0b00407a10f35a0b00407a10f35a00",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950246b6699fb8b8db670617261808eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0x5f3e4907f716ac89b6347d15ececedca5579297f4dfb9609e7e4c2ebab9ce40a": "0x08be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25ffe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9f3f619a1c2956443880db9cc9a13d058e860f1b1c7227f7c22602f53f15af80747814dffd839719731ee3bba6edc126c": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x5f3e4907f716ac89b6347d15ececedcaa141c4fe67c2d11f4a10c6aca7a79a04b4def25cfda6ef3a00000000": "0x0080f420e6b500000000000000000000",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa19505905fe216cc5924c6772616e80d17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae69": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0x5f3e4907f716ac89b6347d15ececedcaa3f6dd299ad3afa68580a25a73f6eabf": "0x00",
"0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb30e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0xd17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae698eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a488eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa195079b38849014a07307061726180d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x5f3e4907f716ac89b6347d15ececedca422adb579f1dbf4f3886c5cfa3bb8cc44f9aea1afa791265fae359272badc1cf8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e0b00407a10f35a0b00407a10f35a0000",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da94f9aea1afa791265fae359272badc1cf8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0xc2261276cc9d1f8598ea4b6a74b15c2f218f26c73add634897550b4003b26bc632a5935f6edc617ae178fef9eb1e211fbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x047374616b696e672000407a10f35a0000000000000000000002",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa19509d4a4cfe1c2ef0b961756469808eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0x1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4": "0x00000000",
"0x26aa394eea5630e07c48ae0c9558cef7a44704b568d21667356a5a050c118746b4def25cfda6ef3a00000000": "0x4545454545454545454545454545454545454545454545454545454545454545",
"0x5f3e4907f716ac89b6347d15ececedca487df464e44a534ba6b0cbb32407b587": "0x0000000000",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9e5e802737cce3a54b0bc9e3d3e6be26e306721211d5404bd9da88e0204360a1a9ab8b87c66c1bc2fcdd37f3c2222cc20": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa19500e3a507571a62417696d6f6e808eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950f5537bdb2a1f626b6772616e8088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x2371e21684d2fae99bcb4d579242f74a8a2d09463effcc78a22d75b9cb87dffc": "0x0000000000000000",
"0x26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc": "0x4545454545454545454545454545454545454545454545454545454545454545",
"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa195066b8d48da86b869b6261626580d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8": "0x501c77657374656e64",
"0xcec5070d609dd3497f72bde07fc96ba098ef7dc060436e4ed803af07632b89b6b4def25cfda6ef3a00000000": "0x80295972334c304495eb0c9a77aa78b91a544721a4455c0d2a13fbe7f2feba8c02000000",
"0x5f3e4907f716ac89b6347d15ececedca682db92dde20a10d96d00ff0e9e221c0b4def25cfda6ef3a00000000e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f": "0x00",
"0xc2261276cc9d1f8598ea4b6a74b15c2f218f26c73add634897550b4003b26bc66f2e33376834a63c86a195bcf685aebbfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x047374616b696e672000407a10f35a0000000000000000000002",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9b0edae20838083f2cde1c4080db8cf8090b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0x26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8": "0xb90f20706f6c6b61646f74"
"0x2099d7f109d6e535fb000bba623fd4409f99a2ce711f3a31b2fc05604c93f179": "0x088eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x5f3e4907f716ac89b6347d15ececedca3ed14b45ed20d054f05e37e2542cfe700e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48",
"0x5f3e4907f716ac89b6347d15ececedcaf7dad0317324aecae8744b87fc95f2f3": "0x00",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9007cbc1270b5b091758f9c42f5915b3e8ac59e11963af19174d0b94d5d78041c233f55d2e19324665bafdfb62925af2d": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"0xc2261276cc9d1f8598ea4b6a74b15c2f308ce9615de0775a82f8a94dc3d285a1": "0x01",
"0xcec5070d609dd3497f72bde07fc96ba088dcde934c658227ee1dfafcd6e16903": "0x08fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860ebe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",
"0x5f3e4907f716ac89b6347d15ececedca88dcde934c658227ee1dfafcd6e169030e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x00",
"0x5f3e4907f716ac89b6347d15ececedca138e71612491192d68deab7e6f563fe1": "0x02000000",
"0x3fba98689ebed1138735e0e7a5a790ab0b76934f4cc08dee01012d059e1b83ee": "0x00",
"0x5f3e4907f716ac89b6347d15ececedca308ce9615de0775a82f8a94dc3d285a1": "0x02",
"0x5f3e4907f716ac89b6347d15ececedcac29a0310e1bb45d20cace77ccb62c97d": "0x00e1f505",
"0x5c0d1176a568c1f92944340dbfed9e9c530ebca703c85910e7164cb7d1c9e47b": "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x5f3e4907f716ac89b6347d15ececedcaac0a2cbf8e355f5ea6cb2de8727bfb0c": "0x54000000",
"0xcec5070d609dd3497f72bde07fc96ba098ef7dc060436e4ed803af07632b89b65153cb1f00942ff401000000": "0x80295972334c304495eb0c9a77aa78b91a544721a4455c0d2a13fbe7f2feba8c02000000",
"0x5f3e4907f716ac89b6347d15ececedcab49a2738eeb30896aacb8b3fb46471bd": "0x01000000",
"0x5f3e4907f716ac89b6347d15ececedca9220e172bed316605f73f1ff7b4ade980e5be00fbc2e15b5fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e": "0x00",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9b321d16960ce1d9190b61e2421cc60131e07379407fecc4b89eb7dbd287c2c781cfb1907a96947a3eb18e4f8e7198625": "0x0000000000000064a7b3b6e00d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
"childrenDefault": {}
}
+38 -26
View File
@@ -25,7 +25,6 @@ frame-support = { git = "https://github.com/paritytech/substrate", default-featu
frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
pallet-indices = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
@@ -34,35 +33,48 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate",
# Cumulus dependencies
cumulus-runtime = { path = "../../../runtime", default-features = false }
cumulus-parachain-upgrade = { path = "../../../parachain-upgrade", default-features = false }
cumulus-message-broker = { path = "../../../message-broker", default-features = false }
cumulus-upward-message = { path = "../../../upward-message", default-features = false }
cumulus-primitives = { path = "../../../primitives", default-features = false }
# Polkadot dependencies
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch", default-features = false }
[build-dependencies]
wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.0.6" }
[features]
default = ['std']
default = [ "std" ]
std = [
'codec/std',
'serde',
'sp-api/std',
'sp-std/std',
'sp-io/std',
'sp-core/std',
'sp-runtime/std',
'sp-version/std',
'sp-offchain/std',
'sp-session/std',
'sp-block-builder/std',
'sp-transaction-pool/std',
'sp-inherents/std',
'frame-support/std',
'frame-executive/std',
'frame-system/std',
'pallet-balances/std',
'pallet-indices/std',
'pallet-randomness-collective-flip/std',
'pallet-timestamp/std',
'pallet-sudo/std',
'pallet-transaction-payment/std',
'cumulus-runtime/std',
'cumulus-parachain-upgrade/std',
"codec/std",
"serde",
"sp-api/std",
"sp-std/std",
"sp-io/std",
"sp-core/std",
"sp-runtime/std",
"sp-version/std",
"sp-offchain/std",
"sp-session/std",
"sp-block-builder/std",
"sp-transaction-pool/std",
"sp-inherents/std",
"frame-support/std",
"frame-executive/std",
"frame-system/std",
"pallet-balances/std",
"pallet-randomness-collective-flip/std",
"pallet-timestamp/std",
"pallet-sudo/std",
"pallet-transaction-payment/std",
"cumulus-runtime/std",
"cumulus-parachain-upgrade/std",
"cumulus-message-broker/std",
"cumulus-upward-message/std",
"cumulus-primitives/std",
"polkadot-parachain/std",
]
# Will be enabled by the `wasm-builder` when building the runtime for WASM.
runtime-wasm = [
"cumulus-upward-message/runtime-wasm",
]
+41 -21
View File
@@ -26,20 +26,22 @@ use sp_api::impl_runtime_apis;
use sp_core::OpaqueMetadata;
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
traits::{BlakeTwo256, Block as BlockT, Saturating, StaticLookup, Verify},
traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, IdentityLookup, Saturating, Verify},
transaction_validity::{TransactionSource, TransactionValidity},
AnySignature, ApplyExtrinsicResult,
ApplyExtrinsicResult, MultiSignature,
};
use sp_std::prelude::*;
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
mod message_example;
// A few exports that help ease life for downstream crates.
pub use frame_support::{
construct_runtime, parameter_types,
traits::Randomness,
weights::{IdentityFee, Weight},
weights::{constants::WEIGHT_PER_SECOND, IdentityFee, Weight},
StorageValue,
};
pub use pallet_balances::Call as BalancesCall;
@@ -52,11 +54,11 @@ pub use sp_runtime::{Perbill, Permill};
pub type BlockNumber = u32;
/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.
pub type Signature = AnySignature;
pub type Signature = MultiSignature;
/// Some way of identifying an account on the chain. We intentionally make it equivalent
/// to the public key of our transaction signing scheme.
pub type AccountId = <Signature as Verify>::Signer;
pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;
/// The type for looking up accounts. We don't expect more than 4 billion of them, but you
/// never know...
@@ -122,6 +124,12 @@ pub const DAYS: BlockNumber = HOURS * 24;
// 1 in 4 blocks (on average, not counting collisions) will be primary babe blocks.
pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4);
#[derive(codec::Encode, codec::Decode)]
pub enum XCMPMessage<XAccountId, XBalance> {
/// Transfer tokens to the given account from the Parachain account.
TransferToken(XAccountId, XBalance),
}
/// The version infromation used to identify this runtime when compiled natively.
#[cfg(feature = "std")]
pub fn native_version() -> NativeVersion {
@@ -133,7 +141,7 @@ pub fn native_version() -> NativeVersion {
parameter_types! {
pub const BlockHashCount: BlockNumber = 250;
pub const MaximumBlockWeight: Weight = 1_000_000;
pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
/// Assume 10% of weight for average on_initialize calls.
pub MaximumExtrinsicWeight: Weight = AvailableBlockRatio::get()
.saturating_sub(Perbill::from_percent(10)) * MaximumBlockWeight::get();
@@ -149,7 +157,7 @@ impl frame_system::Trait for Runtime {
/// The aggregated dispatch type that is available for extrinsics.
type Call = Call;
/// The lookup mechanism to get account ID from whatever is passed in dispatchers.
type Lookup = Indices;
type Lookup = IdentityLookup<AccountId>;
/// The index type for storing how many extrinsics an account has signed.
type Index = Index;
/// The index type for blocks.
@@ -178,24 +186,13 @@ impl frame_system::Trait for Runtime {
type ModuleToIndex = ModuleToIndex;
type AccountData = pallet_balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = Balances;
type OnKilledAccount = ();
type DbWeight = ();
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
type BlockExecutionWeight = ();
type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
}
parameter_types! {
pub const IndexDeposit: Balance = 1;
}
impl pallet_indices::Trait for Runtime {
type AccountIndex = u32;
type Event = Event;
type Currency = Balances;
type Deposit = IndexDeposit;
}
parameter_types! {
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
}
@@ -242,6 +239,27 @@ impl cumulus_parachain_upgrade::Trait for Runtime {
type OnValidationFunctionParams = ();
}
parameter_types! {
pub storage ParachainId: cumulus_primitives::ParaId = 100.into();
}
impl cumulus_message_broker::Trait for Runtime {
type Event = Event;
type DownwardMessageHandlers = TokenDealer;
type UpwardMessage = cumulus_upward_message::WestendUpwardMessage;
type ParachainId = ParachainId;
type XCMPMessage = XCMPMessage<AccountId, Balance>;
type XCMPMessageHandlers = TokenDealer;
}
impl message_example::Trait for Runtime {
type Event = Event;
type UpwardMessageSender = MessageBroker;
type UpwardMessage = cumulus_upward_message::WestendUpwardMessage;
type Currency = Balances;
type XCMPMessageSender = MessageBroker;
}
construct_runtime! {
pub enum Runtime where
Block = Block,
@@ -250,16 +268,18 @@ construct_runtime! {
{
System: frame_system::{Module, Call, Storage, Config, Event<T>},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
Indices: pallet_indices::{Module, Call, Storage, Config<T>, Event<T>},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
Sudo: pallet_sudo::{Module, Call, Storage, Config<T>, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
ParachainUpgrade: cumulus_parachain_upgrade::{Module, Call, Storage, Inherent, Event},
MessageBroker: cumulus_message_broker::{Module, Call, Inherent, Event<T>},
TokenDealer: message_example::{Module, Call, Event<T>, Config},
TransactionPayment: pallet_transaction_payment::{Module, Storage},
}
}
/// The address format for describing accounts.
pub type Address = <Indices as StaticLookup>::Source;
pub type Address = AccountId;
/// Block header type as expected by this runtime.
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// Block type as expected by this runtime.
@@ -0,0 +1,179 @@
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Example Pallet that shows how to send upward messages and how to receive
//! downward messages.
use frame_support::{
decl_event, decl_module, decl_storage,
traits::{Currency, ExistenceRequirement, WithdrawReason},
};
use frame_system::ensure_signed;
use crate::XCMPMessage;
use codec::{Decode, Encode};
use cumulus_primitives::{
relay_chain::DownwardMessage,
xcmp::{XCMPMessageHandler, XCMPMessageSender},
DownwardMessageHandler, ParaId, UpwardMessageOrigin, UpwardMessageSender,
};
use cumulus_upward_message::BalancesMessage;
use polkadot_parachain::primitives::AccountIdConversion;
use sp_runtime::DispatchResult;
type BalanceOf<T> =
<<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
/// Configuration trait of this pallet.
pub trait Trait: frame_system::Trait {
/// Event type used by the runtime.
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
/// The sender of upward messages.
type UpwardMessageSender: UpwardMessageSender<Self::UpwardMessage>;
/// The upward message type used by the Parachain runtime.
type UpwardMessage: codec::Codec + BalancesMessage<Self::AccountId, BalanceOf<Self>>;
/// Currency of the runtime.
type Currency: Currency<Self::AccountId>;
/// The sender of XCMP messages.
type XCMPMessageSender: XCMPMessageSender<XCMPMessage<Self::AccountId, BalanceOf<Self>>>;
}
// This pallet's storage items.
decl_storage! {
trait Store for Module<T: Trait> as ParachainUpgrade {}
add_extra_genesis {
config(parachain_id): ParaId;
build(|config: &Self| {
// This is basically a hack to make the parachain id easily configurable.
// Could also be done differently, but yeah..
crate::ParachainId::set(&config.parachain_id);
});
}
}
decl_event! {
pub enum Event<T> where
AccountId = <T as frame_system::Trait>::AccountId,
Balance = BalanceOf<T>
{
/// Transferred tokens to the account on the relay chain.
TransferredTokensToRelayChain(AccountId, Balance),
/// Transferred tokens to the account on request from the relay chain.
TransferredTokensFromRelayChain(AccountId, Balance),
/// Transferred tokens to the account from the given parachain account.
TransferredTokensViaXCMP(ParaId, AccountId, Balance, DispatchResult),
}
}
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system = frame_system {
/// Transfer `amount` of tokens on the relay chain from the Parachain account to
/// the given `dest` account.
#[weight = 10]
fn transfer_tokens_to_relay_chain(origin, dest: T::AccountId, amount: BalanceOf<T>) {
let who = ensure_signed(origin)?;
let _ = T::Currency::withdraw(
&who,
amount,
WithdrawReason::Transfer.into(),
ExistenceRequirement::AllowDeath,
)?;
let msg = <T as Trait>::UpwardMessage::transfer(dest.clone(), amount.clone());
<T as Trait>::UpwardMessageSender::send_upward_message(&msg, UpwardMessageOrigin::Signed)
.expect("Should not fail; qed");
Self::deposit_event(Event::<T>::TransferredTokensToRelayChain(dest, amount));
}
/// Transfer `amount` of tokens to another parachain.
#[weight = 10]
fn transfer_tokens_to_parachain_chain(
origin,
para_id: u32,
dest: T::AccountId,
amount: BalanceOf<T>,
) {
//TODO we don't make sure that the parachain has some tokens on the other parachain.
let who = ensure_signed(origin)?;
let _ = T::Currency::withdraw(
&who,
amount,
WithdrawReason::Transfer.into(),
ExistenceRequirement::AllowDeath,
)?;
T::XCMPMessageSender::send_xcmp_message(
para_id.into(),
&XCMPMessage::TransferToken(dest, amount),
).expect("Should not fail; qed");
}
fn deposit_event() = default;
}
}
/// This is a hack to convert from one generic type to another where we are sure that both are the
/// same type/use the same encoding.
fn convert_hack<O: Decode>(input: &impl Encode) -> O {
input.using_encoded(|e| Decode::decode(&mut &e[..]).expect("Must be compatible; qed"))
}
impl<T: Trait> DownwardMessageHandler for Module<T> {
fn handle_downward_message(msg: &DownwardMessage) {
match msg {
DownwardMessage::TransferInto(dest, amount, _) => {
let dest = convert_hack(&dest);
let amount: BalanceOf<T> = convert_hack(amount);
let _ = T::Currency::deposit_creating(&dest, amount.clone());
Self::deposit_event(Event::<T>::TransferredTokensFromRelayChain(dest, amount));
}
_ => {}
}
}
}
impl<T: Trait> XCMPMessageHandler<XCMPMessage<T::AccountId, BalanceOf<T>>> for Module<T> {
fn handle_xcmp_message(src: ParaId, msg: &XCMPMessage<T::AccountId, BalanceOf<T>>) {
match msg {
XCMPMessage::TransferToken(dest, amount) => {
let para_account = src.clone().into_account();
let res = T::Currency::transfer(
&para_account,
dest,
amount.clone(),
ExistenceRequirement::AllowDeath,
);
Self::deposit_event(Event::<T>::TransferredTokensViaXCMP(
src,
dest.clone(),
amount.clone(),
res,
));
}
}
}
}
+34 -37
View File
@@ -14,11 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
use cumulus_primitives::ParaId;
use parachain_runtime::{
AccountId, BalancesConfig, GenesisConfig, IndicesConfig, SudoConfig, SystemConfig, WASM_BINARY,
AccountId, BalancesConfig, GenesisConfig, Signature, SudoConfig, SystemConfig,
TokenDealerConfig, WASM_BINARY,
};
use sc_service;
use sp_core::{Pair, Public};
use sc_service::ChainType;
use sp_core::{sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};
/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig>;
@@ -30,42 +33,39 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu
.public()
}
/// Helper function to generate stash, controller and session key from seed
pub fn get_authority_keys_from_seed(seed: &str) -> (AccountId, AccountId) {
(
get_from_seed::<AccountId>(&format!("{}//stash", seed)),
get_from_seed::<AccountId>(seed),
)
type AccountPublic = <Signature as Verify>::Signer;
/// Helper function to generate an account ID from seed
pub fn get_account_id_from_seed<TPublic: Public>(seed: &str) -> AccountId
where
AccountPublic: From<<TPublic::Pair as Pair>::Public>,
{
AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()
}
/// Returns the chain spec.
pub fn get_chain_spec() -> ChainSpec {
pub fn get_chain_spec(id: ParaId) -> ChainSpec {
ChainSpec::from_genesis(
"Local Testnet",
"parachain_local_testnet",
sc_service::ChainType::Local,
|| {
"local_testnet",
ChainType::Local,
move || {
testnet_genesis(
get_account_id_from_seed::<sr25519::Public>("Alice"),
vec![
get_authority_keys_from_seed("Alice"),
get_authority_keys_from_seed("Bob"),
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Charlie"),
get_account_id_from_seed::<sr25519::Public>("Dave"),
get_account_id_from_seed::<sr25519::Public>("Eve"),
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
get_from_seed::<AccountId>("Alice"),
vec![
get_from_seed::<AccountId>("Alice"),
get_from_seed::<AccountId>("Bob"),
get_from_seed::<AccountId>("Charlie"),
get_from_seed::<AccountId>("Dave"),
get_from_seed::<AccountId>("Eve"),
get_from_seed::<AccountId>("Ferdie"),
get_from_seed::<AccountId>("Alice//stash"),
get_from_seed::<AccountId>("Bob//stash"),
get_from_seed::<AccountId>("Charlie//stash"),
get_from_seed::<AccountId>("Dave//stash"),
get_from_seed::<AccountId>("Eve//stash"),
get_from_seed::<AccountId>("Ferdie//stash"),
],
true,
id,
)
},
vec![],
@@ -77,19 +77,15 @@ pub fn get_chain_spec() -> ChainSpec {
}
fn testnet_genesis(
_initial_authorities: Vec<(AccountId, AccountId)>,
root_key: AccountId,
endowed_accounts: Vec<AccountId>,
_enable_println: bool,
id: ParaId,
) -> GenesisConfig {
GenesisConfig {
frame_system: Some(SystemConfig {
code: WASM_BINARY.to_vec(),
changes_trie_config: Default::default(),
}),
pallet_indices: Some(IndicesConfig {
indices: vec![],
}),
pallet_balances: Some(BalancesConfig {
balances: endowed_accounts
.iter()
@@ -98,5 +94,6 @@ fn testnet_genesis(
.collect(),
}),
pallet_sudo: Some(SudoConfig { key: root_key }),
message_example: Some(TokenDealerConfig { parachain_id: id }),
}
}
+23 -1
View File
@@ -42,6 +42,28 @@ pub struct ExportGenesisStateCommand {
/// Output file name or stdout if unspecified.
#[structopt(parse(from_os_str))]
pub output: Option<PathBuf>,
/// Id of the parachain this state is for.
#[structopt(long, default_value = "100")]
pub parachain_id: u32,
}
#[derive(Debug, StructOpt)]
pub struct RunCmd {
#[structopt(flatten)]
pub base: sc_cli::RunCmd,
/// Id of the parachain this collator collates for.
#[structopt(long, default_value = "100")]
pub parachain_id: u32,
}
impl std::ops::Deref for RunCmd {
type Target = sc_cli::RunCmd;
fn deref(&self) -> &Self::Target {
&self.base
}
}
#[derive(Debug, StructOpt)]
@@ -55,7 +77,7 @@ pub struct Cli {
pub subcommand: Option<Subcommand>,
#[structopt(flatten)]
pub run: sc_cli::RunCmd,
pub run: RunCmd,
/// Relaychain arguments
#[structopt(raw = true)]
+37 -25
View File
@@ -19,6 +19,7 @@ use crate::cli::{Cli, PolkadotCli, Subcommand};
use codec::Encode;
use log::info;
use parachain_runtime::Block;
use polkadot_parachain::primitives::AccountIdConversion;
use sc_cli::{
CliConfiguration, Error, ImportParams, KeystoreParams, NetworkParams, Result, SharedParams,
SubstrateCli,
@@ -30,8 +31,8 @@ use sp_runtime::{
traits::{Block as BlockT, Hash as HashT, Header as HeaderT, Zero},
BuildStorage,
};
use std::net::SocketAddr;
use std::sync::Arc;
use std::{net::SocketAddr, sync::Arc};
use cumulus_primitives::ParaId;
impl SubstrateCli for Cli {
fn impl_name() -> &'static str {
@@ -66,7 +67,8 @@ impl SubstrateCli for Cli {
}
fn load_spec(&self, _id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(Box::new(chain_spec::get_chain_spec()))
// Such a hack :(
Ok(Box::new(chain_spec::get_chain_spec(self.run.parachain_id.into())))
}
}
@@ -114,23 +116,21 @@ impl SubstrateCli for PolkadotCli {
}
}
fn generate_genesis_state() -> Result<Block> {
let storage = (&chain_spec::get_chain_spec()).build_storage()?;
fn generate_genesis_state(para_id: ParaId) -> Result<Block> {
let storage = (&chain_spec::get_chain_spec(para_id)).build_storage()?;
let child_roots = storage.children_default.iter().map(|(sk, child_content)| {
let state_root =
<<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
child_content.data.clone().into_iter().collect(),
);
let state_root = <<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
child_content.data.clone().into_iter().collect(),
);
(sk.clone(), state_root.encode())
});
let state_root = <<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
storage.top.clone().into_iter().chain(child_roots).collect(),
);
let extrinsics_root = <<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
Vec::new(),
);
let extrinsics_root =
<<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(Vec::new());
Ok(Block::new(
<<Block as BlockT>::Header as HeaderT>::new(
@@ -157,7 +157,7 @@ pub fn run() -> Result<()> {
Some(Subcommand::ExportGenesisState(params)) => {
sc_cli::init_logger("");
let block = generate_genesis_state()?;
let block = generate_genesis_state(params.parachain_id.into())?;
let header_hex = format!("0x{:?}", HexDisplay::from(&block.header().encode()));
if let Some(output) = &params.output {
@@ -174,13 +174,14 @@ pub fn run() -> Result<()> {
let grandpa_pause = if polkadot_cli.run.grandpa_pause.is_empty() {
None
} else {
Some((polkadot_cli.run.grandpa_pause[0], polkadot_cli.run.grandpa_pause[1]))
Some((
polkadot_cli.run.grandpa_pause[0],
polkadot_cli.run.grandpa_pause[1],
))
};
runner.run_node(
|config| {
polkadot_service::polkadot_new_light(config)
},
|config| polkadot_service::polkadot_new_light(config),
|config| {
polkadot_service::polkadot_new_full(
config,
@@ -190,22 +191,23 @@ pub fn run() -> Result<()> {
6000,
grandpa_pause,
None,
).map(|(s, _, _)| s)
)
.map(|(s, _, _)| s)
},
polkadot_service::PolkadotExecutor::native_version().runtime_version
polkadot_service::PolkadotExecutor::native_version().runtime_version,
)
},
}
Some(Subcommand::PolkadotValidationWorker(cmd)) => {
sc_cli::init_logger("");
polkadot_service::run_validation_worker(&cmd.mem_id)?;
Ok(())
},
}
None => {
let runner = cli.create_runner(&cli.run)?;
let runner = cli.create_runner(&*cli.run)?;
// TODO
let key = Arc::new(sp_core::Pair::from_seed(&[10; 32]));
let key = Arc::new(sp_core::Pair::generate().0);
let mut polkadot_cli = PolkadotCli::from_iter(
[PolkadotCli::executable_name().to_string()]
@@ -213,6 +215,14 @@ pub fn run() -> Result<()> {
.chain(cli.relaychain_args.iter()),
);
let id = ParaId::from(cli.run.parachain_id);
let parachain_account =
AccountIdConversion::<polkadot_primitives::AccountId>::into_account(&id);
let block = generate_genesis_state(id)?;
let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode()));
runner.run_full_node(
|config| {
polkadot_cli.base_path =
@@ -226,9 +236,11 @@ pub fn run() -> Result<()> {
)
.unwrap();
info!("Parachain id: {:?}", crate::PARA_ID);
info!("Parachain id: {:?}", id);
info!("Parachain Account: {}", parachain_account);
info!("Parachain genesis state: {}", genesis_state);
crate::service::run_collator(config, key, polkadot_config)
crate::service::run_collator(config, key, polkadot_config, id)
},
parachain_runtime::VERSION,
)
-5
View File
@@ -19,17 +19,12 @@
#![warn(missing_docs)]
#![warn(unused_extern_crates)]
use polkadot_primitives::parachain::Id as ParaId;
mod chain_spec;
#[macro_use]
mod service;
mod cli;
mod command;
/// The parachain id of this parachain.
pub const PARA_ID: ParaId = ParaId::new(100);
fn main() -> sc_cli::Result<()> {
command::run()
}
+21 -29
View File
@@ -15,15 +15,17 @@
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
use ansi_term::Color;
use std::sync::Arc;
use sc_executor::native_executor_instance;
use sc_service::{AbstractService, Configuration};
use sc_finality_grandpa::{FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider};
use polkadot_primitives::parachain::CollatorPair;
use cumulus_collator::{CollatorBuilder, prepare_collator_config};
use futures::FutureExt;
pub use sc_executor::NativeExecutor;
use cumulus_collator::{prepare_collator_config, CollatorBuilder};
use cumulus_network::DelayedBlockAnnounceValidator;
use futures::FutureExt;
use polkadot_primitives::parachain::CollatorPair;
use sc_executor::native_executor_instance;
pub use sc_executor::NativeExecutor;
use sc_finality_grandpa::{
FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider,
};
use sc_service::{AbstractService, Configuration};
use std::sync::Arc;
// Our native executor instance.
native_executor_instance!(
@@ -47,9 +49,8 @@ macro_rules! new_full_start {
>($config)?
.with_select_chain(|_config, backend| Ok(sc_consensus::LongestChain::new(backend.clone())))?
.with_transaction_pool(|builder| {
let pool_api = Arc::new(sc_transaction_pool::FullChainApi::new(
builder.client().clone(),
));
let client = builder.client();
let pool_api = Arc::new(sc_transaction_pool::FullChainApi::new(client.clone()));
let pool = sc_transaction_pool::BasicPool::new(
builder.config().transaction_pool.clone(),
pool_api,
@@ -57,19 +58,12 @@ macro_rules! new_full_start {
);
Ok(pool)
})?
.with_import_queue(|
_config,
client,
_,
_,
spawn_task_handle,
registry,
| {
.with_import_queue(|_config, client, _, _, spawner, registry| {
let import_queue = cumulus_consensus::import_queue::import_queue(
client.clone(),
client,
inherent_data_providers.clone(),
spawn_task_handle,
spawner,
registry,
)?;
@@ -87,6 +81,7 @@ pub fn run_collator(
parachain_config: Configuration,
key: Arc<CollatorPair>,
polkadot_config: polkadot_collator::Configuration,
id: polkadot_primitives::parachain::Id,
) -> sc_service::error::Result<impl AbstractService> {
let parachain_config = prepare_collator_config(parachain_config);
@@ -104,9 +99,7 @@ pub fn run_collator(
let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
})?
.with_block_announce_validator(|_client| {
Box::new(block_announce_validator_copy)
})?
.with_block_announce_validator(|_client| Box::new(block_announce_validator_copy))?
.build_full()?;
let registry = service.prometheus_registry();
@@ -120,14 +113,12 @@ pub fn run_collator(
let block_import = service.client();
let client = service.client();
let network = service.network();
let announce_block = Arc::new(move |hash, data| {
network.announce_block(hash, data)
});
let announce_block = Arc::new(move |hash, data| network.announce_block(hash, data));
let builder = CollatorBuilder::new(
proposer_factory,
inherent_data_providers,
block_import,
crate::PARA_ID,
id,
client,
announce_block,
block_announce_validator,
@@ -135,11 +126,12 @@ pub fn run_collator(
let polkadot_future = polkadot_collator::start_collator(
builder,
crate::PARA_ID,
id,
key,
polkadot_config,
Some(format!("[{}] ", Color::Blue.bold().paint("Relaychain"))),
).map(|_| ());
)
.map(|_| ());
service.spawn_essential_task("polkadot", polkadot_future);
Ok(service)
@@ -48,6 +48,6 @@ fn purge_chain_works() {
assert!(status.success());
// Make sure that the `parachain_local_testnet` chain folder exists, but the `db` is deleted.
assert!(PathBuf::from(base_path).join("chains/parachain_local_testnet/").exists());
assert!(!PathBuf::from(base_path).join("chains/parachain_local_testnet/db").exists());
assert!(PathBuf::from(base_path).join("chains/local_testnet/").exists());
assert!(!PathBuf::from(base_path).join("chains/local_testnet/db").exists());
}
+1 -1
View File
@@ -7,7 +7,7 @@ build = "build.rs"
[dependencies]
runtime = { package = "cumulus-runtime", path = "../../runtime", default-features = false }
substrate-test-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch", version = "2.0.0-rc2" }
substrate-test-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cumulus-branch" }
[build-dependencies]
wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = " 1.0.6" }
+39
View File
@@ -0,0 +1,39 @@
[package]
name = "cumulus-upward-message"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
# Substrate dependencies
sp-std = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", default-features = false }
# Polkadot deps
polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch", default-features = false }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch", default-features = false }
# All these should be optional dependenices, but given the perfect Cargo, it is not possible.
polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch", default-features = false }
kusama-runtime = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch", default-features = false }
westend-runtime = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch", default-features = false }
[features]
default = [ "std" ]
std = [
"sp-std/std",
"polkadot-runtime/std",
"kusama-runtime/std",
"westend-runtime/std",
"polkadot-core-primitives/std",
"polkadot-parachain/std",
]
# Should be enabled by when compiling the runtime for WASM.
#
# This disables the runtime api of the Polkadot/Kusama/Westend
# runtimes to not clash with the runtime api of the Parachain when building
# for WASM.
runtime-wasm = [
"polkadot-runtime/disable-runtime-api",
"westend-runtime/disable-runtime-api",
"kusama-runtime/disable-runtime-api",
]
+37
View File
@@ -0,0 +1,37 @@
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Substrate is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Kusama upward message
use crate::*;
use polkadot_core_primitives::{Balance, AccountId};
use kusama_runtime::{BalancesCall, ParachainsCall};
use sp_std::vec::Vec;
/// The Kusama upward message.
pub type UpwardMessage = kusama_runtime::Call;
impl BalancesMessage<AccountId, Balance> for UpwardMessage {
fn transfer(dest: AccountId, amount: Balance) -> Self {
BalancesCall::transfer(dest, amount).into()
}
}
impl XCMPMessage for UpwardMessage {
fn send_message(dest: ParaId, msg: Vec<u8>) -> Self {
ParachainsCall::send_xcmp_message(dest, msg).into()
}
}
+47
View File
@@ -0,0 +1,47 @@
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Substrate is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Upward messages types and traits for Polkadot, Kusama and Westend.
//!
//! As Cumulus needs to suits multiple Polkadot-like runtimes the upward message
//! type is different for each of them. To support all of them, Cumulus provides
//! traits to write upward message generic code.
#![cfg_attr(not(feature = "std"), no_std)]
use polkadot_parachain::primitives::Id as ParaId;
use sp_std::vec::Vec;
mod polkadot;
mod kusama;
mod westend;
pub use polkadot::UpwardMessage as PolkadotUpwardMessage;
pub use kusama::UpwardMessage as KusamaUpwardMessage;
pub use westend::UpwardMessage as WestendUpwardMessage;
/// A `Balances` related upward message.
pub trait BalancesMessage<AccountId, Balance>: Sized {
/// Transfer the given `amount` from the parachain account to the given
/// `dest` account.
fn transfer(dest: AccountId, amount: Balance) -> Self;
}
/// A `XCMP` related upward message.
pub trait XCMPMessage: Sized {
/// Send the given XCMP message to given parachain.
fn send_message(dest: ParaId, msg: Vec<u8>) -> Self;
}
+37
View File
@@ -0,0 +1,37 @@
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Substrate is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Polkadot upward message
use crate::*;
use polkadot_core_primitives::{Balance, AccountId};
use polkadot_runtime::{BalancesCall, ParachainsCall};
use sp_std::vec::Vec;
/// The Polkadot upward message.
pub type UpwardMessage = polkadot_runtime::Call;
impl BalancesMessage<AccountId, Balance> for UpwardMessage {
fn transfer(dest: AccountId, amount: Balance) -> Self {
BalancesCall::transfer(dest, amount).into()
}
}
impl XCMPMessage for UpwardMessage {
fn send_message(dest: ParaId, msg: Vec<u8>) -> Self {
ParachainsCall::send_xcmp_message(dest, msg).into()
}
}
+37
View File
@@ -0,0 +1,37 @@
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Substrate is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Westend upward message
use crate::*;
use polkadot_core_primitives::{Balance, AccountId};
use westend_runtime::{BalancesCall, ParachainsCall};
use sp_std::vec::Vec;
/// The Westend upward message.
pub type UpwardMessage = westend_runtime::Call;
impl BalancesMessage<AccountId, Balance> for UpwardMessage {
fn transfer(dest: AccountId, amount: Balance) -> Self {
BalancesCall::transfer(dest, amount).into()
}
}
impl XCMPMessage for UpwardMessage {
fn send_message(dest: ParaId, msg: Vec<u8>) -> Self {
ParachainsCall::send_xcmp_message(dest, msg).into()
}
}