Skip to content

Commit

Permalink
fix: Use RPC mode, add rollup config saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Sep 10, 2024
1 parent cb2d69f commit 1611538
Show file tree
Hide file tree
Showing 18 changed files with 395 additions and 235 deletions.
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified elf/range-elf
Binary file not shown.
3 changes: 2 additions & 1 deletion programs/fault-proof/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ fn main() {
let boot_info_with_bytes_config = sp1_zkvm::io::read::<BootInfoWithBytesConfig>();

// BootInfoStruct is identical to BootInfoWithBytesConfig, except it replaces
// the rollup_config_bytes with a hash of those bytes (rollupConfigHash).
// the rollup_config_bytes with a hash of those bytes (rollupConfigHash). Securely
// hashes the rollup config bytes.
let boot_info_struct = BootInfoStruct::from(boot_info_with_bytes_config.clone());
sp1_zkvm::io::commit::<BootInfoStruct>(&boot_info_struct);

Expand Down
3 changes: 2 additions & 1 deletion programs/range/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ fn main() {
let boot_info_with_bytes_config = sp1_zkvm::io::read::<BootInfoWithBytesConfig>();

// BootInfoStruct is identical to BootInfoWithBytesConfig, except it replaces
// the rollup_config_bytes with a hash of those bytes (rollupConfigHash).
// the rollup_config_bytes with a hash of those bytes (rollupConfigHash). Securely
// hashes the rollup config bytes.
let boot_info_struct = BootInfoStruct::from(boot_info_with_bytes_config.clone());
sp1_zkvm::io::commit::<BootInfoStruct>(&boot_info_struct);

Expand Down
4 changes: 2 additions & 2 deletions proposer/succinct/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn request_span_proof(
dotenv::dotenv().ok();
// TODO: Save data fetcher, NetworkProver, and NetworkClient globally
// and access via Store.
let data_fetcher = OPSuccinctDataFetcher::new();
let data_fetcher = OPSuccinctDataFetcher::new().await;

let host_cli = data_fetcher
.get_host_cli_args(payload.start, payload.end, ProgramType::Multi, CacheMode::DeleteCache)
Expand Down Expand Up @@ -115,7 +115,7 @@ async fn request_agg_proof(
hex::decode(payload.head.strip_prefix("0x").expect("Invalid L1 head, no 0x prefix."))?;
let l1_head: [u8; 32] = l1_head_bytes.try_into().unwrap();

let fetcher = OPSuccinctDataFetcher::new();
let fetcher = OPSuccinctDataFetcher::new().await;
let headers = fetcher.get_header_preimages(&boot_infos, l1_head.into()).await?;

let prover = NetworkProver::new();
Expand Down
46 changes: 46 additions & 0 deletions rollup-configs/11155420.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"genesis": {
"l1": {
"hash": "0x48f520cf4ddaf34c8336e6e490632ea3cf1e5e93b0b2bc6e917557e31845371b",
"number": "0x3e1ff0"
},
"l2": {
"hash": "0x102de6ffb001480cc9b8b548fd05c34cd4f46ae4aa91759393db90ea0409887d",
"number": "0x0"
},
"l2_time": 1691802540,
"system_config": {
"batcherAddr": "0x8f23bb38f531600e5d8fddaaec41f13fab46e98c",
"overhead": "0xbc",
"scalar": "0xa6fe0",
"gasLimit": 30000000,
"baseFeeScalar": null,
"blobBaseFeeScalar": null
}
},
"block_time": 2,
"max_sequencer_drift": 600,
"seq_window_size": 3600,
"channel_timeout": 300,
"granite_channel_timeout": 50,
"l1_chain_id": 11155111,
"l2_chain_id": 11155420,
"base_fee_params": {
"max_change_denominator": "0x32",
"elasticity_multiplier": "0x6"
},
"canyon_base_fee_params": {
"max_change_denominator": "0xfa",
"elasticity_multiplier": "0x6"
},
"regolith_time": 0,
"canyon_time": 1699981200,
"delta_time": 1703203200,
"ecotone_time": 1708534800,
"fjord_time": 1716998400,
"batch_inbox_address": "0xff00000000000000000000000000000011155420",
"deposit_contract_address": "0x16fc5058f25648194471939df75cf27a2fdc48bc",
"l1_system_config_address": "0x034edd2a225f7f429a63e0f1d2084b9e0a93b538",
"protocol_versions_address": "0x79add5713b383daa0a138d3c4780c7a1804a8090",
"da_challenge_address": "0x0000000000000000000000000000000000000000"
}
46 changes: 46 additions & 0 deletions rollup-configs/13269.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"genesis": {
"l1": {
"hash": "0x327e6431af3e1e05df17598ae31977cd545ea996f2755920fe75fb9fb65941e3",
"number": "0x62fd94"
},
"l2": {
"hash": "0xa3344560b989c772875de98d68ccc3f8b5503c94e2e4ad2f403bca6bb186c6bf",
"number": "0x0"
},
"l2_time": 1723487352,
"system_config": {
"batcherAddr": "0x6322c47fee60e15fc1b7ba65f1cfd66201e4c61d",
"overhead": "0xbc",
"scalar": "0xa6fe0",
"gasLimit": 30000000,
"baseFeeScalar": null,
"blobBaseFeeScalar": null
}
},
"block_time": 2,
"max_sequencer_drift": 600,
"seq_window_size": 3600,
"channel_timeout": 300,
"granite_channel_timeout": 50,
"l1_chain_id": 11155111,
"l2_chain_id": 13269,
"base_fee_params": {
"max_change_denominator": "0x32",
"elasticity_multiplier": "0x6"
},
"canyon_base_fee_params": {
"max_change_denominator": "0xfa",
"elasticity_multiplier": "0x6"
},
"regolith_time": 0,
"canyon_time": 0,
"delta_time": 0,
"ecotone_time": 0,
"fjord_time": 0,
"granite_time": 1725984001,
"batch_inbox_address": "0x136b12db1fbac1d6aa6d0a1d2b724892c6fba921",
"deposit_contract_address": "0x16839f9f6a11195a72b88744336edff036e7b3d5",
"l1_system_config_address": "0x19145e3aee49c40d9f499f705f25ac1ea7409834",
"protocol_versions_address": "0x0000000000000000000000000000000000000000"
}
8 changes: 4 additions & 4 deletions scripts/prove/bin/agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use cargo_metadata::MetadataCommand;
use clap::Parser;
use op_succinct_client_utils::{boot::BootInfoStruct, BOOT_INFO_SIZE};
use op_succinct_host_utils::{
fetcher::{ChainMode, OPSuccinctDataFetcher},
fetcher::{OPSuccinctDataFetcher, RPCMode},
get_agg_proof_stdin,
};
use sp1_sdk::{utils, HashableKey, ProverClient, SP1Proof, SP1ProofWithPublicValues};
Expand Down Expand Up @@ -69,12 +69,12 @@ async fn main() -> Result<()> {

let args = Args::parse();
let prover = ProverClient::new();
let fetcher = OPSuccinctDataFetcher::new();
let fetcher = OPSuccinctDataFetcher::new().await;

let l2_chain_id = fetcher.get_chain_id(ChainMode::L2).await?;
let l2_chain_id = fetcher.get_chain_id(RPCMode::L2).await?;
let (proofs, boot_infos) = load_aggregation_proof_data(args.proofs, l2_chain_id);
let latest_checkpoint_head = fetcher
.get_header_by_number(ChainMode::L1, args.latest_checkpoint_head_nb)
.get_header_by_number(RPCMode::L1, args.latest_checkpoint_head_nb)
.await?
.hash_slow();
let headers = fetcher.get_header_preimages(&boot_infos, latest_checkpoint_head).await?;
Expand Down
6 changes: 3 additions & 3 deletions scripts/prove/bin/cost_estimator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use kona_host::HostCli;
use kona_primitives::RollupConfig;
use log::info;
use op_succinct_host_utils::{
fetcher::{CacheMode, ChainMode, OPSuccinctDataFetcher},
fetcher::{CacheMode, OPSuccinctDataFetcher, RPCMode},
get_proof_stdin,
stats::{get_execution_stats, ExecutionStats},
witnessgen::WitnessGenExecutor,
Expand Down Expand Up @@ -370,9 +370,9 @@ async fn main() -> Result<()> {
utils::setup_logger();

let args = HostArgs::parse();
let data_fetcher = OPSuccinctDataFetcher::new();
let data_fetcher = OPSuccinctDataFetcher::new().await;

let l2_chain_id = data_fetcher.get_chain_id(ChainMode::L2).await?;
let l2_chain_id = data_fetcher.get_chain_id(RPCMode::L2).await?;
let rollup_config = RollupConfig::from_l2_chain_id(l2_chain_id).unwrap();

// Start the Docker container if it doesn't exist.
Expand Down
Loading

0 comments on commit 1611538

Please sign in to comment.