mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
ICMP message-routing gossip (#304)
* core logic for ICMP gossip * refactor gossip to make more extension friendly * move files aroun * extract attestation-gossip logic to its own module * message validation and broadcast logic * fix upstream crates' compilation * add a test * another test for overlapping * Some grammar and phrasing tweaks Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com> * add since parameter to ingress runtime API * broadcast out known unrouted message queues * fix compilation of service and collator * remove useless index_mapping * some tests for icmp propagation * fix decoding bug and test icmp queue validation * simplify engine-id definition Co-Authored-By: Sergei Pepyakin <sergei@parity.io> * address some grumbles * some cleanup of old circulation code * give network a handle to extrinsic store on startup * an honest collator ensures data available as well * address some grumbles * add docs; rename the attestation session to "leaf work" * module docs * move gossip back to gossip.rs * clean up and document attestation-gossip a bit * some more docs on the availability store * store all outgoing message queues in the availability store * filter `Extrinsic` out of validation crate * expunge Extrinsic from network * expunge Extrinsic from erasure-coding * expunge Extrinsic from collator * expunge from adder-collator * rename ExtrinsicStore to AvailabilityStore everywhere * annotate and clean up message-routing tests
This commit is contained in:
committed by
GitHub
parent
bd8ebbfee5
commit
55c4c830fe
@@ -25,7 +25,7 @@ use substrate_primitives::Pair;
|
||||
use parachain::codec::{Encode, Decode};
|
||||
use primitives::{
|
||||
Hash,
|
||||
parachain::{HeadData, BlockData, Id as ParaId, Message, Extrinsic, Status as ParachainStatus},
|
||||
parachain::{HeadData, BlockData, Id as ParaId, Message, OutgoingMessages, Status as ParachainStatus},
|
||||
};
|
||||
use collator::{InvalidHead, ParachainContext, VersionInfo, Network, BuildParachainContext};
|
||||
use parking_lot::Mutex;
|
||||
@@ -53,14 +53,14 @@ struct AdderContext {
|
||||
|
||||
/// The parachain context.
|
||||
impl ParachainContext for AdderContext {
|
||||
type ProduceCandidate = Result<(BlockData, HeadData, Extrinsic), InvalidHead>;
|
||||
type ProduceCandidate = Result<(BlockData, HeadData, OutgoingMessages), InvalidHead>;
|
||||
|
||||
fn produce_candidate<I: IntoIterator<Item=(ParaId, Message)>>(
|
||||
&self,
|
||||
_relay_parent: Hash,
|
||||
status: ParachainStatus,
|
||||
ingress: I,
|
||||
) -> Result<(BlockData, HeadData, Extrinsic), InvalidHead>
|
||||
) -> Result<(BlockData, HeadData, OutgoingMessages), InvalidHead>
|
||||
{
|
||||
let adder_head = AdderHead::decode(&mut &status.head_data.0[..])
|
||||
.map_err(|_| InvalidHead)?;
|
||||
@@ -94,7 +94,7 @@ impl ParachainContext for AdderContext {
|
||||
next_head.number, next_body.state.overflowing_add(next_body.add).0);
|
||||
|
||||
db.insert(next_head.clone(), next_body);
|
||||
Ok((encoded_body, encoded_head, Extrinsic { outgoing_messages: Vec::new() }))
|
||||
Ok((encoded_body, encoded_head, OutgoingMessages { outgoing_messages: Vec::new() }))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user