Skip to content

test(e2e): stop the daemon before the G-NODE-07 iroh rotation - #2736

Merged
thiras merged 1 commit into
mainfrom
fix/2727-rotate-key-graceful-stop
Oct 28, 2026
Merged

thiras merged 1 commit into
mainfrom
fix/2727-rotate-key-graceful-stop

Conversation

@thiras

@thiras thiras commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What

g_node_07_rotate_key::rotate_key_rebinds_slashability_and_preserves_in_flight_vouchers rotated the iroh key with the daemon running, then restarted it with restart(). restart() sends SIGKILL, so the graceful shutdown's final redeem sweep never ran.

A step-1 voucher that the hint path had not redeemed before the kill therefore waited for the restarted daemon's next full redeem interval. That is 300 s at the fixture default, because redeemer_loop skips its first tick. The test's 90 s served_bytes poll expired first.

A loaded local run reproduced the CI failure:

  • the daemon restarted 1.7 s after it started, with lanes=1;
  • the poll then failed with vouchers signed against the pre-rotation identity never settled on-chain.

The fix sends SIGTERM (node.terminate) before the real rotation. This follows step 3 ("Stop") of the operator key rotation runbook. rotate-key is documented to work with the daemon down, and steps 3–4 read only chain state. A stopped daemon also sends nothing from the operator key while the CLI sends bindNodeId, which removes a nonce race of the #2721 kind.

Closes #2727

Verification

  • 10 batches of binary(g_node_0*) | binary(node_pull_topup) with --retries 0, run while other e2e loops shared the host:
    • every batch passed;
    • rotate_key_rebinds… passed 10/10, and so did both sibling g_node_07 tests.
  • cargo fmt -- --check and cargo clippy -p decdn-e2e --all-targets --all-features -- -D warnings are clean.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 28, 2026 21:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main f2bc01c fix/2727-rotate-key-... a1eb1f1 +/-
77% 77% 0%
View coverage of the 3 most impacted files.
File main f2bc01c fix/2727-rotate-key-... a1eb1f1 +/-
crates/protocol/src/framing.rs 93% 92% -1%
crates/client/src/lib.rs 89% 89% 0%
crates/node/src...s/client/mod.rs 91% 91% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

The rotation journey rotated with the daemon running, then restarted it
with SIGKILL. A step-1 voucher the hint path had not redeemed yet was
then held until the restarted daemon's next full redeem interval (300 s
at the fixture default), past the 90 s settlement poll. A loaded run
showed it: the daemon restarted 1.7 s after start with `lanes=1` and the
poll failed "vouchers signed against the pre-rotation identity never
settled on-chain".

The journey now sends SIGTERM before the real rotation, as the runbook's
"Stop" step does. The graceful shutdown's final redeem sweep settles the
voucher, and the stopped daemon sends nothing from the operator key while
the CLI sends `bindNodeId`.

10 loaded batches of the g_node_0* journeys plus node_pull_topup: all
pass.

Closes #2727

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras
thiras force-pushed the fix/2727-rotate-key-graceful-stop branch from a1eb1f1 to e316b5d Compare October 28, 2026 22:38
@thiras
thiras merged commit bb37102 into main Oct 28, 2026
9 checks passed
@thiras
thiras deleted the fix/2727-rotate-key-graceful-stop branch October 28, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(e2e): g_node_07 rotate_key_rebinds_slashability_and_preserves_in_flight_vouchers flaked once in CI (not reproduced locally)

2 participants