Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Conversation

@kien-rise
Copy link
Contributor

Resolves #3048

These changes are required to introduce throttling and retry logic to handle timeouts and 429 (Too Many Requests) errors from the L1 RPC.

@codecov
Copy link

codecov bot commented Dec 27, 2025

Codecov Report

❌ Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.0%. Comparing base (fe6dfcf) to head (52ff7c2).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
bin/host/src/single/cfg.rs 0.0% 18 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (fe6dfcf) and HEAD (52ff7c2). Click for more details.

HEAD has 23 uploads less than BASE
Flag BASE (fe6dfcf) HEAD (52ff7c2)
proof 11 0
e2e 11 0
unit 2 1

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.await
.map_err(|_| SingleChainHostError::Other("Failed to connect to L1 RPC endpoint"))?
} else {
return Err(SingleChainHostError::Other("L1 node address must be set"))
Copy link
Member

Choose a reason for hiding this comment

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

Ideally we wouldn't want to return an error in that case. Instead, can we enforce that the config specifies either an l1 rpc client or an l1 node address (by using an enum)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/// The host binary CLI application arguments.
#[derive(Default, Parser, Serialize, Clone, Debug)]
#[command(styles = cli_styles())]
pub struct SingleChainHost {

How about we remove #[derive(Serialize)] and then apply the following change?

Before

    /// Address of L1 JSON-RPC endpoint to use (eth and debug namespace required)
    #[arg(
        long,
        visible_alias = "l1",
        requires = "l2_node_address",
        requires = "l1_beacon_address",
        env
    )]
    pub l1_node_address: Option<String>,
    /// Pre-configured L1 RPC client (not settable via CLI, used internally)
    #[serde(skip)]
    #[arg(skip)]
    pub l1_rpc_client: Option<RpcClient>,

After

    #[arg(
        long,
        aliases = ["l1", "l1_node_address"]
        visible_alias = "l1",
        requires = "l2_node_address",
        requires = "l1_beacon_address",
        value_parser = parse_rpc_client,
        env
    )]
    pub l1_rpc: RpcClient,


fn parse_rpc_client(s: &str) -> Result<RpcClient, String> {
  todo!()
}

Copy link
Member

Choose a reason for hiding this comment

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

Looks good! Let me know when it's done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here’s my draft commit: kien-rise@ab470c6

I’ll test it, and once it’s confirmed to work, I’ll update this PR accordingly.

.await
.map_err(|_| SingleChainHostError::Other("Failed to connect to L2 RPC endpoint"))?
} else {
return Err(SingleChainHostError::Other("L2 node address must be set"))
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow custom RpcClient in SingleChainHost

2 participants