Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create mock circuits for testing #40

Open
5 tasks
cmwaters opened this issue Dec 17, 2024 · 3 comments
Open
5 tasks

Create mock circuits for testing #40

cmwaters opened this issue Dec 17, 2024 · 3 comments
Assignees

Comments

@cmwaters
Copy link
Collaborator

cmwaters commented Dec 17, 2024

Current proofs take several hours to produce (depending on the circuit). In order to perform quicker E2E testing we need to make equivalent "dummy" programs that are far smaller in circuit size but have the same inputs. This way we can replace the verifier keys with that of the dummy programs and perform the E2E tests in a reasonable time. The following circuits need their mocked copies:

  • Tendermint Headers (a.k.a. update-client) @ninabarbakadze

  • IAVL Merkle Tree Membership (a.k.a membership) @ninabarbakadze

  • Reth + Celestia State Transition Program (a.k.a. blevm) @S1nus

  • After the mock circuits for Tendermint proofs are created, we need to wire them up to the celestia-prover service.

  • After the mock circuits for EVM proofs are created, we need to wire them up to the EVM prover service.

@rootulp
Copy link
Contributor

rootulp commented Dec 18, 2024

SP1 has 3 modes:

Alternative option is to take the existing circuits and remove all the constraints + reads and writes.

@rootulp
Copy link
Contributor

rootulp commented Dec 19, 2024

Notes from stand-up

  • Currently: generating proofs with mock mode creates an empty proof. Is the verifier key the same?
  • There exists a method on the celestia-prover that prints out the verifier key. In the mock circuit, the verifier key is empty.
    • if we initialize the smart contract with an empty verifier key then this might work
    • alternatively if we copy over the verifier key then this might work
  • Last option is to not use the mock mode, use local mode, build a mock circuit ("hollowed out"). It might take hours to run it locally.
  • Connor prefers not using mock mode, instead create mock circuit ("hollowed out") b/c it should take some time to create the proof.
  • The public values (a.k.a inputs) might need to change

Action items

  • Ask SP1 team if verifier key is empty, will an empty proof verify? @cmwaters

Takeaway: focus on hollowed out proofs

@rootulp
Copy link
Contributor

rootulp commented Dec 20, 2024

  • IBC teams creates Rust structs by wrapping elf binary which provides typed arguments. cc: @cmwaters to link code example
  • Ideally it's just an ENV variable to switch between mock and real proofs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants