Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
b2fea426
Unverified
Commit
b2fea426
authored
Jan 11, 2021
by
Sergey Pepyakin
Committed by
GitHub
Jan 11, 2021
Browse files
Pass relay_storage_root into ValidationParams (#2245)
Prior this commit, a PVF wasn't able to access this property.
parent
078e1605
Pipeline
#119723
passed with stages
in 28 minutes and 13 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
node/core/candidate-validation/src/lib.rs
View file @
b2fea426
...
...
@@ -439,6 +439,7 @@ fn validate_candidate_exhaustive<B: ValidationBackend, S: SpawnNamed + 'static>(
parent_head
:
persisted_validation_data
.parent_head
.clone
(),
block_data
:
pov
.block_data
.clone
(),
relay_chain_height
:
persisted_validation_data
.block_number
,
relay_storage_root
:
persisted_validation_data
.relay_storage_root
,
dmq_mqc_head
:
persisted_validation_data
.dmq_mqc_head
,
hrmp_mqc_heads
:
persisted_validation_data
.hrmp_mqc_heads
.clone
(),
};
...
...
parachain/src/primitives.rs
View file @
b2fea426
...
...
@@ -254,6 +254,8 @@ pub struct ValidationParams {
pub
block_data
:
BlockData
,
/// The current relay-chain block number.
pub
relay_chain_height
:
RelayChainBlockNumber
,
/// The relay-chain block's storage root.
pub
relay_storage_root
:
Hash
,
/// The MQC head for the DMQ.
///
/// The DMQ MQC head will be used by the validation function to authorize the downward messages
...
...
parachain/test-parachains/adder/collator/src/lib.rs
View file @
b2fea426
...
...
@@ -234,6 +234,7 @@ mod tests {
parent_head
:
parent_head
.encode
()
.into
(),
block_data
:
collation
.proof_of_validity.block_data
,
relay_chain_height
:
1
,
relay_storage_root
:
Default
::
default
(),
hrmp_mqc_heads
:
Vec
::
new
(),
dmq_mqc_head
:
Default
::
default
(),
},
...
...
parachain/test-parachains/tests/adder/mod.rs
View file @
b2fea426
...
...
@@ -68,6 +68,7 @@ fn execute_good_on_parent(isolation_strategy: IsolationStrategy) {
parent_head
:
GenericHeadData
(
parent_head
.encode
()),
block_data
:
GenericBlockData
(
block_data
.encode
()),
relay_chain_height
:
1
,
relay_storage_root
:
Default
::
default
(),
hrmp_mqc_heads
:
Vec
::
new
(),
dmq_mqc_head
:
Default
::
default
(),
},
...
...
@@ -107,6 +108,7 @@ fn execute_good_chain_on_parent() {
parent_head
:
GenericHeadData
(
parent_head
.encode
()),
block_data
:
GenericBlockData
(
block_data
.encode
()),
relay_chain_height
:
number
as
RelayChainBlockNumber
+
1
,
relay_storage_root
:
Default
::
default
(),
hrmp_mqc_heads
:
Vec
::
new
(),
dmq_mqc_head
:
Default
::
default
(),
},
...
...
@@ -147,6 +149,7 @@ fn execute_bad_on_parent() {
parent_head
:
GenericHeadData
(
parent_head
.encode
()),
block_data
:
GenericBlockData
(
block_data
.encode
()),
relay_chain_height
:
1
,
relay_storage_root
:
Default
::
default
(),
hrmp_mqc_heads
:
Vec
::
new
(),
dmq_mqc_head
:
Default
::
default
(),
},
...
...
parachain/test-parachains/tests/wasm_executor/mod.rs
View file @
b2fea426
...
...
@@ -42,6 +42,7 @@ fn terminates_on_timeout() {
block_data
:
BlockData
(
Vec
::
new
()),
parent_head
:
Default
::
default
(),
relay_chain_height
:
1
,
relay_storage_root
:
Default
::
default
(),
hrmp_mqc_heads
:
Vec
::
new
(),
dmq_mqc_head
:
Default
::
default
(),
},
...
...
@@ -70,6 +71,7 @@ fn parallel_execution() {
block_data
:
BlockData
(
Vec
::
new
()),
parent_head
:
Default
::
default
(),
relay_chain_height
:
1
,
relay_storage_root
:
Default
::
default
(),
hrmp_mqc_heads
:
Vec
::
new
(),
dmq_mqc_head
:
Default
::
default
(),
},
...
...
@@ -81,6 +83,7 @@ fn parallel_execution() {
ValidationParams
{
block_data
:
BlockData
(
Vec
::
new
()),
parent_head
:
Default
::
default
(),
relay_storage_root
:
Default
::
default
(),
relay_chain_height
:
1
,
hrmp_mqc_heads
:
Vec
::
new
(),
dmq_mqc_head
:
Default
::
default
(),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment