-
Notifications
You must be signed in to change notification settings - Fork 0
Use static RollupConfig #23
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ use crate::host::single::config::Config; | |
| use crate::server::{start_http_server_task, DerivationState}; | ||
| use base64::Engine; | ||
| use clap::Parser; | ||
| use kona_registry::ROLLUP_CONFIGS; | ||
| use l2_client::L2Client; | ||
| use tracing::info; | ||
| use tracing_subscriber::filter; | ||
|
|
@@ -29,22 +30,27 @@ async fn main() -> anyhow::Result<()> { | |
| config.l2_rollup_address.to_string(), | ||
| config.l2_node_address.to_string(), | ||
| ); | ||
| let rollup_config = l2_client.rollup_config().await?; | ||
| let chain_id = l2_client.chain_id().await?; | ||
|
|
||
| let l1_chain_config = if let Some(l1_chain_config) = &config.l1_chain_config { | ||
| let (rollup_config, l1_chain_config) = if ROLLUP_CONFIGS.get(&chain_id).is_none() { | ||
| // devnet only | ||
| info!( | ||
| "fetching rollup config and l1 chain config because chain id {} is devnet", | ||
| chain_id | ||
| ); | ||
| let l2_config = l2_client.rollup_config().await?; | ||
| let l1_chain_config = config.l1_chain_config.as_ref().unwrap(); | ||
|
||
| let decoded = base64::engine::general_purpose::STANDARD.decode(l1_chain_config)?; | ||
| let l1_chain_config: kona_genesis::L1ChainConfig = serde_json::from_slice(&decoded)?; | ||
| Some(l1_chain_config) | ||
| (Some(l2_config), Some(l1_chain_config)) | ||
| } else { | ||
| None | ||
| (None, None) | ||
| }; | ||
|
|
||
| // Start HTTP server | ||
| let http_server_task = start_http_server_task( | ||
| config.http_server_addr.as_str(), | ||
| DerivationState { | ||
| rollup_config: rollup_config.clone(), | ||
| rollup_config, | ||
| l1_chain_config, | ||
| config: config.clone(), | ||
| l2_chain_id: chain_id, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
revwill be replaced with the tag that will be created after this PR is merged, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 41b1997