Repository navigation
test(e2e): exercise block sync during slow local application - #1560
Conversation
Use request failures and existing deadlines to judge peer health. Remove the byte-rate filter measured at application dequeue, which could exclude healthy small-block peers permanently and hand sync over far below the chain tip. Cover slow consumption, continued scheduling, and consensus handoff with a deterministic regression. Preserve timeout retries, failure thresholds and pending limits, and clarify the historical reactor documentation. Fixes #1534 <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: OpenAI GPT-6 Astra <[email protected]>
Keep the synchronizer fake clock without mutating the unused flowrate global. Co-Authored-By: OpenAI Codex <[email protected]>
Measure the union of client-admitted unanswered requests, credit validated blocks and bytes before result buffering, and use bounded cooldown probes to reduce sustained slow service without disconnecting or hiding available heights. Settle observations once across early replies, cancellation and timeout, and register requests before publishing them to avoid losing an early response. Keep existing hard deadlines, failure handling and backlog limits. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: OpenAI GPT-6 Astra <[email protected]>
Add an explicit manual scenario with four serving peers and a late full node. Hold its FinalizeBlock while networking continues, verify local buffering and peer retention, then require fresh requests and catchup. Keep this scenario outside CI and scope cleanup to its Compose project. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude GPT-6 <[email protected]>
Merge the completed PR1548 squash while preserving PR1549 active-service ranking, atomic pending/probe reservation and recovery behavior. The resulting source tree is unchanged from the published PR1549 head. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Codex <[email protected]>
…cksync-slow-apply-e2e
Use the phase deadline for every recovery/backlog request and give Compose shutdown its own timeout after collecting logs. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude GPT-6 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
✅ Final review complete — no blockers (commit f3ec67a) · triage: normal |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Static verification confirms one blocking cleanup defect: a fresh output directory does not establish exclusive ownership of the Docker Compose project, so the new command can remove unrelated containers. The application gate and hold/recovery assertions otherwise match the intended manual scenario, with no production consensus changes. Current CI shows successful build, lint, and E2E checks; tests (01) fails in the unchanged TestLoadHeightProgressUnderSustainedFlood budget-contention assertion, which appears unrelated to this diff. No local builds or tests were run.
🔴 1 blocking
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — The diff adds a substantial opt-in E2E scenario and application gate, but does not change production consensus, cryptography, peer-facing deserialization, or storage migrations. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— tenderdash-consensus-security (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `test/e2e/runner/slow_apply.go`:
- [BLOCKING] test/e2e/runner/slow_apply.go:96-100: Establish exclusive Compose project ownership before removing orphans
The fresh-directory and container-name checks do not establish ownership of the effective Compose project. Neither these commands nor infra.StartNode passes an explicit project name, and the generated Compose file contains no top-level project name. The documented invocation creates a directory named `network` beneath a unique temporary parent, so Compose defaults to the project name `network`, not the unique parent name. An unrelated Compose application using that project name can have entirely different container names and pass all five inspect checks, yet this deferred `down --remove-orphans` will remove its containers—even when scenario startup fails. An inherited COMPOSE_PROJECT_NAME can cause the same collision. Establish an unused, task-specific project identity and apply it consistently to infrastructure startup, port lookup, log collection, and cleanup, or refuse to proceed when the effective project already owns resources.
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them. |
Move the manual `runner slow-apply` scenario into the regular e2e stack as its own CI network, blocksync-slow-apply, instead of a separate subcommand. - New node manifest option `finalize_hold`: the e2e app holds its first FinalizeBlock for that long, sampling node metrics in-process every second, and records them (plus the later block-sync handoff) in data/app/finalize_hold.json. - TestBlockSync_FinalizeHold asserts post hoc what the runner checked live: block sync stays active with >=2 peers, no eviction and a fixed block store for the whole hold; >16 KiB of buffered responses; more requests/responses after release, store past start_at and consensus handoff within two minutes; caught up with the network. - The hold is 65 s: block sync's 60 s stall timeout must be crossed for a premature handoff to be possible at all. - New network option `create_empty_blocks_interval` bounds a lone validator's block production (as the manual runner did). - TestValidator_Sets no longer panics on full nodes that block-synced from a genesis without validator public keys. - Remove `runner slow-apply`, test/e2e/manual and the file gate. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them. |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Verified the findings against head 8ce4d65. The previous Compose orphan-cleanup issue is fixed, but two missing synchronization barriers can make the new e2e scenario reject healthy startup or recovery. This was a static review; current CI shows successful build, test, lint, and all three e2e jobs, with PR Hygiene still pending.
🔴 2 blocking
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — The change adds substantial e2e test infrastructure, application hold logic, metrics sampling, and CI coverage, but does not itself modify consensus rules or another qualifying critical surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— tenderdash-consensus-security (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `test/e2e/app/finalize_hold.go`:
- [BLOCKING] test/e2e/app/finalize_hold.go:189-191: Establish multiple connected sources before measuring the hold
The first hold sample is taken immediately inside the first FinalizeBlock, but TestBlockSync_FinalizeHold requires every sample to report at least two connected peers. Router.OnStart launches dialing asynchronously, and jobGenerator.getPeer accepts a single available source; neither path guarantees a second connection before the first block is applied. A healthy startup can therefore permanently record PeersConnected == 1 and fail the new CI scenario even when the remaining sources connect immediately afterwards. Add a bounded multiple-source readiness wait in the e2e hook before starting the measured hold, then retain the full 65-second observation window so it still crosses the stall timeout.
In `test/e2e/tests/blocksync_test.go`:
- [BLOCKING] test/e2e/tests/blocksync_test.go:86-89: Wait for the asynchronous handoff record until the recovery deadline
The record is read only once at line 62, while watchHandoff adds Handoff asynchronously after a one-second sampling tick and an atomic file replacement. The runner does not establish a handoff-record barrier: Start checks only start_at, and subsequent Wait calls use fixed height targets derived from the least advanced node, without requiring block-sync completion. If this test reads the release-only record during an otherwise healthy recovery, it immediately reports that handoff never happened even though the two-minute recovery allowance has not expired. Reload the record until Handoff is present or ReleasedAt + maxHoldRecovery expires, and apply the recovery assertions to the refreshed record rather than relying on time spent in earlier generic tests.
- The e2e app now waits (bounded, 30 s) for FinalizeHoldMinPeers connected sources before the measured hold starts: peers are dialed asynchronously and block sync may apply the first block from a single source, so the first sample could record one peer on a healthy start. The full hold is measured from ReadyAt, so it still crosses the 60 s stall timeout. A readiness timeout releases unheld and records ReadinessError, which the test reports explicitly. - TestBlockSync_FinalizeHold rereads the record until the asynchronously written handoff appears or the recovery allowance after release expires (WaitFinalizeHoldHandoff), instead of judging a release-only record. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The complete diff through 1f5fb25 was reviewed independently, including the hold lifecycle, readiness gating, asynchronous handoff recording, configuration validation, metric assertions, and validator-set handling. No actionable in-scope findings remain; build, lint, vet, protobuf, and vulnerability checks passed, while unit and e2e checks were still in progress in the supplied CI snapshot.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This substantial, cross-cutting e2e change adds application-hold instrumentation, recovery assertions, and CI coverage without changing production consensus rules or another qualifying critical surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— tenderdash-consensus-security (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— tenderdash-consensus-security (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
|
Bots are done — your move: post |
Drop blocksync-slow-apply from the e2e workflow matrix; it stays available through `make runner/blocksync-slow-apply`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Static verification of the complete diff at f3ec67a confirms that all three prior blocking findings are fixed. One non-blocking documentation inconsistency remains: the new local-only network still claims it runs in CI. Current GitHub checks show all build, test, lint, vet, vulnerability, and existing e2e checks passing; only PR Hygiene remains pending, and no builds or tests were run locally.
🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — The change adds substantial e2e test logic, configuration, and instrumentation, but does not itself change consensus rules or another qualifying critical surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— tenderdash-consensus-security (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— tenderdash-consensus-security (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `test/e2e/networks/blocksync-slow-apply.toml`:
- [SUGGESTION] test/e2e/networks/blocksync-slow-apply.toml:1-2: Update the network header to reflect local-only execution
The header says this network runs in CI, but the e2e workflow matrix contains only dashcore and rotate, and the README correctly documents this scenario as local-only. Update the header so readers do not mistake the new scenario for automated CI coverage.
|
Bots are done — your move: post |
|
Policy satisfied — this can merge. |
TL;DR: A new local e2e network checks that block sync can recover after the local application is held, while healthy sources stay available.
User story
As a Tenderdash maintainer, I want slow local application execution exercised separately from slow network sources, so peer-scheduling changes get checked against the right cause of a stalled sync on every PR.
Scenario
Base flow
A genesis validator and three full nodes serve small blocks to a fifth full node that starts late. State sync is disabled. The late node's application waits inside its first FinalizeBlock for 65 seconds, longer than block sync's 60-second stall timeout, while networking keeps running.
Actual behavior
None of the e2e networks held just the application's execution. None of them checked that block-sync sources stayed usable through such a hold.
Expected behavior
Block responses pile up locally. No consensus handoff happens early and no peer is evicted. After the application is released, the node sends more requests and gets more responses, then hands over to consensus within two minutes and keeps up with the network.
Detailed discussion
What was done
networks/blocksync-slow-apply.toml, run locally through therunner/blocksync-slow-applymake target; it is intentionally not part of the GitHube2eworkflow matrix.finalize_hold. It holds the e2e app's first FinalizeBlock and is one-shot (a restart does not hold again). It can be cancelled through the context. The measured hold starts once at least two block-sync sources are connected (bounded 30 s wait; a timeout releases the app unheld and records the error). Only the builtin ABCI protocol,mode = "full",start_atwithout state sync,queue_type = "priority"and no perturbations are allowed.data/app/finalize_hold.jsonon release. A background watcher adds the first sample after block sync hands over to consensus. The test rereads the record until that handoff sample appears or the two-minute recovery allowance expires.TestBlockSync_FinalizeHoldchecks everything the manual runner checked live, but after the run, from that record and the node's own state. It only runs on nodes that use the option:start_at, consensus handoff, still no evictions;create_empty_blocks_interval(1 s here). As in the manual runner, it limits block production instead of block delivery, because a lone validator otherwise outruns the nodes following it in consensus.max_block_size = 8192keeps blocks small.TestValidator_Sets: it panicked on a full node that block-synced from a genesis without validator public keys (FULLNODE_PUBKEY_KEEP=false, as in CI). The new network is the first e2e network with such nodes.runner slow-applysubcommand,test/e2e/manual/and the file-based gate.Why a separate network rather than an extra node in
dashcore. Measured locally with the same image, one network at a time:The extra node adds 72.7 s on average (+24.9%). Almost all of it is in Start, which waits for the held node one node at a time. Block production on the original nodes during the hold did not change (1.23–1.28 blocks/s against 1.25–1.29 in the same window without the extra node). The new network finishes in about 160 s, so it runs as a short parallel leg.
Testing
blocksync-slow-applyran locally to completion, green, withTestBlockSync_FinalizeHold/slowapplyand every generic e2e test passing. Hold record: held 65.0 s at height 1, 66 samples, 4 peers, no evictions, about 132 KB of responses buffered. Handoff came 6 s after release at store height 184, with request bytes 128→425 and response bytes 132→394 KB.dashcorevariant with a held node also passedTestBlockSync_FinalizeHoldin both runs.-race -tags=deadlock(the hold tests also passed 20 repeated runs). CI-pinned golangci-lint v2.15.0 reports no new issues,.Breaking changes
None. Production code is unchanged. The
runner slow-applysubcommand, which only this PR had added, is gone.Prior work
Attribution
🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code
PR Hygiene ·
f3ec67aWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.