This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 371
Update polkadot & substrate #76
Merged
Merged
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
838d729
Initial commit
cecton 34c80e0
Change substrate and polkadot branch to cecton-cumulus-branch
cecton 94571a5
WIP
cecton 730390a
WIP
cecton 73543b2
WIP
cecton fd70177
WIP
cecton 911645f
WIP
cecton 132bfea
WIP
cecton df1e696
WIP
cecton 45db8aa
WIP
cecton b173102
WIP
cecton bb9e23b
WIP
cecton e16af0a
WIP
cecton 5880ab1
update .editorconfig
cecton 5fbdbc0
should probably be --dev
cecton 17f36db
formatting
cecton 152f041
Update polkadot & substrate branches
cecton 1fde472
WIP
cecton 786dbaf
Some fixes
bkchr c455b98
Updated polkadot
cecton 548163f
Update test/parachain/src/chain_spec.rs
cecton 0a149d2
Update test/parachain/src/command.rs
cecton 79415d6
WIP
cecton 4de3833
Switch back cecton-cumulus-branch to cumulus-branch
cecton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,8 +31,8 @@ use polkadot_collator::{ | |
| PolkadotClient, | ||
| }; | ||
| use polkadot_primitives::{ | ||
| parachain::{self, BlockData, LocalValidationData, Id as ParaId}, Block as PBlock, | ||
| Hash as PHash, | ||
| parachain::{self, BlockData, GlobalValidationSchedule, LocalValidationData, Id as ParaId}, | ||
| Block as PBlock, Hash as PHash, | ||
| }; | ||
|
|
||
| use codec::{Decode, Encode}; | ||
|
|
@@ -111,15 +111,16 @@ where | |
| fn produce_candidate( | ||
| &mut self, | ||
| _relay_chain_parent: PHash, | ||
| status: LocalValidationData, | ||
| _global_validation: GlobalValidationSchedule, | ||
| local_validation: LocalValidationData, | ||
| ) -> Self::ProduceCandidate { | ||
| let factory = self.proposer_factory.clone(); | ||
| let inherent_providers = self.inherent_data_providers.clone(); | ||
| let block_import = self.block_import.clone(); | ||
|
|
||
| trace!(target: "cumulus-collator", "Producing candidate"); | ||
|
|
||
| let last_head = match HeadData::<Block>::decode(&mut &status.parent_head.0[..]) { | ||
| let last_head = match HeadData::<Block>::decode(&mut &local_validation.parent_head.0[..]) { | ||
| Ok(x) => x, | ||
| Err(e) => { | ||
| error!(target: "cumulus-collator", "Could not decode the head data: {:?}", e); | ||
|
|
@@ -479,9 +480,15 @@ mod tests { | |
| let collation = collate( | ||
| Default::default(), | ||
| id, | ||
| GlobalValidationSchedule { | ||
| block_number: 0, | ||
| max_code_size: 0, | ||
| max_head_data_size: 0, | ||
| }, | ||
|
Comment on lines
+483
to
+487
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not used anyway |
||
| LocalValidationData { | ||
| parent_head: HeadData(header.encode()), | ||
| balance: 10, | ||
| code_upgrade_allowed: None, | ||
| }, | ||
| context, | ||
| Arc::new(Sr25519Keyring::Alice.pair().into()), | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
|
|
||
| use crate::{ParachainBlockData, WitnessData}; | ||
|
|
||
| use parachain::{ValidationParams, ValidationResult}; | ||
| use parachain::primitives::{BlockData, HeadData, ValidationParams, ValidationResult}; | ||
| use sc_executor::{ | ||
| error::Result, WasmExecutionMethod, WasmExecutor, sp_wasm_interface::HostFunctions, | ||
| }; | ||
|
|
@@ -44,8 +44,12 @@ fn call_validate_block( | |
| let mut ext = TestExternalities::default(); | ||
| let mut ext_ext = ext.ext(); | ||
| let params = ValidationParams { | ||
| block_data: block_data.encode(), | ||
| parent_head: parent_head.encode(), | ||
| block_data: BlockData(block_data.encode()), | ||
| parent_head: HeadData(parent_head.encode()), | ||
| code_upgrade_allowed: None, | ||
| max_code_size: 1024, | ||
| max_head_data_size: 1024, | ||
| relay_chain_height: 1, | ||
|
Comment on lines
+49
to
+52
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I took the defaults from what I found in substrate |
||
| } | ||
| .encode(); | ||
|
|
||
|
|
@@ -65,7 +69,7 @@ fn call_validate_block( | |
| &mut ext_ext, | ||
| ) | ||
| .map(|v| ValidationResult::decode(&mut &v[..]).expect("Decode `ValidationResult`.")) | ||
| .map(|v| Header::decode(&mut &v.head_data[..]).expect("Decode `Header`.")) | ||
| .map(|v| Header::decode(&mut &v.head_data.0[..]).expect("Decode `Header`.")) | ||
| .map_err(|err| err.into()) | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,10 +5,10 @@ authors = ["Parity Technologies <[email protected]>"] | |
| edition = "2018" | ||
|
|
||
| [dependencies] | ||
| test-client = { package = "substrate-test-client", git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" } | ||
| test-client = { package = "substrate-test-client", git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" } | ||
| runtime = { package = "cumulus-test-runtime", path = "../runtime" } | ||
| sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" } | ||
| sp-core = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" } | ||
| sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" } | ||
| sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" } | ||
| sp-core = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" } | ||
| sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" } | ||
| codec = { package = "parity-scale-codec", version = "1.0.5", default-features = false, features = [ "derive" ] } | ||
| sp-test-primitives = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" } | ||
| sp-test-primitives = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used