Module trace_decoder::trace_protocol
source · Expand description
The trace protocol for sending proof information to a prover scheduler.
Because parsing performance has a very negligible impact on overall proof generation latency & throughput, the overall priority of this protocol is ease of implementation for clients. The flexibility comes from giving multiple ways to the client to provide the data for the protocol, where the implementors can pick whichever way is the most convenient for them.
It might not be obvious why we need traces for each txn in order to generate proofs. While it’s true that we could just run all the txns of a block in an EVM to generate the traces ourselves, there are a few major downsides:
- The client is likely a full node and already has to run the txns in an EVM anyways.
- We want this protocol to be as agnostic as possible to the underlying chain that we’re generating proofs for, and running our own EVM would likely cause us to loose this genericness.
While it’s also true that we run our own zk-EVM (plonky2) to generate proofs, it’s critical that we are able to generate txn proofs in parallel. Since generating proofs with plonky2 is very slow, this would force us to sequentialize the entire proof generation process. So in the end, it’s ideal if we can get this information sent to us instead.
Structs§
- Core payload needed to generate a proof for a block. Note that the scheduler may need to request some additional data from the client along with this in order to generate a proof.
- A trie pre-image where both state & storage are combined into one payload.
- State/Storage trie pre-images that are separate.
- Compact representation of a trie (will likely be very close to https://github.com/ledgerwatch/erigon/blob/devel/docs/programmers_guide/witness_formal_spec.md)
- Trie format that is in exactly the same format of our internal trie format. This is the fastest format for us to processes.
- Bulkier format that is quicker to process.
- Info specific to txns in the block.
- Structure holding metadata for one transaction.
- A “trace” specific to an account for a txn.
Enums§
- Minimal hashed out tries needed by all txns in the block.
- Contract code access type. Used by txn traces.
- A trie pre-image where state and storage are separate.
- A trie pre-image where state & storage are separate.