pub trait FraudProofHostFunctions: Send + Sync {
    // Required methods
    fn get_fraud_proof_verification_info(
        &self,
        consensus_block_hash: H256,
        fraud_proof_verification_req: FraudProofVerificationInfoRequest,
    ) -> Option<FraudProofVerificationInfoResponse>;
    fn derive_bundle_digest(
        &self,
        consensus_block_hash: H256,
        domain_id: DomainId,
        bundle_body: Vec<OpaqueExtrinsic>,
    ) -> Option<H256>;
    fn derive_bundle_digest_v2(
        &self,
        domain_runtime_code: Vec<u8>,
        bundle_body: Vec<OpaqueExtrinsic>,
    ) -> Option<H256>;
    fn execution_proof_check(
        &self,
        domain_block_id: (BlockNumber, H256),
        pre_state_root: H256,
        encoded_proof: Vec<u8>,
        execution_method: &str,
        call_data: &[u8],
        domain_runtime_code: Vec<u8>,
    ) -> Option<Vec<u8>>;
    fn check_extrinsics_in_single_context(
        &self,
        domain_runtime_code: Vec<u8>,
        domain_block_id: (BlockNumber, H256),
        domain_block_state_root: H256,
        bundle_extrinsics: Vec<OpaqueExtrinsic>,
        encoded_proof: Vec<u8>,
    ) -> Option<Option<u32>>;
    fn construct_domain_inherent_extrinsic(
        &self,
        domain_runtime_code: Vec<u8>,
        domain_inherent_extrinsic_data: DomainInherentExtrinsicData,
    ) -> Option<DomainInherentExtrinsic>;
    fn domain_storage_key(
        &self,
        domain_runtime_code: Vec<u8>,
        req: DomainStorageKeyRequest,
    ) -> Option<Vec<u8>>;
    fn domain_runtime_call(
        &self,
        domain_runtime_code: Vec<u8>,
        call: StatelessDomainRuntimeCall,
    ) -> Option<bool>;
    fn bundle_weight(
        &self,
        domain_runtime_code: Vec<u8>,
        bundle_body: Vec<OpaqueExtrinsic>,
    ) -> Option<Weight>;
    fn extract_xdm_mmr_proof(
        &self,
        domain_runtime_code: Vec<u8>,
        opaque_extrinsic: Vec<u8>,
    ) -> Option<Option<Vec<u8>>>;
}
Expand description

Trait to query and verify Domains Fraud proof.

Required Methods§

source

fn get_fraud_proof_verification_info( &self, consensus_block_hash: H256, fraud_proof_verification_req: FraudProofVerificationInfoRequest, ) -> Option<FraudProofVerificationInfoResponse>

Returns the required verification info for the runtime to verify the Fraud proof.

source

fn derive_bundle_digest( &self, consensus_block_hash: H256, domain_id: DomainId, bundle_body: Vec<OpaqueExtrinsic>, ) -> Option<H256>

Derive the bundle digest for the given bundle body.

source

fn derive_bundle_digest_v2( &self, domain_runtime_code: Vec<u8>, bundle_body: Vec<OpaqueExtrinsic>, ) -> Option<H256>

Derive the bundle digest for the given bundle body.

source

fn execution_proof_check( &self, domain_block_id: (BlockNumber, H256), pre_state_root: H256, encoded_proof: Vec<u8>, execution_method: &str, call_data: &[u8], domain_runtime_code: Vec<u8>, ) -> Option<Vec<u8>>

Check the execution proof

source

fn check_extrinsics_in_single_context( &self, domain_runtime_code: Vec<u8>, domain_block_id: (BlockNumber, H256), domain_block_state_root: H256, bundle_extrinsics: Vec<OpaqueExtrinsic>, encoded_proof: Vec<u8>, ) -> Option<Option<u32>>

source

fn construct_domain_inherent_extrinsic( &self, domain_runtime_code: Vec<u8>, domain_inherent_extrinsic_data: DomainInherentExtrinsicData, ) -> Option<DomainInherentExtrinsic>

source

fn domain_storage_key( &self, domain_runtime_code: Vec<u8>, req: DomainStorageKeyRequest, ) -> Option<Vec<u8>>

source

fn domain_runtime_call( &self, domain_runtime_code: Vec<u8>, call: StatelessDomainRuntimeCall, ) -> Option<bool>

source

fn bundle_weight( &self, domain_runtime_code: Vec<u8>, bundle_body: Vec<OpaqueExtrinsic>, ) -> Option<Weight>

source

fn extract_xdm_mmr_proof( &self, domain_runtime_code: Vec<u8>, opaque_extrinsic: Vec<u8>, ) -> Option<Option<Vec<u8>>>

Implementors§

source§

impl<Block, Client, DomainBlock, Executor, EFC> FraudProofHostFunctions for FraudProofHostFunctionsImpl<Block, Client, DomainBlock, Executor, EFC>
where Block: BlockT, Block::Hash: From<H256>, DomainBlock: BlockT, DomainBlock::Hash: From<H256> + Into<H256>, NumberFor<DomainBlock>: From<BlockNumber>, Client: BlockBackend<Block> + HeaderBackend<Block> + ProvideRuntimeApi<Block>, Client::Api: DomainsApi<Block, DomainBlock::Header> + BundleProducerElectionApi<Block, Balance> + MessengerApi<Block, NumberFor<Block>, Block::Hash>, Executor: CodeExecutor + RuntimeVersionOf, EFC: Fn(Arc<Client>, Arc<Executor>) -> Box<dyn ExtensionsFactory<DomainBlock>> + Send + Sync,