Skip to content

feat: create evm prover #56

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

Merged
merged 25 commits into from
Apr 15, 2025
Merged

Conversation

tuxcanfly
Copy link
Contributor

@tuxcanfly tuxcanfly commented Dec 20, 2024

Overview

create evm proving service

  • query the Groth16 client on SimApp for the client and consensus state.
  • decode trusted height and header
  • query evm chain for target height
  • serialize evm block into blob use rsp::executor::execute_variant
  • lookup proofs for blob from celestia
  • generate proof for range by invoking blevm [blocked by Generate aggregate proof #42]

@tuxcanfly
Copy link
Contributor Author

Blocked on #42 ideally we should be able to pass [trusted_height, target_height] range to generate aggregate proof using a helper importing blevm as a library.

Until that is implemented we can use the mock program: S1nus/blevm#2 once that's merged.

@tuxcanfly
Copy link
Contributor Author

Rebased on sp1 sdk v4.

@tuxcanfly
Copy link
Contributor Author

Next steps: need to create a aggregator which has BlevmAggOutput as it's public values and which verifies the blevm-aggregator proofs inside it, so that we can we verify consecutive ranges by comparing output1.newest_header_hash and output2.oldest_header_hash. The range proof will be a binary tree where the intermediate nodes are aggregate proofs and the leafs are single block proofs. The root node will give us the recursive proofs required to prove the entire range in O(log n).

@tuxcanfly
Copy link
Contributor Author

Next steps: need to create a aggregator which has BlevmAggOutput as it's public values and which verifies the blevm-aggregator proofs inside it, so that we can we verify consecutive ranges by comparing output1.newest_header_hash and output2.oldest_header_hash. The range proof will be a binary tree where the intermediate nodes are aggregate proofs and the leafs are single block proofs. The root node will give us the recursive proofs required to prove the entire range in O(log n).

This is being done in #154

Rebased this PR on latest main, need to into the aggregator once the above is merged.

@rootulp rootulp changed the title create evm prover feat: create evm prover Feb 20, 2025
@tuxcanfly tuxcanfly force-pushed the tux/evm-prover branch 2 times, most recently from 374b055 to c2632e2 Compare March 1, 2025 16:10
@tuxcanfly
Copy link
Contributor Author

tuxcanfly commented Mar 3, 2025

We will need to fork rsp to allow using custom OP chain genesis as it only supports op mainnet at the moment.

Edit: Was able to work around this by passing --chain-id=10

reth also requires a long enough --rpc.eth-proof-window flag to allow querying proofs required for ClientExecutorInput.

Working on adding a helper to generate ClientExecutorInput given block number to allow executing the block prover program.

@tuxcanfly tuxcanfly force-pushed the tux/evm-prover branch 2 times, most recently from 0348528 to e43ed6f Compare March 25, 2025 15:02
@tuxcanfly
Copy link
Contributor Author

tuxcanfly commented Mar 26, 2025

Integrated indexer and rsp libraries, required for creating BlockProverInput.

For e2e testing, we need to convert the EVM block into it's corresponding celestia blob.

In the rollkit version being used in the demo, the blob is the SSZ serialized BeaconBlock. Need to investigate if this is possible to do efficiently in sp1 or if this needs a different approach.

@tuxcanfly
Copy link
Contributor Author

It might be possible to pass in the SSZ serialized BeaconBlock along with ClientExecutorInput. The sp1 program can verify the validity of this blob, execute the block and match the block hash from the public output and the decoded BeaconBlock.

Copy link
Member

@ninabarbakadze ninabarbakadze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ready to review again? Also, could you please address the PR suggestions by resolving them?

If not ready to review please convert to draft

Copy link
Contributor Author

@tuxcanfly tuxcanfly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed review items.

Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing this through

@tuxcanfly tuxcanfly merged commit 03ee543 into celestiaorg:main Apr 15, 2025
8 checks passed
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

Successfully merging this pull request may close these issues.

3 participants