Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Adds support for checking the timestamp inherent while validating a block #494

Merged
merged 5 commits into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 29 additions & 75 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ members = [
"pallets/xcmp-queue",
"primitives/core",
"primitives/parachain-inherent",
"primitives/timestamp",
"primitives/utility",
"polkadot-parachains/",
"polkadot-parachains/pallets/parachain-info",
Expand Down
2 changes: 1 addition & 1 deletion client/collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ cumulus-test-client = { path = "../../test/client" }
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-test-client = { git = "https://github.com/paritytech/substrate", branch = "master" }

# Other dependencies
env_logger = "0.7.1"
async-trait = "0.1.42"
2 changes: 1 addition & 1 deletion client/collator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ mod tests {

#[test]
fn collates_produces_a_block_and_storage_proof_does_not_contains_code() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();

let spawner = TaskExecutor::new();
let para_id = ParaId::from(100);
Expand Down
17 changes: 9 additions & 8 deletions pallets/parachain-system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,20 @@ log = { version = "0.4.14", default-features = false }
environmental = { version = "1.1.2", default-features = false }

[dev-dependencies]
substrate-test-runtime-client = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
cumulus-test-relay-sproof-builder = { path = "../../test/relay-sproof-builder" }
# Other Dependencies
hex-literal = "0.2.1"
lazy_static = "1.4"
sc-client-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }

# Substrate dependencies
sp-version = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }

# Cumulus dependencies
cumulus-test-client = { path = "../../test/client" }
env_logger = "0.7.1"
cumulus-test-relay-sproof-builder = { path = "../../test/relay-sproof-builder" }

[features]
default = [ "std" ]
Expand Down
2 changes: 1 addition & 1 deletion pallets/parachain-system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ pub trait CheckInherents<Block: BlockT> {
/// This function gets passed all the extrinsics of the block, so it is up to the callee to
/// identify the inherents. The `validation_data` can be used to access the
fn check_inherents(
extrinsics: &[Block::Extrinsic],
block: &Block,
validation_data: &RelayChainStateProof,
) -> frame_support::inherent::CheckInherentsResult;
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ where
)
.expect("Invalid relay chain state proof");

let res = CI::check_inherents(block.extrinsics(), &relay_chain_proof);
let res = CI::check_inherents(&block, &relay_chain_proof);

if !res.ok() {
if log::log_enabled!(log::Level::Error) {
Expand Down
Loading