mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 12:51:02 +00:00
Interchain message-passing (#117)
* compute ingress and routing in polkadot runtime * extract parent candidates from block when beginning consensus * fetch incoming messages when validating * fix consensus tests * parachain wasm execution uses messages * update parachain tests to check if messages are executed * abstract out network service to make room for network tests * skeleton for incoming data fetch * collate ingress from consensus-gossip * keep track of validated candidates in the shared-table * add some shared_table tests for new behavior * broadcast egress messages on gossip * test compute_ingress * move network tests to module folder * dummy network for consensus-network tests * make consensus network generic over executor * test egress broadcast and ingress fetch * fix test compilation * address some grumbles * address grumbles and fix parachain shuffle * remove broadcast parameter from consensus network trait
This commit is contained in:
committed by
GitHub
parent
da409f6c9e
commit
f8af277006
@@ -23,13 +23,13 @@
|
||||
)]
|
||||
|
||||
extern crate alloc;
|
||||
extern crate pwasm_libc;
|
||||
extern crate adder;
|
||||
extern crate polkadot_parachain as parachain;
|
||||
extern crate tiny_keccak;
|
||||
extern crate dlmalloc;
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
|
||||
static ALLOC: dlmalloc::GlobalDlmalloc = dlmalloc::GlobalDlmalloc;
|
||||
|
||||
use core::{intrinsics, panic};
|
||||
use parachain::ValidationResult;
|
||||
@@ -63,7 +63,13 @@ pub extern fn validate(offset: usize, len: usize) -> usize {
|
||||
|
||||
let parent_hash = ::tiny_keccak::keccak256(¶ms.parent_head[..]);
|
||||
|
||||
match ::adder::execute(parent_hash, parent_head, &block_data) {
|
||||
// we also add based on incoming data from messages. ignoring unknown message
|
||||
// kinds.
|
||||
let from_messages = ::adder::process_messages(
|
||||
params.ingress.iter().map(|incoming| &incoming.data[..])
|
||||
);
|
||||
|
||||
match ::adder::execute(parent_hash, parent_head, &block_data, from_messages) {
|
||||
Ok(new_head) => parachain::wasm_api::write_result(
|
||||
ValidationResult { head_data: new_head.encode() }
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user