test(e2e): de-flake test_restarts_observer basefee assertion#4
Conversation
fc78a5e to
e0f421b
Compare
|
Claude finished @bdimitrov-netzine's task in 1m 20s —— View job Code Review
SummaryThe fix correctly addresses the root cause: the original assertion required the basefee collector to grow by an exact per-tx computed amount ( The change is minimal, the variable rename ( Observation: the explicit post-retry guard is dead code
let new_basefee =
get_balance_above_with_retry(node_test, &basefee_address.to_string(), current_basefee)?;
// ^^^^^^^^^^^^^^
// returns Ok(bal) only when bal > current_basefee; otherwise returns Err → propagated by ?
if fee_index > 0 && new_basefee <= current_basefee { // ← can never be true
This isn't a bug (the real safeguard is the retry function), but the guard reads like an active assertion when it is in fact dead code. This could mislead a future reader into thinking the check fires under some condition. Options:
Additionally, after this change Minor nitThe multi-line comment at lines 99–103 is good context, but its last sentence ("this check is deterministic") is slightly inaccurate now that the check it refers to ( Overall: The fix is correct and the flake will be resolved. The dead-code observation above is worth addressing for long-term clarity, but is not a blocker. |
Security Scan - CodeSeverity: HIGH, CRITICAL No vulnerabilities found View scan results |
e0f421b to
a609ddd
Compare
|
Claude finished @bdimitrov-netzine's task in 1m 23s —— View job Code Review
SummaryThe core fix is correct: the exact-increment assertion That said, there are two issues worth resolving before merge. Issue 1: Dead-code guard (previously flagged, still present)
let new_basefee =
get_balance_above_with_retry(node_test, &basefee_address.to_string(), current_basefee)?;
// ↑ returns Ok(bal) ONLY when bal > current_basefee; otherwise Err → propagated by ?
if fee_index > 0 && new_basefee <= current_basefee { // ← unreachable in the success path
error!(...);
return Err(...);
}
Recommended fix: remove the Issue 2:
|
Summary
send_and_confirmasserted the basefee collector grew by an exact per-tx amount (current + current/fee_index). Under EIP-1559 the base fee drifts block-to-block, so consecutive transfers don't contribute a byte-identical fee — making the check pass or fail depending on timing (the intermittent "Expected a basefee increment!" nightly failures).Relax it to assert only a strict increase: the transfer paid a base fee into the collector.
get_balance_above_with_retryalready waits for the balance to exceed the prior value, so this is deterministic.PR description:
Summary
test_restarts_observernightly e2e test by relaxing an overly-strict basefee assertion insend_and_confirm.current_basefee + current_basefee / fee_index). Under EIP-1559, the base feedrifts block-to-block, so this exact match doesn't hold on every run, causing intermittent
"Expected a basefee increment!"failures in the nightly suite.get_balance_above_with_retryalready polls until the balance exceeds the prior value, so this check is deterministic.Test plan
cargo build -p e2e-tests(or equivalent) to confirm it compilestest_restarts_observerlocally/in CI a few times to confirm no regressions and the flake is gone