Skip to content

feat(l2): hardcode SP1 verification key#2708

Merged
jrchatruc merged 123 commits into
mainfrom
l2/hardcode_vkeys
May 20, 2025
Merged

feat(l2): hardcode SP1 verification key#2708
jrchatruc merged 123 commits into
mainfrom
l2/hardcode_vkeys

Conversation

@xqft

@xqft xqft commented May 8, 2025

Copy link
Copy Markdown
Contributor

Motivation

Instead of sending it as a parameter, it will be set as a contract static variable.

Also makes sp1 build in docker for reproducibility (and so the key doesn't change depending on the platform we're building)

@xqft xqft force-pushed the l2/hardcode_vkeys branch from 918c634 to 6646b3a Compare May 14, 2025 20:17
@xqft xqft force-pushed the l2/hardcode_vkeys branch from 6646b3a to 42e8e20 Compare May 14, 2025 20:17

@jrchatruc jrchatruc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR is good but we need to make sure that in dev mode people don't need to build the SP1 binary to setup everything

@xqft xqft force-pushed the l2/hardcode_vkeys branch from 93c37f2 to a9b1698 Compare May 15, 2025 19:33
@xqft

xqft commented May 16, 2025

Copy link
Copy Markdown
Contributor Author

made 0x00..00 the default verification key so that it's not necessary to build any zkvm if running with exec backend

@avilagaston9

Copy link
Copy Markdown
Contributor

Tested in my machine in dev mode and works!

When testing with sp1 on the server, the first run fails with:

2025-05-16T20:09:24.016666Z ERROR ethrex_l2::sequencer::l1_proof_sender: L1 Proof Sender Error: Failed because of an EthClient error: eth_estimateGas request error: execution reverted: : OnChainProposer: initial state root public inputs don't match with initial state root

That first run modifies test_data/genesis-l2.json. On subsequent runs, the integration test passes.
Should we update test_data/genesis-l2.json then?

@xqft

xqft commented May 19, 2025

Copy link
Copy Markdown
Contributor Author

We found that @avilagaston9's error was in main: #2839

@jrchatruc jrchatruc added this pull request to the merge queue May 20, 2025
Merged via the queue into main with commit 252d670 May 20, 2025
29 checks passed
@jrchatruc jrchatruc deleted the l2/hardcode_vkeys branch May 20, 2025 16:53
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
**Motivation**

Instead of sending it as a parameter, it will be set as a contract
static variable.

Also makes sp1 build in docker for reproducibility (and so the key
doesn't change depending on the platform we're building)

---------

Co-authored-by: ilitteri <ilitteri@fi.uba.ar>
Co-authored-by: Ivan Litteri <67517699+ilitteri@users.noreply.github.com>
Co-authored-by: Javier Rodríguez Chatruc <49622509+jrchatruc@users.noreply.github.com>
Co-authored-by: Manuel Iñaki Bilbao <manuel.bilbao@lambdaclass.com>
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.

4 participants