alpenlabs / strata

Rust implementation of the Strata protocol
https://docs.stratabtc.org
Apache License 2.0
23 stars 1 forks source link

Define ZkVm Trait and Implement for Risc0 and Sp1 #455

Open prajwolrg opened 1 week ago

prajwolrg commented 1 week ago

Description

This PR introduces a new ZkVm trait, implemented by both the Risc0 and SP1 adapters, consolidating guest code to avoid duplication. This allows us to move more logic into the proof-impl, ensuring a consistent structure across implementations in the provers/ directory.

Type of Change

Checklist

Related Issues

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 0% with 212 lines in your changes missing coverage. Please review.

Project coverage is 56.64%. Comparing base (21fa908) to head (0a7c294).

Files with missing lines Patch % Lines
crates/zkvm/adapters/risc0/src/zkvm_risc0.rs 0.00% 53 Missing :warning:
crates/proof-impl/cl-stf/src/lib.rs 0.00% 41 Missing :warning:
crates/proof-impl/cl-agg/src/lib.rs 0.00% 36 Missing :warning:
crates/proof-impl/checkpoint/src/lib.rs 0.00% 25 Missing :warning:
crates/proof-impl/l1-batch/src/lib.rs 0.00% 24 Missing :warning:
crates/zkvm/zkvm/src/lib.rs 0.00% 17 Missing :warning:
crates/proof-impl/btc-blockspace/src/logic.rs 0.00% 11 Missing :warning:
crates/proof-impl/evm-ee-stf/src/lib.rs 0.00% 5 Missing :warning:
@@            Coverage Diff             @@
##             main     #455      +/-   ##
==========================================
- Coverage   57.03%   56.64%   -0.39%     
==========================================
  Files         252      254       +2     
  Lines       27950    28138     +188     
==========================================
  Hits        15940    15940              
- Misses      12010    12198     +188     
Files with missing lines Coverage Δ
crates/proof-impl/evm-ee-stf/src/lib.rs 90.16% <0.00%> (-8.06%) :arrow_down:
crates/proof-impl/btc-blockspace/src/logic.rs 68.42% <0.00%> (-27.88%) :arrow_down:
crates/zkvm/zkvm/src/lib.rs 12.98% <0.00%> (-3.68%) :arrow_down:
crates/proof-impl/l1-batch/src/lib.rs 0.00% <0.00%> (ø)
crates/proof-impl/checkpoint/src/lib.rs 0.00% <0.00%> (ø)
crates/proof-impl/cl-agg/src/lib.rs 0.00% <0.00%> (ø)
crates/proof-impl/cl-stf/src/lib.rs 14.43% <0.00%> (-10.57%) :arrow_down:
crates/zkvm/adapters/risc0/src/zkvm_risc0.rs 0.00% <0.00%> (ø)

... and 5 files with indirect coverage changes