#[non_exhaustive]pub struct CallProof {
pub block_proof: BlockProof,
pub call_proof: MapProof<CallInBlock, ExecutionError>,
pub error_description: Option<String>,
}Expand description
Proof of authenticity for a single top-level call in a block, such as a transaction.
The proof consists of two parts:
block_proof: block header with the proof of authenticitycall_proof: proof from the error aggregator (i.e., aProofMapIndexthe Merkle root of which is recorded in the block header aserror_hash).
For an execution that resulted in an error, call_proof will be a proof of existence.
If a transaction was executed successfully, call_proof will be a proof of absence.
Since the number of transactions in a block is mentioned in the block header, the user
will be able to distinguish absence of error (meaning successful execution) from
the absence of a transaction with such an index. Indeed, if the index is less
than amount of transactions in block, the proof denotes successful execution;
otherwise, the transaction with the given index does not exist in the block.
Similarly, execution errors of the before_transactions / after_transactions
hooks can be proven to external clients. Discerning successful execution
from a non-existing service requires prior knowledge though.
CallProofs should not be confused with a proof of transaction commitment.
To verify that a certain transaction was committed, use a proof from
the block_transactions index of the core schema.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.block_proof: BlockProofProof of authenticity for the block header.
call_proof: MapProof<CallInBlock, ExecutionError>Proof of authenticity for the call status. Must contain a single key corresponding
to the CallInBlock in question.
The root hash of the proof must be equal to the error_hash mentioned in block_proof.
error_description: Option<String>Human-readable description of an error if the call status is erroneous.
This description is not authenticated and thus should be used for diagnostic purposes only.
If the call is successful, the error description should be None.
Implementations§
Source§impl CallProof
impl CallProof
Sourcepub fn verify(
&self,
validator_keys: &[PublicKey],
) -> Result<(CallInBlock, Result<(), ExecutionError>), ProofError>
pub fn verify( &self, validator_keys: &[PublicKey], ) -> Result<(CallInBlock, Result<(), ExecutionError>), ProofError>
Verifies this proof, returning the location of the proven call together with its status.
Note that a successful status is indistinguishable from the point of view of a proof from a non-existing one. It is up to caller to discern between these two possibilities.