mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Merged companions and update Subtrate (#882)
* expunge legacy code from polkadot-network * mostly rip out old legacy protocol from service * ensure validation work is spawned by incoming messages * decouple availabliity store from network logic; clean up data flow * av_store: test helpers and use futures-abort * update polkadot-validation to pass n_validators when submitting chunks * fallible erasure-chunk fetching * implement `ErasureNetworking` for new network prot * API for registering availability store in network * fully integrate new network service into service * fix validation tests * scaffolding for porting collator over to new network * track connected validators' peer IDs and distribute collators' collations * helper in network for fetching all checked statements * fix adder-collator * actually register notifications protocol * Update service/src/lib.rs * Make needed changes to service * Merge two companion PRs. - #880 - #881 * Some effort towards compilation * Fix * remove `NetworkSpecialization` references from network * fix compilation errors in service and collator * ensure protocol name is valid * Fixes * Fix Co-authored-by: Robert Habermeier <rphmeier@gmail.com> Co-authored-by: Ashley <ashley.ruglys@gmail.com>
This commit is contained in:
@@ -24,6 +24,8 @@ use std::any::{TypeId, Any};
|
||||
use crate::{ValidationParams, ValidationResult, UpwardMessage};
|
||||
use codec::{Decode, Encode};
|
||||
use sp_core::storage::{ChildStorageKey, ChildInfo};
|
||||
use sp_core::traits::CallInWasm;
|
||||
use sp_wasm_interface::HostFunctions as _;
|
||||
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
pub use validation_host::{run_worker, EXECUTION_TIMEOUT_SEC};
|
||||
@@ -156,15 +158,18 @@ pub fn validate_candidate_internal<E: Externalities + 'static>(
|
||||
) -> Result<ValidationResult, Error> {
|
||||
let mut ext = ValidationExternalities(ParachainExt::new(externalities));
|
||||
|
||||
let res = sc_executor::call_in_wasm::<HostFunctions>(
|
||||
let executor = sc_executor::WasmExecutor::new(
|
||||
sc_executor::WasmExecutionMethod::Interpreted,
|
||||
// TODO: Make sure we don't use more than 1GB: https://github.com/paritytech/polkadot/issues/699
|
||||
Some(1024),
|
||||
HostFunctions::host_functions(),
|
||||
false,
|
||||
);
|
||||
let res = executor.call_in_wasm(
|
||||
validation_code,
|
||||
"validate_block",
|
||||
encoded_call_data,
|
||||
sc_executor::WasmExecutionMethod::Interpreted,
|
||||
&mut ext,
|
||||
validation_code,
|
||||
// TODO: Make sure we don't use more than 1GB: https://github.com/paritytech/polkadot/issues/699
|
||||
1024,
|
||||
false,
|
||||
)?;
|
||||
|
||||
ValidationResult::decode(&mut &res[..]).map_err(|_| Error::BadReturn.into())
|
||||
|
||||
Reference in New Issue
Block a user