Move erasure root out of candidate commitments and into descriptor (#2010)

* guide: move erasure-root to candidate descriptor

* primitives: move erasure root to descriptor

* guide: unify candidate commitments and validation outputs

* primitives: unify validation outputs and candidate commitments

* parachains-runtime: fix fallout

* runtimes: fix fallout

* collation generation: fix fallout

* fix stray reference in primitives

* fix fallout in node-primitives

* fix remaining fallout in collation generation

* fix fallout in candidate validation

* fix fallout in runtime API subsystem

* fix fallout in subsystem messages

* fix fallout in candidate backing

* fix fallout in availability distribution

* don't clone

* clone

Co-authored-by: Sergei Shulepov <sergei@parity.io>
This commit is contained in:
Robert Habermeier
2020-11-27 11:39:42 -05:00
committed by GitHub
parent 4fba9df943
commit 0a79d663e4
18 changed files with 85 additions and 134 deletions
@@ -627,7 +627,7 @@ where
};
// check the merkle proof
let root = &live_candidate.commitments.erasure_root;
let root = &live_candidate.descriptor.erasure_root;
let anticipated_hash = if let Ok(hash) = branch_hash(
root,
&message.erasure_chunk.proof,
@@ -290,11 +290,11 @@ impl TestCandidateBuilder {
para_id: self.para_id,
pov_hash: self.pov_hash,
relay_parent: self.relay_parent,
erasure_root: self.erasure_root,
..Default::default()
},
commitments: CandidateCommitments {
head_data: self.head_data,
erasure_root: self.erasure_root,
..Default::default()
},
}
@@ -323,7 +323,7 @@ fn helper_integrity() {
let message =
make_valid_availability_gossip(&test_state, candidate.hash(), 2, pov_block.clone());
let root = dbg!(&candidate.commitments.erasure_root);
let root = dbg!(&candidate.descriptor.erasure_root);
let anticipated_hash = branch_hash(
root,