[][src]Struct exonum::blockchain::CallProof

#[non_exhaustive]pub struct CallProof {
    pub block_proof: BlockProof,
    pub call_proof: MapProof<CallInBlock, ExecutionError>,
    pub error_description: Option<String>,
}

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 authenticity
  • call_proof: proof from the error aggregator (i.e., a ProofMapIndex the Merkle root of which is recorded in the block header as error_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)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
block_proof: BlockProof

Proof 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.

Methods

impl CallProof[src]

pub fn verify(
    &self,
    validator_keys: &[PublicKey]
) -> Result<(CallInBlock, Result<(), ExecutionError>), ProofError>
[src]

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.

Trait Implementations

impl BinaryValue for CallProof[src]

impl Clone for CallProof[src]

impl Debug for CallProof[src]

impl<'de> Deserialize<'de> for CallProof[src]

impl ProtobufConvert for CallProof[src]

type ProtoStruct = CallProof

Type generated from the Protobuf definition.

impl Serialize for CallProof[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,