Complete the verification in MainMockPod (#302)

- Update the `RecursivePod` trait to return `vd_set` instead of `vds_root`
  - A native verifier requires the entire set to reason about the circuits that have been used in the recursive tree
- Implement serialization/deserialization for `VDSet`
- Remove `DynError` and use `BackendError` instead for middleware functions that wrap or define trait functions implemented in the backend.  This is based on the fact that we will only have a single backend enabled at a time, so there's no need for a `dyn Error`
  - Move the implementations of `_verify` functions to `verify` and similarly for `_prove`
- Complete the verification of a MockMainPod: the verification of input pods was missing.  The inclusion of these input pods in the serialization was also missing.  With this change a `MockMainPod` will grow after each recursion.  This was expected from the design but was not the case because of the missing recursive native verification implementation.

* apply feedback from @arnaucube
This commit is contained in:
Eduard S. 2025-06-19 16:28:25 +02:00 committed by GitHub
parent df8fce76d6
commit 6249406cb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 427 additions and 350 deletions

View file

@ -39,8 +39,8 @@ pub enum Error {
},
#[error("anyhow::Error: {0}")]
Anyhow(#[from] anyhow::Error),
#[error("Plonky2 proof failed to verify: {0}")]
Plonky2ProofFail(anyhow::Error),
#[error("Plonky2 proof failed to verify {0}: {1}")]
Plonky2ProofFail(String, anyhow::Error),
#[error("base64::DecodeError: {0}")]
Base64Decode(#[from] base64::DecodeError),
#[error("serde_json::Error: {0}")]
@ -70,8 +70,8 @@ impl Error {
pub fn custom(s: String) -> Self {
new!(Custom(s))
}
pub fn plonky2_proof_fail(e: anyhow::Error) -> Self {
Self::Plonky2ProofFail(e)
pub fn plonky2_proof_fail(context: impl Into<String>, e: anyhow::Error) -> Self {
Self::Plonky2ProofFail(context.into(), e)
}
pub fn key_not_found() -> Self {
new!(KeyNotFound)