Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
voidash committed Jan 6, 2025
1 parent 2ab86bf commit 91e61df
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/bridge-client/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub(crate) struct Cli {
)]
pub duty_timeout_duration: Option<u64>,

/// Max retries for when rpc server fails during duty polling
/// Max retries for when RPC server fails during duty polling
#[argh(
option,
description = "max retries for when RPC server fails during duty polling"
Expand Down
5 changes: 5 additions & 0 deletions bin/bridge-client/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ pub enum InitError {
InvalidMode(String),
}

/// Errors that can occur while polling for duties.
#[derive(Debug, Clone, Error)]
pub enum PollDutyError {
/// An error occurred with the RPC client.
#[error("RPC client: {0}")]
Rpc(String),

/// Failed to fetch a WebSocket client from the pool.
#[error("fetching WebSocket client from pool failed")]
WsPool,
}

/// Errors related to task management.
#[derive(Debug, Clone, Error)]
pub enum TaskManagerError {
/// Maximum number of retries has been exceeded.
#[error("Maximum retries exceeded. Num retries {0}")]
MaxRetry(u16),
}
2 changes: 1 addition & 1 deletion crates/bridge-exec/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub enum ExecError {
Xpriv,

/// Error getting the WebSocket client from pool
#[error("fetching websocket client from pool failed")]
#[error("fetching WebSocket client from pool failed")]
WsPool,
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import flexitest

import testenv
from constants import SATS_TO_WEI
from rollup_params_cfg import RollupConfig
from envs import testenv
from envs.rollup_params_cfg import RollupConfig
from utils import get_bridge_pubkey, wait_until, wait_until_with_value
from utils.constants import SATS_TO_WEI


@flexitest.register
Expand Down
11 changes: 11 additions & 0 deletions functional-tests/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,3 +518,14 @@ def cl_slot_to_block_id(seqrpc, slot):
def el_slot_to_block_id(rethrpc, block_num):
"""Get EL block hash from block number using Ethereum RPC."""
return rethrpc.eth_getBlockByNumber(hex(block_num), False)["hash"]


def check_sequencer_down(seqrpc):
"""
Returns True if sequencer RPC is down
"""
try:
seqrpc.strata_protocolVersion()
return False
except RuntimeError:
return True

0 comments on commit 91e61df

Please sign in to comment.