Skip to content

Commit 3a1e092

Browse files
authored
Use rollup config from celo-registry prior to the one from node RPC and bump celo-kona (#113)
* Use rollup config from celo-registry prior to the one from node RPC * Update celo-kona to Chaos Jovian ready version
1 parent f588ba1 commit 3a1e092

File tree

8 files changed

+92
-41
lines changed

8 files changed

+92
-41
lines changed

Cargo.lock

Lines changed: 29 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ kona-genesis = { git = "https://github.com/op-rs/kona", tag = "kona-client/v1.2.
104104

105105
# TODO: replace commit hash with tag when available
106106
# celo-kona
107-
celo-driver = { git = "https://github.com/celo-org/celo-kona", rev = "444db61" }
108-
celo-proof = { git = "https://github.com/celo-org/celo-kona", rev = "444db61" }
109-
celo-host = { git = "https://github.com/celo-org/celo-kona", rev = "444db61" }
110-
celo-protocol = { git = "https://github.com/celo-org/celo-kona", rev = "444db61", default-features = false }
111-
celo-genesis = { git = "https://github.com/celo-org/celo-kona", rev = "444db61", default-features = false }
107+
celo-driver = { git = "https://github.com/celo-org/celo-kona", rev = "066f949" }
108+
celo-proof = { git = "https://github.com/celo-org/celo-kona", rev = "066f949" }
109+
celo-host = { git = "https://github.com/celo-org/celo-kona", rev = "066f949" }
110+
celo-protocol = { git = "https://github.com/celo-org/celo-kona", rev = "066f949", default-features = false }
111+
celo-genesis = { git = "https://github.com/celo-org/celo-kona", rev = "066f949", default-features = false }
112+
celo-registry = { git = "https://github.com/celo-org/celo-kona", rev = "066f949", default-features = false }
112113

113114
# hana
114115
hana-blobstream = { git = "https://github.com/celestiaorg/hana", tag = "1.5.0-mocha" }
@@ -199,10 +200,10 @@ op-alloy-rpc-types-engine = { version = "0.22.4", default-features = false }
199200
op-alloy-network = { version = "0.22.4", default-features = false }
200201

201202
# Celo Alloy
202-
celo-alloy-consensus = { git = "https://github.com/celo-org/celo-kona", rev = "444db61", default-features = false }
203-
celo-alloy-rpc-types = { git = "https://github.com/celo-org/celo-kona", rev = "444db61", default-features = false }
204-
celo-alloy-rpc-types-engine = { git = "https://github.com/celo-org/celo-kona", rev = "444db61", default-features = false }
205-
celo-alloy-network = { git = "https://github.com/celo-org/celo-kona", rev = "444db61", default-features = false }
203+
celo-alloy-consensus = { git = "https://github.com/celo-org/celo-kona", rev = "066f949", default-features = false }
204+
celo-alloy-rpc-types = { git = "https://github.com/celo-org/celo-kona", rev = "066f949", default-features = false }
205+
celo-alloy-rpc-types-engine = { git = "https://github.com/celo-org/celo-kona", rev = "066f949", default-features = false }
206+
celo-alloy-network = { git = "https://github.com/celo-org/celo-kona", rev = "066f949", default-features = false }
206207

207208
# Execution
208209
alloy-evm = { version = "0.24.2", default-features = false }
@@ -216,7 +217,7 @@ revm-precompile = { version = "31.0.0", default-features = false }
216217
op-revm = { version = "14.1.0", default-features = false }
217218

218219
# Celo Execution
219-
alloy-celo-evm = { git = "https://github.com/celo-org/celo-kona", rev = "444db61", default-features = false }
220+
alloy-celo-evm = { git = "https://github.com/celo-org/celo-kona", rev = "066f949", default-features = false }
220221

221222
# SP1
222223
sp1-sdk = { version = "=5.2.4", default-features = false, features = ["network"] }

elf/aggregation-elf

-40 Bytes
Binary file not shown.

elf/eigenda-range-elf-embedded

-3.63 KB
Binary file not shown.

elf/range-elf-bump

5.14 KB
Binary file not shown.

elf/range-elf-embedded

2.5 KB
Binary file not shown.

utils/host/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ celo-host.workspace = true
4141
celo-protocol.workspace = true
4242
celo-genesis.workspace = true
4343
celo-proof.workspace = true
44+
celo-registry.workspace = true
4445

4546
# hana
4647
hana-host.workspace = true

utils/host/src/fetcher.rs

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ use celo_alloy_consensus::CeloBlock;
1919
use celo_alloy_network::Celo;
2020
use celo_genesis::CeloRollupConfig;
2121
use celo_protocol::CeloL2BlockInfo;
22+
use celo_registry::ROLLUP_CONFIGS;
2223
use futures::{stream, StreamExt};
2324
use kona_host::single::SingleChainHost;
2425
use kona_registry::L1_CONFIGS;
2526
use op_alloy_network::{primitives::HeaderResponse, BlockResponse, Network};
26-
use op_succinct_client_utils::boot::BootInfoStruct;
27+
use op_succinct_client_utils::boot::{hash_rollup_config, BootInfoStruct};
2728
use reqwest::Url;
2829
use serde::{Deserialize, Serialize};
2930
use serde_json::{json, Value};
@@ -313,8 +314,55 @@ impl OPSuccinctDataFetcher {
313314
async fn fetch_and_save_rollup_config(
314315
rpc_config: &RPCConfig,
315316
) -> Result<(CeloRollupConfig, PathBuf)> {
316-
let rollup_config: CeloRollupConfig =
317-
Self::fetch_rpc_data(&rpc_config.l2_node_rpc, "optimism_rollupConfig", vec![]).await?;
317+
// Fetch chain ID to look up registry config
318+
let chain_id: String =
319+
Self::fetch_rpc_data(&rpc_config.l2_rpc, "eth_chainId", vec![]).await?;
320+
let chain_id: u64 = chain_id.parse::<U64>().unwrap().to();
321+
322+
// Fetch rollup config from node RPC (best-effort for hash comparison)
323+
let node_rpc_config: Option<CeloRollupConfig> =
324+
Self::fetch_rpc_data(&rpc_config.l2_node_rpc, "optimism_rollupConfig", vec![])
325+
.await
326+
.inspect(|_| {
327+
tracing::info!("Loaded L2 config for chain ID {} from node RPC", chain_id);
328+
})
329+
.map_err(|e| {
330+
tracing::warn!(
331+
"Failed to fetch rollup config from node RPC for chain ID {}: {:?}",
332+
chain_id,
333+
e
334+
);
335+
})
336+
.ok();
337+
338+
// Try to fetch rollup config from celo-registry; if found, compare hashes and use it
339+
let rollup_config = if let Some(registry_config) = ROLLUP_CONFIGS.get(&chain_id) {
340+
tracing::info!("Loaded L2 config for chain ID {} from registry", chain_id);
341+
if let Some(ref node_config) = node_rpc_config {
342+
let registry_hash = hash_rollup_config(registry_config);
343+
let node_rpc_hash = hash_rollup_config(node_config);
344+
if registry_hash != node_rpc_hash {
345+
tracing::warn!(
346+
"Rollup config hash mismatch for chain ID {}: registry hash = {:?}, node RPC hash = {:?}",
347+
chain_id,
348+
registry_hash,
349+
node_rpc_hash
350+
);
351+
}
352+
}
353+
registry_config.clone()
354+
} else {
355+
tracing::warn!(
356+
"No rollup config found in registry for chain ID {}. Falling back to node RPC config",
357+
chain_id
358+
);
359+
node_rpc_config.ok_or_else(|| {
360+
anyhow::anyhow!(
361+
"No rollup config available for chain ID {}: not in registry and node RPC fetch failed",
362+
chain_id
363+
)
364+
})?
365+
};
318366

319367
// Create configs directory if it doesn't exist
320368
let default_dir = PathBuf::from("configs/L2");

0 commit comments

Comments
 (0)