Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resolver = "2"
default-members = ["node"]

[workspace.package]
version = "1.33.5"
version = "1.34.0"
edition = "2024"
repository = "https://github.com/NethermindEth/Catalyst"
license = "MIT"
Expand Down
18 changes: 18 additions & 0 deletions shasta/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub struct ShastaConfig {
pub propose_forced_inclusion: bool,
pub simulate_not_submitting_at_the_end_of_epoch: bool,
pub max_blocks_to_reanchor: u64,
pub proposal_include_after_restart_max_timeout_sec: u64,
}

impl ConfigTrait for ShastaConfig {
Expand Down Expand Up @@ -61,6 +62,17 @@ impl ConfigTrait for ShastaConfig {
.parse::<u64>()
.map_err(|e| anyhow::anyhow!("MAX_BLOCKS_TO_REANCHOR must be a number: {}", e))?;

let proposal_include_after_restart_max_timeout_sec =
std::env::var("PROPOSAL_INCLUDE_AFTER_RESTART_MAX_TIMEOUT_SEC")
.unwrap_or("60".to_string())
.parse::<u64>()
.map_err(|e| {
anyhow::anyhow!(
"PROPOSAL_INCLUDE_AFTER_RESTART_MAX_TIMEOUT_SEC must be a number: {}",
e
)
})?;

Ok(ShastaConfig {
shasta_inbox,
handover_window_slots,
Expand All @@ -69,6 +81,7 @@ impl ConfigTrait for ShastaConfig {
propose_forced_inclusion,
simulate_not_submitting_at_the_end_of_epoch,
max_blocks_to_reanchor,
proposal_include_after_restart_max_timeout_sec,
})
}
}
Expand All @@ -94,6 +107,11 @@ impl fmt::Display for ShastaConfig {
"simulate not submitting at the end of epoch: {}",
self.simulate_not_submitting_at_the_end_of_epoch
)?;
writeln!(
f,
"proposal include after restart max timeout: {}s",
self.proposal_include_after_restart_max_timeout_sec
)?;
Ok(())
}
}
2 changes: 2 additions & 0 deletions shasta/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ pub async fn create_shasta_node(
simulate_not_submitting_at_the_end_of_epoch: shasta_config
.simulate_not_submitting_at_the_end_of_epoch,
max_blocks_to_reanchor: shasta_config.max_blocks_to_reanchor,
proposal_include_after_restart_max_timeout_sec: shasta_config
.proposal_include_after_restart_max_timeout_sec,
};

let max_blocks_per_batch = if config.max_blocks_per_batch == 0 {
Expand Down
1 change: 1 addition & 0 deletions shasta/src/node/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ pub struct NodeConfig {
pub propose_forced_inclusion: bool,
pub simulate_not_submitting_at_the_end_of_epoch: bool,
pub max_blocks_to_reanchor: u64,
pub proposal_include_after_restart_max_timeout_sec: u64,
}
10 changes: 10 additions & 0 deletions shasta/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,9 @@ impl Node {
}

async fn wait_for_sent_transactions(&self) -> Result<(), Error> {
let start = std::time::Instant::now();
let timeout_sec = self.config.proposal_include_after_restart_max_timeout_sec;

loop {
let nonce_latest: u64 = self
.ethereum_l1
Expand All @@ -744,6 +747,13 @@ impl Node {
if nonce_pending == nonce_latest {
break;
}
if start.elapsed().as_secs() >= timeout_sec {
warn!(
"Waiting for sent transactions exceeded timeout of {}s (Nonce Latest: {}, Nonce Pending: {}). Proceeding anyway.",
timeout_sec, nonce_latest, nonce_pending
);
Comment on lines +750 to +754
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The timeout check uses start.elapsed().as_secs() and a fixed 6s poll interval, so the effective wait can exceed *_max_timeout_sec by up to ~6 seconds and will overshoot small timeouts (e.g., 1–5s). Consider comparing elapsed() against Duration::from_secs(timeout_sec) and sleeping for min(poll_interval, remaining_time) (or using tokio::time::timeout) to respect the configured maximum more precisely.

Copilot uses AI. Check for mistakes.
break;
}
debug!(
"Waiting for sent transactions to be executed. Nonce Latest: {nonce_latest}, Nonce Pending: {nonce_pending}"
);
Expand Down