signed wrapper (#1283)

* add signed wrapper, typedef SignedStatement

* typedef SignedAvailabilityBitfield

* implement Signed wrapper

This is strictly an addition as of this commit; nothing is yet
changed in existing behavior.

* inline getters, remove review comment

* move EncodeAs, Signed from node::primitives to primitives::parachain

* Refactor SignedAvailabilityBitfield to use Signed

* don't double-encode real payload

This isn't an ideal solution, because it depends on the
implementation details of how SCALE encodes tuples, but OTOH
that behavior seems unlikely to change anytime soon.

* fix build errors

* cause the runtime to build properly with the new changes

Not sure why cargo check didn't catch this earlier; oh well.

* fix runtime tests and separate SignedStatement from SignedFullStatement

* better explain why CompactStatement exists

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
This commit is contained in:
Peter Goodspeed-Niklaus
2020-06-20 20:56:33 +02:00
committed by GitHub
parent 90a1ba1e90
commit 14ce04c9cd
12 changed files with 236 additions and 194 deletions
+3 -3
View File
@@ -31,7 +31,7 @@ use polkadot_primitives::parachain::{
SignedAvailabilityBitfield, SigningContext, ValidatorId, ValidationCode, ValidatorIndex,
};
use polkadot_node_primitives::{
MisbehaviorReport, SignedStatement,
MisbehaviorReport, SignedFullStatement,
};
/// Signals sent by an overseer to a subsystem.
@@ -68,7 +68,7 @@ pub enum CandidateBackingMessage {
Second(Hash, AbridgedCandidateReceipt),
/// Note a validator's statement about a particular candidate. Disagreements about validity must be escalated
/// to a broader check by Misbehavior Arbitration. Agreements are simply tallied until a quorum is reached.
Statement(Hash, SignedStatement),
Statement(Hash, SignedFullStatement),
}
/// Blanket error for validation failing.
@@ -180,7 +180,7 @@ pub enum RuntimeApiMessage {
pub enum StatementDistributionMessage {
/// We have originated a signed statement in the context of
/// given relay-parent hash and it should be distributed to other validators.
Share(Hash, SignedStatement),
Share(Hash, SignedFullStatement),
}
/// This data becomes intrinsics or extrinsics which should be included in a future relay chain block.