PLT-454: LoadTx lifecycle timestamp plumbing - #41
Conversation
Add IntendedSendTs (+ reserved AttemptedSendTs, InclusionTs) to LoadTx and stamp IntendedSendTs in the dispatcher before hand-off into the send pipeline. Foundation of the coordinated-omission fix; pure plumbing, behavior-preserving (the existing dequeue-relative latency path is untouched). Documents the timestamp concurrency contract: single-writer-before-handoff, immutable after enqueue, InclusionTs owned solely by the future PLT-459 tracker. go build + go test -race ./... green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 56eec2e. Bugbot is set up for automated code reviews on this repo. Configure here. |
Apply idiomatic + measurement review feedback: - Rename IntendedSendTs/AttemptedSendTs/InclusionTs -> ...Time to match the package's existing time.Time naming convention (startTime, lastWindowTime). - Drop ticket-number / rollout-state changelog prose from comments; describe each field's durable contract instead. - Tighten the concurrency contract: timestamps are written by whichever goroutine owns the tx at that stage (ownership transfers via the channels), not "by the dispatcher before enqueue" — AttemptedSendTime is written by the owning worker post-dequeue. - Add guardrail: IntendedSendTime currently holds the back-pressured enqueue time and must not be used to derive latency until an open-loop scheduler sets it; zero timestamp means untracked (prewarm / stage not reached), not t=0. go build + go test -race (sender, generator, types) green; the flaky probabilistic TestAccountPoolMixedRate (unseeded global RNG, addressed by the seed work) passes 12/12 under -count=1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire the worker to stamp tx.AttemptedSendTime when it fires the send, removing the dead reserved field and making its doc accurate. The worker solely owns tx between dequeue (txChan) and the sentTxs hand-off, so the write is race-free per the LoadTx concurrency contract. Additive — the existing latency path is unchanged and nothing reads AttemptedSendTime yet (PLT-463's schedule_lag will). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Expert review — converged (no remaining concerns)Reviewed by independent specialists (not the authoring agent), two rounds:
Deferred to PLT-458 (open-loop scheduler), recorded on that issue: reserve the per-tx sequence index Behaviour-preserving (existing latency path untouched). |
Implements PLT-454 — the foundation PR of the coordinated-omission fix for the sei-load workload modeler.
What
IntendedSendTs+ reservedAttemptedSendTs/InclusionTstoLoadTx(types/scenario.go).IntendedSendTsinDispatcher.Run/RunBatchright before hand-off, where the dispatcher is the sole owner of the pointer (race-free, written exactly once).InclusionTsowned solely by the future PLT-459 tracker.Not in this PR (by design)
Nothing reads these fields for latency yet — the existing dequeue-relative path is untouched, so this is additive and behavior-preserving. PLT-458 moves
IntendedSendTsto the true scheduled instantt₀ + i/λ; PLT-459 populatesInclusionTs.Tests
go build ./...clean;go test -race ./...all packagesok.Decision brief:
designs/sei-load-workload-modeler/PLT-454-loadtx-timestamps.md(sei-protocol/bdchatham-designs).🤖 Generated with Claude Code