Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
voidash committed Dec 31, 2024
1 parent 0fef35f commit 984b8ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bin/bridge-client/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ pub(super) const DEFAULT_RPC_PORT: u32 = 4781; // first 4 digits in the sha256 o

pub(super) const DEFAULT_RPC_HOST: &str = "127.0.0.1";

pub(super) const DEFAULT_DUTY_TIMEOUT_DURATION: u64 = 600;
pub(super) const DEFAULT_DUTY_TIMEOUT_SEC: u64 = 600;
/// The default bridge rocksdb database retry count, if not overridden by the user.
pub(super) const ROCKSDB_RETRY_COUNT: u16 = 3;
8 changes: 4 additions & 4 deletions bin/bridge-client/src/modes/operator/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use super::{constants::DB_THREAD_COUNT, task_manager::TaskManager};
use crate::{
args::Cli,
constants::{
DEFAULT_DUTY_TIMEOUT_DURATION, DEFAULT_RPC_HOST, DEFAULT_RPC_PORT, ROCKSDB_RETRY_COUNT,
DEFAULT_DUTY_TIMEOUT_SEC, DEFAULT_RPC_HOST, DEFAULT_RPC_PORT, ROCKSDB_RETRY_COUNT,
},
db::open_rocksdb_database,
rpc_server::{self, BridgeRpc},
Expand Down Expand Up @@ -150,9 +150,9 @@ pub(crate) async fn bootstrap(args: Cli) -> anyhow::Result<()> {
Duration::from_millis,
);

let duty_timeout_duration = args.duty_timeout_duration.map_or(
Duration::from_secs(DEFAULT_DUTY_TIMEOUT_DURATION),
Duration::from_secs,
let duty_timeout_duration = Duration::from_secs(
args.duty_timeout_duration
.unwrap_or(DEFAULT_DUTY_TIMEOUT_SEC),
);

Check warning on line 157 in bin/bridge-client/src/modes/operator/bootstrap.rs

View check run for this annotation

Codecov / codecov/patch

bin/bridge-client/src/modes/operator/bootstrap.rs#L153-L157

Added lines #L153 - L157 were not covered by tests
// TODO: wrap these in `strata-tasks`
Expand Down
14 changes: 7 additions & 7 deletions crates/bridge-exec/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,16 +295,16 @@ where
.filter_map(move |msg| {
let msg = borsh::from_slice::<BridgeMessage>(&msg.0);
if let Ok(msg) = msg {
let payload = msg.payload();
let parsed_payload = borsh::from_slice::<Payload>(payload);
let scope = msg.scope();
let parsed_scope = borsh::from_slice::<Scope>(scope);
debug!(msg = ?msg, payload = ?parsed_payload, scope = ?parsed_scope, "got message from the L2 Client");
let raw_payload = msg.payload();
let payload = borsh::from_slice::<Payload>(raw_payload);
let raw_scope = msg.scope();
let scope = borsh::from_slice::<Scope>(raw_scope);
debug!(?msg, ?payload, ?scope , "got message from the L2 Client");

Check warning on line 302 in crates/bridge-exec/src/handler.rs

View check run for this annotation

Codecov / codecov/patch

crates/bridge-exec/src/handler.rs#L298-L302

Added lines #L298 - L302 were not covered by tests

match parsed_payload {
match payload {

Check warning on line 304 in crates/bridge-exec/src/handler.rs

View check run for this annotation

Codecov / codecov/patch

crates/bridge-exec/src/handler.rs#L304

Added line #L304 was not covered by tests
Ok(payload) => Some((msg.source_id(), payload)),
Err(err) => {
warn!(?scope, ?payload, error=?err, "skipping faulty message payload");
warn!(?scope, ?raw_payload, error=?err, "skipping faulty message payload");

Check warning on line 307 in crates/bridge-exec/src/handler.rs

View check run for this annotation

Codecov / codecov/patch

crates/bridge-exec/src/handler.rs#L307

Added line #L307 was not covered by tests
None
}
}
Expand Down

0 comments on commit 984b8ad

Please sign in to comment.