mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-03 23:57:23 +00:00
3b13cd9a85
* create a v1 primitives module * Improve guide on availability types * punctuate * new parachains runtime uses new primitives * tests of new runtime now use new primitives * add ErasureChunk to guide * export erasure chunk from v1 primitives * subsystem crate uses v1 primitives * node-primitives uses new v1 primitives * port overseer to new primitives * new-proposer uses v1 primitives (no ParachainHost anymore) * fix no-std compilation for primitives * service-new uses v1 primitives * network-bridge uses new primitives * statement distribution uses v1 primitives * PoV distribution uses v1 primitives; add PoV::hash fn * move parachain to v0 * remove inclusion_inherent module and place into v1 * remove everything from primitives crate root * remove some unused old types from v0 primitives * point everything else at primitives::v0 * squanch some warns up * add RuntimeDebug import to no-std as well * port over statement-table and validation * fix final errors in validation and node-primitives * add dummy Ord impl to committed candidate receipt * guide: update CandidateValidationMessage * add primitive for validationoutputs * expand CandidateValidationMessage further * bikeshed * add some impls to omitted-validation-data and available-data * expand CandidateValidationMessage * make erasure-coding generic over v1/v0 * update usages of erasure-coding * implement commitments.hash() * use Arc<Pov> for CandidateValidation * improve new erasure-coding method names * fix up candidate backing * update docs a bit * fix most tests and add short-circuiting to make_pov_available * fix remainder of candidate backing tests * squanching warns * squanch it up * some fallout * overseer fallout * free from polkadot-test-service hell
103 lines
2.9 KiB
Rust
103 lines
2.9 KiB
Rust
// You should have received a copy of the GNU General Public License
|
|
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
//! The statement table.
|
|
//!
|
|
//! This stores messages other authorities issue about candidates.
|
|
//!
|
|
//! These messages are used to create a proposal submitted to a BFT consensus process.
|
|
//!
|
|
//! Proposals are formed of sets of candidates which have the requisite number of
|
|
//! validity and availability votes.
|
|
//!
|
|
//! Each parachain is associated with two sets of authorities: those which can
|
|
//! propose and attest to validity of candidates, and those who can only attest
|
|
//! to availability.
|
|
|
|
pub mod generic;
|
|
|
|
pub use generic::{Table, Context};
|
|
|
|
/// Concrete instantiations suitable for v0 primitives.
|
|
pub mod v0 {
|
|
use crate::generic;
|
|
use primitives::v0::{
|
|
Hash,
|
|
Id, AbridgedCandidateReceipt, CompactStatement as PrimitiveStatement, ValidatorSignature, ValidatorIndex,
|
|
};
|
|
|
|
/// Statements about candidates on the network.
|
|
pub type Statement = generic::Statement<AbridgedCandidateReceipt, Hash>;
|
|
|
|
/// Signed statements about candidates.
|
|
pub type SignedStatement = generic::SignedStatement<
|
|
AbridgedCandidateReceipt,
|
|
Hash,
|
|
ValidatorIndex,
|
|
ValidatorSignature,
|
|
>;
|
|
|
|
/// Kinds of misbehavior, along with proof.
|
|
pub type Misbehavior = generic::Misbehavior<
|
|
AbridgedCandidateReceipt,
|
|
Hash,
|
|
ValidatorIndex,
|
|
ValidatorSignature,
|
|
>;
|
|
|
|
/// A summary of import of a statement.
|
|
pub type Summary = generic::Summary<Hash, Id>;
|
|
|
|
impl<'a> From<&'a Statement> for PrimitiveStatement {
|
|
fn from(s: &'a Statement) -> PrimitiveStatement {
|
|
match *s {
|
|
generic::Statement::Valid(s) => PrimitiveStatement::Valid(s),
|
|
generic::Statement::Invalid(s) => PrimitiveStatement::Invalid(s),
|
|
generic::Statement::Candidate(ref s) => PrimitiveStatement::Candidate(s.hash()),
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// Concrete instantiations suitable for v1 primitives.
|
|
pub mod v1 {
|
|
use crate::generic;
|
|
use primitives::v1::{
|
|
Hash,
|
|
Id, CommittedCandidateReceipt, CompactStatement as PrimitiveStatement,
|
|
ValidatorSignature, ValidatorIndex,
|
|
};
|
|
|
|
/// Statements about candidates on the network.
|
|
pub type Statement = generic::Statement<CommittedCandidateReceipt, Hash>;
|
|
|
|
/// Signed statements about candidates.
|
|
pub type SignedStatement = generic::SignedStatement<
|
|
CommittedCandidateReceipt,
|
|
Hash,
|
|
ValidatorIndex,
|
|
ValidatorSignature,
|
|
>;
|
|
|
|
/// Kinds of misbehavior, along with proof.
|
|
pub type Misbehavior = generic::Misbehavior<
|
|
CommittedCandidateReceipt,
|
|
Hash,
|
|
ValidatorIndex,
|
|
ValidatorSignature,
|
|
>;
|
|
|
|
/// A summary of import of a statement.
|
|
pub type Summary = generic::Summary<Hash, Id>;
|
|
|
|
impl<'a> From<&'a Statement> for PrimitiveStatement {
|
|
fn from(s: &'a Statement) -> PrimitiveStatement {
|
|
match *s {
|
|
generic::Statement::Valid(s) => PrimitiveStatement::Valid(s),
|
|
generic::Statement::Invalid(s) => PrimitiveStatement::Invalid(s),
|
|
generic::Statement::Candidate(ref s) => PrimitiveStatement::Candidate(s.hash()),
|
|
}
|
|
}
|
|
}
|
|
}
|