succinctlabs / rsp

A minimal implementation of ZKPs of Ethereum block execution using Reth. Supports both Ethereum and OP Stack.
Apache License 2.0
55 stars 19 forks source link

feat: add Linea variant #17

Closed gbotrel closed 2 months ago

gbotrel commented 2 months ago

This PR adds the Linea variant, which is mostly copy pasted from the default Ethereum one + adds the corresponding LineaVariant and chainspec objects.

Example output for cargo run --bin rsp --release -- --block-number 279107 --rpc-url ...:

[...]
2024-08-19T20:27:23.834422Z  INFO execute: sp1_core::runtime::utils: clk = 100000000 pc = 0x2dbe5c    
2024-08-19T20:27:27.403237Z  INFO execute: sp1_core::runtime::utils: clk = 110000000 pc = 0x2e8550    
2024-08-19T20:27:28.495589Z  INFO execute: sp1_core::syscall::write: └╴19,268,110 cycles    
stdout: The state root doesn't match.
success: block_hash=0x5b954ddd5ad9f544f66b358f692fd08b0995929b0b6d8fd407f95aed6d0c47bd

Execution report:
opcode counts (113621455 total instructions):
  37600875 add
  11911104 lw
[...]
xJonathanLEI commented 2 months ago

I kinda feel like we can abstract things better if there's literally no change other than chain spec. But at the same time we also want to keep the ELF files minimal (e.g. it would be a waste to build Linea spec into the Ethereum ELF).

An alternative would be making the chain spec part of the client input.. but that increases runtime costs (slightly?). It does give us the benefit of using the exact same ELF for every single Ethereum equivalents that only differ in spec though.

@jtguibas wdyt?

xJonathanLEI commented 2 months ago

In any case I think we should just merge first and deal with extra abstraction later. Will take a look soon.

gbotrel commented 2 months ago

I may have missed something since the host always complains about a state root mismatch (didn't find a single block on which it didn't complain).

xJonathanLEI commented 2 months ago

Do you have a Linea RPC node that can be used for testing this?

gbotrel commented 2 months ago

Can you ping me on Telegram? (@gbotrel) I have a partially sync archive node but need to whitelist your IP to access it

xJonathanLEI commented 2 months ago

Ugh I pushed the wrong commit to your main branch, and the PR got closed, so I lost access to push to your main.

Could you please just push anything to main so I can reopen this? @gbotrel

gbotrel commented 2 months ago

Ugh I pushed the wrong commit to your main branch, and the PR got closed, so I lost access to push to your main.

Could you please just push anything to main so I can reopen this? @gbotrel

done --> https://github.com/gbotrel/rsp/commit/acdc1c0afcc3905d57431cb26b558bca50fb35ef 👍