feat(batcher): per-batcher fixed-cadence flushing (SetTickInterval) + go-batcher v2.0.3 bump#1017
Conversation
Picks up SetTickInterval (fixed-cadence batch flushing) and the transitive dependency minimums required by go-batcher v2.0.3 (go-sdk, go-tx-map, go-bt, otel 1.44, golang.org/x/*). No API breakage; build and go vet pass across all packages.
|
🤖 Claude Code Review Status: Complete Current Review: No issues found. This PR is well-structured and maintains backward compatibility. Summary: This PR cleanly wires go-batcher v2.0.3's new SetTickInterval feature across all validator-path batchers, adds 10 new settings (all default 0/disabled), and includes a comprehensive test to guard against silent config misreads. Key Strengths:
Test Plan (per PR description):
No changes recommended. |
Benchmark Comparison ReportBaseline: Current: Summary
All benchmark results (sec/op)
Threshold: >10% with p < 0.05 | Generated: 2026-06-02 12:41 UTC |
…n the validator path Wires go-batcher v2.0.3's new SetTickInterval into every batcher the tx validator path touches: the UTXO-store batchers (aerospike store/get/spend/ outpoint/increment/setDAH/locked and the sql spend/get/create/unlock), the blockassembly send batcher, and the validator txmeta-kafka and gRPC client batchers. Each batcher gets a per-batcher <name>TickerIntervalMillis setting, defaulting to 0 (disabled) so behaviour is unchanged until tuned. Tick mode is mutually exclusive with drain mode; SetTickInterval is applied after SetDrainMode so go-batcher's own guard makes drain win (no-op + warning) on conflict. The validator gRPC client's batcher field becomes a pointer: the v2.0.3 Batcher carries a sync.Pool, so the prior value-copy would trip go vet copylocks and would not let SetTickInterval reach the worker's instance.
Code ReviewOverviewThe title and body describe a pure dependency bump ("Only
So this is a 🔴 Primary issue — inaccurate title & description
✅ Correctness (verified locally — build/vet/test clean)
✅ Test quality
🟡 Minor notes
VerdictWell-engineered, defaulted-off, tested, and verified to build/vet/test clean. The one thing that should block merge as-is is the misleading title and description — a behavioural feature on hot paths is presented as a no-op dependency bump. Fix the metadata (or split the commits) and this is good to go. |
The go-batcher v2.0.3 bump pulled otel/otel/trace/otel/metric to v1.44.0 but left otel/sdk and the otltrace exporters at v1.43.0 (Go MVS only raised what was strictly required). Align the remaining direct otel deps (sdk, otltrace, otltracehttp) to v1.44.0 so the otel surface is uniform; this also raises grpc and genproto to the versions otltracehttp v1.44.0 requires. Indirect metric exporters stay at their current versions (not used on the trace path).
|
Re-review (head
|
ordishs
left a comment
There was a problem hiding this comment.
Approving. Both prior-review concerns addressed: the PR is now correctly labeled feat with the feature, 10 new settings, and behavioural notes fully documented, and the otel trace surface is aligned to v1.44.0. Re-verified at head 93ac463 — build, vet (incl. -tags aerospike), go mod verify/tidy, and the settings loader test all clean. The new tick settings default to 0 (disabled), so behaviour is unchanged until tuned. LGTM.


Summary
Two related, separable commits — a dependency bump and the feature it unlocks:
chore(deps)— bumpgithub.com/bsv-blockchain/go-batcher/v2v2.0.0→v2.0.3(latest), plus the transitive minimums v2.0.3 requires (go-sdk,go-tx-map,go-bt,otelotel submodules→v1.44.0,golang.org/x/*).feat(batcher)— wires v2.0.3's newSetTickInterval(fixed-cadence batch flushing) across every go-batcher instance on the tx-validator path, exposed via per-batcher settings, all defaulting to0(disabled) so behaviour is unchanged until explicitly tuned.New settings (10, all
intmilliseconds, default0= disabled)utxostore_storeBatcherTickerIntervalMillisutxostore_getBatcherTickerIntervalMillisutxostore_spendBatcherTickerIntervalMillisutxostore_outpointBatcherTickerIntervalMillisutxostore_incrementBatcherTickerIntervalMillisutxostore_setDAHBatcherTickerIntervalMillisutxostore_lockedBatcherTickerIntervalMillisblockassembly_sendBatchTickerIntervalMillisvalidator_sendBatchTickerIntervalMillisvalidator_txmeta_kafka_batchTickerIntervalMillisWhen
> 0, the batcher flushes every N ms regardless of fill (empty ticks skipped); the size cap still forces an early flush.Behavioural notes
SetTickIntervalis applied afterSetDrainModeat every call site, so go-batcher's own guard no-ops the tick (with a warning) when drain is enabled.validator/Client.gobatcher field: value → pointer. v2.0.3'sBatcherembeds async.Pool, so the priorbatcher = *NewWithPool(...)value-copy would tripgo vet copylocksand would silently drop the ticker state (the worker runs on the original instance). Usages (TriggerBatcher,ValidateWithOptions) are guarded by the samebatchSizecheck as construction, so the now-nilable pointer is never dereferenced when batching is disabled.otel,otel/trace,otel/metric,otel/sdk,otltrace,otltracehttp) are atv1.44.0(the go-batcher bump raised some; a follow-up commit aligned the rest). Indirect metric exporters (otlpmetric*) stay at their current versions — not on the trace path.Test plan
go build ./...— successgo veton all changed packages (incl.-tags aerospiketest compile) — no issuesgolangci-lint run --new-from-rev=HEAD— no issuessettings:TestBatcherTickInterval_LoaderReadsAllKeys(asserts each of the 10 keys' non-zero override propagates, guarding the "tagged but unread" bug) + full package (157)validator+blockassembly: 978 passedsqlstore: 234 passed