Repository navigation
chore(release): update changelog and bump version to 1.6.0 - #1373
Merged
Merged
Conversation
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.6.0 to 3.7.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](docker/login-action@v3.6.0...v3.7.0) --- updated-dependencies: - dependency-name: docker/login-action dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.9 to 1.11.1. - [Release notes](https://github.com/lib/pq/releases) - [Changelog](https://github.com/lib/pq/blob/master/CHANGELOG.md) - [Commits](lib/pq@v1.10.9...v1.11.1) --- updated-dependencies: - dependency-name: github.com/lib/pq dependency-version: 1.11.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
…m/lib/pq-1.11.1 build(deps): Bump github.com/lib/pq from 1.10.9 to 1.11.1
…r/login-action-3.7.0 build(deps): Bump docker/login-action from 3.6.0 to 3.7.0
* feat(config): better error handling for access denied errors * chore: review * chore: perms fixes * chore: comment * fix: mem db doesn't use disk
* chore: instructions for AI agents in AGENTS.md * chore: style guide * chore: style guide improvements * chore: agents, more improvements * chore: clarify branch discovery and PR description rules in AGENTS.md Co-Authored-By: Claude Opus 4.6 <[email protected]> * chore: dot. * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* chore: instructions for AI agents in AGENTS.md * chore: style guide * chore: style guide improvements * chore: agents, more improvements * chore: clarify branch discovery and PR description rules in AGENTS.md Co-Authored-By: Claude Opus 4.6 <[email protected]> * chore: dot. * Initial plan * docs: align contributor documentation Co-authored-by: lklimek <[email protected]> * docs: clarify commit guidance Co-authored-by: lklimek <[email protected]> * docs: refine contributor details Co-authored-by: lklimek <[email protected]> * docs: clarify upgrade and deps guidance Co-authored-by: lklimek <[email protected]> * docs: address review feedback Co-authored-by: lklimek <[email protected]> * docs: clarify stable branch guidance Co-authored-by: lklimek <[email protected]> * docs: refine stable release guidance Co-authored-by: lklimek <[email protected]> * docs: clarify release flow Co-authored-by: lklimek <[email protected]> * docs: align semver wording Co-authored-by: lklimek <[email protected]> --------- Co-authored-by: Lukasz Klimek <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Fix GO-2026-4337 (unexpected TLS session resumption) by updating Go from 1.25.6 to 1.25.7. Bump direct and indirect dependencies to their latest compatible versions, including golang.org/x/*, OpenTelemetry, gRPC gateway, Docker CLI, Sentry, Badger, and ~50 other packages. Replace retracted prometheus/common v1.20.99 with v0.67.5. Update Go version in Dockerfiles, CI workflows, documentation, and README to match. Co-authored-by: Claude Opus 4.6 <[email protected]>
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.11.1 to 1.11.2. - [Release notes](https://github.com/lib/pq/releases) - [Changelog](https://github.com/lib/pq/blob/master/CHANGELOG.md) - [Commits](lib/pq@v1.11.1...v1.11.2) --- updated-dependencies: - dependency-name: github.com/lib/pq dependency-version: 1.11.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix(p2p): improve address validation rules * chore: fix nil deref * chore: minor fixes Signed-off-by: Lukasz Klimek <[email protected]> * fix(p2p): improve validation error context and add Endpoint.Equal tests Add hostname value to ValidateHostname error messages for easier debugging, fix uint16 port comparison, document IDN rejection policy, and add dedicated unit tests for Endpoint.Equal covering IPv4/IPv6 representations. Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Signed-off-by: Lukasz Klimek <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
… bls-signatures (#1263) * build(deps): bump github.com/creachadair/atomicfile from 0.4.0 to 0.4.1 Patch release with dependency updates and a minor comment fix. No functional changes. Refs: dependabot PR #1260 Co-Authored-By: Claude Opus 4.6 <[email protected]> * build(deps): bump google.golang.org/grpc from 1.78.0 to 1.79.1 Notable changes: - Bug fix: Remove -dev suffix from User-Agent header (v1.79.1) - Security fix: HTTP/2 server header size check enforcement (v1.79.0) - New: weighted random shuffling of endpoints (gRFC A113) - New: random_subsetting LB policy (gRFC A68) - Fix: TLS authority override port stripping - Performance: buffer pool, slice allocation optimizations Refs: dependabot PR #1262 Co-Authored-By: Claude Opus 4.6 <[email protected]> * build(deps): bump github.com/golangci/golangci-lint/v2 from 2.8.0 to 2.10.1 Notable changes: - v2.10.1: Fix buildssa panic - v2.10.0: gosec 2.22.11→2.23.0 (new rules G117, G602, G701-G706), staticcheck 0.6.1→0.7.0, ginkgolinter 0.22.0→0.23.0 - v2.9.0: go1.26 support, new linter rules for revive (epoch-naming, use-slices-sort), arangolint query injection detection Also bumps transitive deps: godoc-lint, securego/gosec, honnef.co/go/tools (staticcheck), golang.org/x/exp/typeparams. Refs: dependabot PR #1261 Co-Authored-By: Claude Opus 4.6 <[email protected]> * build(deps): bump docker/build-push-action from 6.18.0 to 6.19.2 Security improvements: - v6.19.0: Scope default GIT_AUTH_TOKEN to github.com (was previously unscoped), bump several JS deps (lodash, undici, etc.) - v6.19.1: Derive GIT_AUTH_TOKEN host from GitHub server URL - v6.19.2: Preserve port in GIT_AUTH_TOKEN host Refs: dependabot PR #1259 Co-Authored-By: Claude Opus 4.6 <[email protected]> * build(deps): bump dashpay/bls-signatures/go-bindings to v1.3.6 Updates from Dec 2024 (0bb5c5b) to Oct 2025 (dd68365) commit. Maintenance release: CI modernization (ubuntu-20.04 → ubuntu-latest), CMake updates, Windows build fix (libssp removal). No security or functional changes. Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
Bumps [github.com/bufbuild/buf](https://github.com/bufbuild/buf) from 1.65.0 to 1.66.0. - [Release notes](https://github.com/bufbuild/buf/releases) - [Changelog](https://github.com/bufbuild/buf/blob/main/CHANGELOG.md) - [Commits](bufbuild/buf@v1.65.0...v1.66.0) --- updated-dependencies: - dependency-name: github.com/bufbuild/buf dependency-version: 1.66.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 6 to 7. - [Release notes](https://github.com/goreleaser/goreleaser-action/releases) - [Commits](goreleaser/goreleaser-action@v6...v7) --- updated-dependencies: - dependency-name: goreleaser/goreleaser-action dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/adlio/schema](https://github.com/adlio/schema) from 1.3.9 to 1.4.0. - [Release notes](https://github.com/adlio/schema/releases) - [Commits](adlio/schema@v1.3.9...v1.4.0) --- updated-dependencies: - dependency-name: github.com/adlio/schema dependency-version: 1.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v7...v8) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v6...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.2.0 to 6.3.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v6.2.0...v6.3.0) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5 to 6. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](docker/metadata-action@v5...v6) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/golangci/golangci-lint/v2](https://github.com/golangci/golangci-lint) from 2.10.1 to 2.11.3. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/main/CHANGELOG.md) - [Commits](golangci/golangci-lint@v2.10.1...v2.11.3) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint/v2 dependency-version: 2.11.3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.41.0 to 0.42.0. - [Commits](golang/sys@v0.41.0...v0.42.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-version: 0.42.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1280) Bumps [github.com/sasha-s/go-deadlock](https://github.com/sasha-s/go-deadlock) from 0.3.6 to 0.3.7. - [Release notes](https://github.com/sasha-s/go-deadlock/releases) - [Commits](sasha-s/go-deadlock@v0.3.6...v0.3.7) --- updated-dependencies: - dependency-name: github.com/sasha-s/go-deadlock dependency-version: 0.3.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.12.0 to 4.0.0. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](docker/setup-buildx-action@v3.12.0...v4.0.0) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.19.2 to 7.0.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](docker/build-push-action@v6.19.2...v7.0.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.7.0 to 4.0.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](docker/login-action@v3.7.0...v4.0.0) --- updated-dependencies: - dependency-name: docker/login-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/time](https://github.com/golang/time) from 0.14.0 to 0.15.0. - [Commits](golang/time@v0.14.0...v0.15.0) --- updated-dependencies: - dependency-name: golang.org/x/time dependency-version: 0.15.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/bufbuild/buf](https://github.com/bufbuild/buf) from 1.66.0 to 1.66.1. - [Release notes](https://github.com/bufbuild/buf/releases) - [Changelog](https://github.com/bufbuild/buf/blob/main/CHANGELOG.md) - [Commits](bufbuild/buf@v1.66.0...v1.66.1) --- updated-dependencies: - dependency-name: github.com/bufbuild/buf dependency-version: 1.66.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.79.1 to 1.79.2. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.79.1...v1.79.2) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.79.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#1282) Bumps [styfle/cancel-workflow-action](https://github.com/styfle/cancel-workflow-action) from 0.13.0 to 0.13.1. - [Release notes](https://github.com/styfle/cancel-workflow-action/releases) - [Commits](styfle/cancel-workflow-action@0.13.0...0.13.1) --- updated-dependencies: - dependency-name: styfle/cancel-workflow-action dependency-version: 0.13.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.40.0 to 0.41.0. - [Commits](golang/term@v0.40.0...v0.41.0) --- updated-dependencies: - dependency-name: golang.org/x/term dependency-version: 0.41.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.55.0 to 0.56.0. - [Commits](golang/net@v0.55.0...v0.56.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-version: 0.56.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test(types): stabilize TestStateID_Copy — deterministic AppHash mutation RandStateID fills AppHash with random bytes. The test mutated AppHash[5] to a fixed constant (0x12); whenever the random byte at that index already equaled the constant, the assignment was a no-op, the copy stayed equal to the original, and assert.NotEqual failed (~1/256 of runs). Flip the byte's bits instead, guaranteeing the mutated value always differs from the original. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test(abci/client): stabilize TestSocketClientTimeout/immediate — adequate timeout margin The no-delay 'immediate' case used timeout == baseTime == 10ms, so the request's deadline had to absorb the entire fixed cost of a socket round-trip (goroutine scheduling + the serialized Info+CheckTx requests over the unix socket) under -race on a loaded CI host. That overhead can exceed 10ms, tripping the deadline before the response arrives and failing require.NoError with 'context deadline exceeded'. baseTime is the unit every case scales from, defining cases by their relative timing. Raise it 10ms -> 50ms: this preserves every case's semantics (success keeps sleep < timeout, failure keeps sleep > timeout) while giving all margins — including the immediate case's overhead budget — 5x more headroom. Max per-subtest sleep stays at 200ms, well under the 1s parent context. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test(commands): stabilize TestRollbackIntegration — tolerant data-dir cleanup The test intermittently failed in t.Cleanup with 'TempDir RemoveAll cleanup: unlinkat .../data: directory not empty'. Both nodes are stopped via Wait() before the test returns, and OnStop closes every node database (blockstore, state, evidence, peer, tx_index) and waits all reactors — so teardown is correct. But as goleveldb and other background resources under <RootDir>/data flush and release on shutdown they can momentarily create files, and t.TempDir's automatic cleanup does a single-shot RemoveAll that fails the whole test if it races one such transient write. Remove RootDir ourselves first, with a bounded retry, once every node has stopped (registered after the t.TempDir cleanup, so it runs before it via LIFO). Transient races are absorbed by the retry; a genuine leak still fails the test once the ~2s budget is exhausted. Also close the shared kvstore app, the one resource the test never released. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test(consensus): harden waitForAndValidateBlock failure path waitForAndValidateBlock spawns one worker per node and only treats a context DeadlineExceeded as fatal. A worker can also bail out with a nil block when its subscription is terminated without a context error (for example its buffer overflows because consensus raced ahead while another node stalled). The function then returned a slice with nil entries that the caller dereferenced (firstBlock.ValidatorsHash, block.Height), panicking — which crashes the whole package test binary and fails every other test in the CI shard rather than just this one. Fail cleanly instead: treat any context error as the timeout, and assert every node delivered a block, naming the offending node. This contains a rare stall to a single, clearly-diagnosable test failure. NOTE: this hardens the failure behaviour; it does not eliminate the underlying rare wedge. Root-caused via a captured 120s failure: a node that briefly falls behind around a validator-set-change boundary (stuck at the block before a vals removal) fails to recover via consensus catch-up gossip while the unthrottled network races hundreds of blocks ahead. That is a consensus-reactor catch-up limitation across validator set transitions and needs a separate, dedicated production fix. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
* fix(types): input validation and bounds checks Tighten validation and resource bounds in the types package: - Bound PartSetHeader.Total to MaxBlockPartsCount in ValidateBasic, so an oversized declared part count is rejected on the proposal path (via Proposal -> BlockID -> PartSetHeader.ValidateBasic) before allocation. - Bind a block part's outer Index to its proof Index in both Part.ValidateBasic and PartSet.AddPart, preventing a part from being relabeled into another slot. Adds the ErrPartSetIndexMismatch sentinel. - Make the threshold-signature recoverer return errors instead of terminating on inconsistent input: NewSignsRecoverer now returns (*SignsRecoverer, error) and the count-mismatch, non-precommit, and AddThresholdSignature paths return errors that propagate to the recovery call site. The quorum-time hard failure is left intentional and documented. - Cap the number of tracked peer majority claims per vote set (maxPeerMaj23s), dropping excess claims from unseen peers without erroring so callers do not disconnect honest peers. Adds table-driven tests for each change. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(types): address review feedback on validation/bounds change - raise maxPeerMaj23s to 4096 (above any realistic peer count / LLMQ size) and document the bound; log dropped claims when the cap is hit - signs recoverer: check vote type before initializing extensions, and reject a vote whose extension count differs from the established count (was silently accepted on the zero-extension path) - store test: handle NewSignsRecoverer/Recover errors instead of discarding them Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(types): tighten vote-extension consistency and recoverer input validation - signs recoverer: establish the expected vote-extension count from the first vote observed (regardless of count) so a mixed-presence set is rejected in both orders, not only when zero-extension votes arrive last - part set: return ErrPartSetIndexMismatch from Part.ValidateBasic so callers can match it with errors.Is (PartSet.AddPart already did) - vote extension: validate validator/signature lengths in AddThresholdSignature before the array conversion, returning an error instead of panicking on malformed input Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(types): enforce BlockID bound in Commit.ValidateBasic Commit.ValidateBasic checked for a nil BlockID but never called BlockID.ValidateBasic(), leaving the PartSetHeader.Total > MaxBlockPartsCount bound unenforced on the CommitMessage / p2p path. Add the call (after the nil check, consistent with every other ValidateBasic in the file) so an oversized PartSetHeader.Total is rejected before allocation. Also update TestCommit_ValidateBasic: add a dedicated case for the oversized-Total rejection, and supply a valid StateID in the fixtures that carry a non-nil Hash so they pass BlockID.ValidateBasic's StateID length check (which was added as part of this PR). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
* fix(light): robustness improvements in client verification Verify query proofs and block results against the trusted header at the same height. AppHash and ResultsHash are committed in the header at the block's own height (same-block execution), so anchoring verification to the next height compared against a header that does not commit the data being verified. A witness that reports a header conflicting with the primary's now fails the comparison instead of being silently dropped; the dissenting witness is kept, since the primary may be the faulty party. The witness comparison goroutine also returns after reporting a conflict so each witness sends exactly one result on the channel. Validator-set responses from providers are nil-checked for the threshold public key and quorum hash before use, the threshold key is re-requested on a retry after a timed-out first attempt, and the pagination loop now advances the page index so a total that is not a multiple of the page size terminates. Adds table-driven tests covering same-block verification anchoring, the witness comparison flow, and the multi-page validator-set path. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(light): correct spelling 'favours' -> 'favors' in error comment Addresses misspell linter finding in errors.go. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…#1344) * fix(privval,p2p): validate chain ID and reject invalid ephemeral keys Add input validation on the signing and connection paths: - Validate the chain ID in all gRPC SignerServer handlers and reject requests whose chain ID does not match the expected value. - Reject low-order Curve25519 ephemeral public keys during the encrypted connection handshake (privval and internal/p2p/conn secret connection), making ErrSmallOrderRemotePubKey reachable. - Raise the log level of the non-TLS connection fallback from Info to Warn so operators notice unencrypted signer connections. Co-Authored-By: Claude Opus 4.6 <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> * refactor(privval,p2p): share low-order point check, assert handshake test errors Move the duplicated Curve25519 low-order point list into a single internal package (internal/libs/x25519) consumed by both the privval and p2p secret-connection handshakes, preserving the existing early reject of such ephemeral keys. Capture and assert the handshake script error in the affected tests so a failing script no longer passes silently. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> * refactor(privval,p2p): rely on stdlib X25519 to reject low-order points Drop the hand-rolled low-order point pre-check from the privval and p2p secret-connection handshakes. curve25519.X25519 (backed by crypto/ecdh) already returns an error for low-order points instead of producing an all-zero shared secret, so the explicit check and its ErrSmallOrderRemotePubKey error were redundant. Document the reliance at the Diffie-Hellman step and keep a regression test in internal/libs/x25519 that pins the standard-library rejection. The end-to-end handshake tests still assert that a low-order remote ephemeral key is rejected. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> * refactor(privval,p2p): inline low-order rejection tests, remove x25519 helper package Remove the internal/libs/x25519 package. Low-order point rejection is now covered directly in the privval and p2p secret-connection tests, which drive the real MakeSecretConnection handshake with low-order remote ephemeral keys and assert it is rejected by curve25519.X25519. Each test file carries its own copy of the known low-order points so the tests are self-contained. Repoint the Diffie-Hellman comment to these tests instead of the removed package. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> * test(privval): scope low-order key regression test to privval Drop the duplicate internal/p2p/conn low-order key regression test and revert the accompanying secret_connection.go cleanup. The privval handshake test already pins the curve25519.X25519 low-order rejection behaviour this branch relies on, so the node-to-node copy is redundant. Keeps the change focused on the privval signer path. * fix(p2p): drop unused ErrSmallOrderRemotePubKey The ErrSmallOrderRemotePubKey error was declared but never returned or referenced anywhere. The secret connection handshake relies on curve25519.X25519 (crypto/ecdh) to reject invalid/low-order ephemeral public keys, so this sentinel error is dead code. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(privval): reject empty chain IDs in signer validateChainID A SignerServer configured with an empty chainID previously accepted any request whose ChainId was also empty, because validateChainID was a single equality check. Guard both sides explicitly: an unconfigured server now returns FailedPrecondition, a request that omits the chain ID returns InvalidArgument, and a genuine mismatch keeps returning InvalidArgument. Extends TestSignerServerChainIDValidation with "unconfigured server rejected" (FailedPrecondition) and "empty request rejected" (InvalidArgument) subtests across every RPC handler, asserting the privVal backend is never reached on rejection. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test(privval): cover high-bit-set encodings of low-order points RFC 7748 §5 mandates that X25519 ignores the most-significant bit of byte 31, so the p-1, p and p+1 low-order encodings each have a second valid wire form with bit 7 of byte 31 set (0xff instead of 0x7f). Add those three variants to the lowOrderPoints table so the rejection test proves curve25519.X25519 refuses both wire forms. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
* fix(rpc): add input validation and request bounds Add defensive input validation and explicit limits across RPC request handling: - Validate the WebSocket Origin header against the configured allow-list before completing the connection upgrade. - Use a checked type assertion for the underlying http.Hijacker and return an error when it is unavailable, instead of an unchecked assertion. - Cap JSON-RPC batch requests at 100 entries per batch. - Bound the BlockSearch query-string length. - Reject negative indices in GenesisChunked. - Clamp UnconfirmedTxs pagination parameters to valid ranges. Co-Authored-By: Claude Opus 4.6 <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> * fix(rpc): address review — wrap query-length error, reject empty batch - Wrap the BlockSearch maximum-query-length error with coretypes.ErrInvalidRequest so clients receive Invalid request instead of Internal error, matching the other request-validation paths. - Reject an empty JSON-RPC batch ([]) with a single Invalid request response, per JSON-RPC 2.0. - Drop the out-of-scope inspect-server TODO comment. Co-Authored-By: Claude Opus 4.6 <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> * fix(rpc): honor CORSAllowedOrigins for inspect WS; restore light-proxy WS origin default The shared rpcserver.NewWebsocketManager default Origin policy is now OriginChecker(nil) (same-host / Origin-less only), which regressed two websocket entry points relative to their pre-change behavior. B1 — inspect RPC WS ignored CORSAllowedOrigins. The HTTP path honors the operator's CORS allow-list but the WS upgrade used the restrictive default, so an allow-listed browser origin worked over HTTP yet was 403'd at the WS upgrade. Thread rpcConfig.CORSAllowedOrigins into wm.CheckOrigin, mirroring the node RPC (internal/rpc/core/env.go) and the HTTP CORS handler. B2 — light proxy WS lost its historic permissive default with no opt-out. The proxy is configured via rpcserver.Config, which exposes no CORS knob, so the restrictive default silently rejected browser clients that worked before. Restore the prior allow-all origin policy with a documented comment; origin restrictions are expected to be enforced by AuthN/AuthZ in front of the proxy. Add a table-driven regression test for the inspect Handler WS origin policy (no-origin, same-host, allow-listed, and rejected cross-origin cases). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * docs(changelog): reference #1343 and note WS Origin default-policy change Add the (#1343) reference to the RPC input-validation entry and document that browser websocket clients on cross-origin hosts must now be listed in cors-allowed-origins following the WS Origin default-policy change. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(rpc): return http.ErrNotSupported from Hijack; warn on multi-* origin patterns statusWriter.Hijack now returns the stdlib http.ErrNotSupported sentinel instead of a bespoke error, matching net/http conventions for the "feature not supported" condition (HTTP/2 transports degrade cleanly). compileOriginMatchers only honors the first '*' in an allow-list entry (rs/cors semantics); any later '*' is matched literally and can never appear in a browser Origin, leaving the entry dead. It now warns at compile/config-load time so operators get feedback, with the godoc updated to state the single-wildcard contract. A logger is threaded through OriginChecker to all call sites. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test(rpc): cover OriginChecker port handling Pin the rs/cors port quirks inherited by OriginChecker: a wildcard-host pattern denies an Origin carrying a port suffix, an explicit-port pattern matches the same explicit port, and the same-host fallback denies on port mismatch. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(rpc): normalize nil logger in compileOriginMatchers Guard against a nil logger at the top of compileOriginMatchers so that callers passing nil to OriginChecker with a multi-wildcard allow-list entry no longer nil-deref on the logger.Warn call. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
* fix(state): propagate tx indexer database errors The tx KV indexer returned database read failures by panicking inside Get, match, and matchRange. These run synchronously on the tx-search RPC path, so a transient storage error terminated the query path instead of surfacing as a query error. Convert the storage-error panics to error returns, matching the block KV indexer sibling: iterator-creation failures and post-iteration Iterator.Error() failures in match/matchRange now return through Search, and Get returns a wrapped error. The match/matchRange signatures gain an error return and Search propagates it. Programming-invariant guards (the unhandled-operator default and the key-encoding marshalling helpers) keep their panics. Also converts the match function's untagged switch to a tagged switch on c.Op (staticcheck QF1002). Adds table-driven tests covering creation-time and post-iteration storage errors for Get, match (=, EXISTS, CONTAINS), and matchRange. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(state): wrap tx-indexer iterator scan errors Four bare `it.Error()` returns in the tx/kv indexer (TEq, TExists, TContains, and matchRange loops) were emitting raw errors with no breadcrumb, while the corresponding iterator-open failures had proper `fmt.Errorf` context. Wrap all four with "prefix iterator failed during scan: %w" so callers get consistent, actionable error messages. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
* fix(inspect): prevent nil eventBus panic on websocket disconnect Handler() declared eventBus as a nil interface but the websocketDisconnectFn closure called UnsubscribeAll on it unconditionally, panicking the inspect RPC server on every WebSocket disconnect. Added a nil guard since the inspect server registers no subscribe routes and the eventBus is intentionally absent here. Also adds TestHandlerWebsocketDisconnectNoPanic to catch regression. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(inspect): remove dead websocket-disconnect eventBus cleanup The inspect RPC exposes only query routes (no subscribe/unsubscribe/events), so the always-nil eventBus and its UnsubscribeAll-on-disconnect closure were unreachable dead code copied from the full-node handler; remove entirely instead of guarding with a nil check. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Order the nil checks in BlockResponse.Validate before any field access, reject a fetched block whose height does not match the requested height, and bound peer-reported StatusResponse base/height to plausible values (implausible reports are logged and ignored without dropping the peer). Adds table-driven tests for nil-block rejection, out-of-range status reports, and block height-mismatch rejection. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…t chunk-ID integrity (#1358) - light/provider/http: validatorSet() was formatting height (*int64) with %d, printing the pointer address instead of the value; add fmtHeight() helper and use %s in all three ErrBadLightBlock messages (LOW severity) - internal/statesync: add SEC-016 accept-risk doc comment on chunkQueue.Add documenting that chunk-ID integrity is delegated to the ABCI app and the post-restore app-hash check against the trusted light block (LOW severity)
* fix(p2p): bound inbound connection tracking Bound the connection tracker's recent-connect bookkeeping and stop holding inbound connections that exceed the accepted-connection limit. conn_tracker: lastConnect previously retained one timestamp per distinct source address indefinitely, since RemoveConn only deleted an entry when it was already older than the rate-limit window (never true right after a short connection). Drop a timestamp once its window has elapsed, and add an activity-driven amortized sweep on AddConn that removes expired entries and enforces a hard size cap by evicting the least-recently-seen entries. No background goroutine or new dependency is introduced. transport_mconn: the accepted-connection limiter parked over-limit connections, establishing them and holding them open until a slot freed, pinning kernel sockets and file descriptors. Replace it with a local limit listener that closes over-limit connections immediately and releases a slot exactly once when an accepted connection is closed. The default unlimited path is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * perf(p2p): replace O(N log N) sort eviction with O(N log k) heap selection Cap-triggered eviction in sweepExpired previously sorted the full lastConnect map (up to 65536 entries) under the write lock, blocking AddConn/RemoveConn during exactly the floods this code defends against. Replace sort.Slice with a container/heap partial selection: maintain a max-heap of the k=len-evictLowWater oldest entries. After scanning all N entries the heap holds exactly the k oldest, which are then deleted. Time goes from O(N log N) to O(N log k) and allocation from O(N) to O(k), where k<<N under typical load. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(p2p): guard newLimitListener against n<=0 (unlimited semantics) When n<=0, return the original listener unchanged so callers that pass zero as "unlimited" get the expected behaviour rather than a listener that silently closes every accepted connection. The transport layer already guards this (MaxAcceptedConnections > 0 before calling newLimitListener), but the function itself should not silently violate its own documented semantics. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(p2p): bound Accept over-limit backoff and bucket IPv6 conn-tracker keys by /64 - Add exponential backoff (5ms→100ms) in limitListener.Accept when over limit: prevents syscall-rate spin during connection floods; zero latency overhead on the normal (slot available) path. - Bucket IPv6 connection-tracking keys by /64 prefix (default) via new connKey helper: collapses a full /64 to one entry so an attacker cannot evade per-address rate-limits by rotating fresh /128 addresses. Co-authored-by: Lukasz Klimek <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
#1364) PR #1248 rewrote getRouterConfig to add allowlist-only composition via chainFilterByID, but silently omitted opts.FilterPeerByIP. The router still calls filterPeersIP when that option is non-nil, so ABCI apps that ban peers by IP address (/p2p/filter/addr/<ip:port>) lost that control without any observable error on upgrade. Restore the FilterPeerByIP closure inside the `conf.FilterPeers && appClient != nil` branch, matching v1.5.4 semantics: issue a Query for /p2p/filter/addr/<ip:port>, reject the peer on any non-OK response or transport error. The allowlist / chainFilterByID logic introduced by #1248 is left intact. Add TestGetRouterConfigFilterPeerByIP with six subtests covering: - non-nil assertion when filtering is enabled with an app client - nil when filtering is disabled or app client is absent - closure accepts a peer on OK ABCI response - closure rejects a peer on non-OK ABCI response - closure propagates ABCI transport errors as rejections Refs: #1248, audit finding GO-004 / SEC MEDIUM Co-authored-by: Claude Sonnet 4.6 <[email protected]>
…gent-driven releases (#1360) * feat(release): add --no-wait/--finalize/--non-interactive to release.sh for agent-driven releases The release script's blocking merge-wait (a 5-second poll loop until the release PR is merged) is hostile to agents and CI pipelines — a foreground Bash call hits the tool timeout and backgrounding the process gets it reaped. Observed while cutting v1.6.0-dev.2. New flags (purely additive; running with no new flags is identical to today): --no-wait / --stop-after-pr Run the full prep phase (validate → git-cliff changelog → version bump → release branch commit+push → open PR), emit a machine-parseable 'RELEASE_PR=<url>' line to stdout, then exit 0. Skips the blocking wait and the draft-release step. Implies --non-interactive. --finalize / --create-release Skip prep entirely. Verify the release_<ver> PR is MERGED (clear error if not), then create the DRAFT GitHub release. Idempotent: if the tag/release already exists it reports the URL and exits cleanly. Emits 'RELEASE_DRAFT=<url>' to stdout. Implies --non-interactive. --non-interactive / --yes Auto-accept every confirmation prompt; never block on stdin. Automatically implied by --no-wait and --finalize. Agent two-call flow: # Step 1 — prep and open PR: ./scripts/release/release.sh --release=1.6.0-dev.3 --no-wait # grep output: RELEASE_PR=https://... # Step 2 — after PR is merged: ./scripts/release/release.sh --release=1.6.0-dev.3 --finalize # grep output: RELEASE_DRAFT=https://... Also adds machine-parseable RELEASE_PR= / RELEASE_DRAFT= lines to the default interactive path (additive; they appear alongside the existing human-readable SUCCESS lines). RELEASES.md updated with a new "Agent / CI two-call flow" section documenting the flags and the two-call pattern. Validated: bash -n (syntax pass), shellcheck (only pre-existing SC2035 info on sha256sum glob, unchanged from before this commit). Co-authored-by: Lukasz Klimek <[email protected]> * feat(release): add --dry-run and preflight checks for safer agent/CI releases Add three robustness improvements to scripts/release/release.sh: 1. --dry-run flag: runs validate → git-cliff changelog generation, prints DRY-RUN: TMVersionDefault preview and the RELEASE_PR=/RELEASE_DRAFT= lines it would emit, then exits 0. An EXIT trap restores CHANGELOG.md so the working tree is always left clean. No commit, push, PR, tag, or release action is taken. Implies --non-interactive. 2. Preflight checks (preflight / preflightFinalize functions): run before any mutating or remote step. Checks: docker info reachable (git-cliff needs it), gh auth status authenticated, and a git push --dry-run probe to origin for the release branch (catches missing creds / token scope before any commit). In --dry-run the push probe is informational and non-fatal. --finalize gets a lighter subset (gh auth only; no docker or push needed for API-only work). 3. RELEASES.md cautions section: documents that the default blocking invocation must never be backgrounded in automation, lists prerequisites (Docker, gh auth, push credentials), and shows the --dry-run pre-check workflow. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(release): address bot review findings — CWD, finalize cleanup, repo context Address all 8 bot review threads (4 Copilot + 4 thepastaclaw) on PR #1360: 1. cd into REPO_DIR after arg parsing (Copilot ⭐ / thepastaclaw nitpick) - realpath-normalize REPO_DIR (handles -C relative/path) - cd into it before configureFinal so all git/gh/make commands operate against the intended checkout regardless of caller's CWD - move NON_INTERACTIVE implication before configureFinal so the debug line reflects the actual runtime state (thepastaclaw nitpick) 2. cleanup() guard for --finalize and --dry-run (thepastaclaw 🔴 blocking) - In --finalize/--dry-run the working tree is never modified, so cleanup() now returns immediately — prevents error paths from clobbering the caller's checkout (branch switch, branch deletion, make clean) 3. validateFinalize: add gh repo view check (Copilot) - Explicit repo-resolution check before any gh API call; opaque gh failures are replaced by an actionable error pointing at GH_REPO - Reword comment: stop claiming finalize is "git/checkout independent" (Copilot + thepastaclaw) 4. Mutual-exclusivity guard: --no-wait + --finalize (thepastaclaw 🟡) - Detect contradictory invocation early in parseArgs main flow and error with a clear message before any work begins 5. Docs: clarify --finalize repo-context requirement (Copilot) - RELEASES.md two-call flow step 2: replace "Can be run from any checkout; only GitHub auth is required" with accurate statement - Flags table --finalize row: note git-checkout / GH_REPO requirement - displayHelp --finalize description and step 2 example: same fix Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(release): guard cleanup in error() not cleanup() for finalize/dry-run Per reviewer spec: gate the cleanup call inside error() — `if [[ -z FINALIZE && -z DRY_RUN ]]; then cleanup; fi` — so that error paths in --finalize and --dry-run never run cleanup()'s branch-switch / branch- deletion / make-clean against the caller's working tree. Remove the earlier equivalent guard from cleanup() itself; cleanup() is clean for direct calls from the standard prep path. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(release): address thepastaclaw blocking findings (round 3) Four blocking issues resolved: 1. Mode-flag mutual exclusivity extended to --dry-run: the previous guard only covered --no-wait/--finalize, so --dry-run --finalize would silently enter the FINALIZE branch and call createReleaseIdempotent — creating a real draft release despite --dry-run's documented no-mutation contract. Now all three mode flags are checked together; combining any two errors. 2. validate() no longer fast-forwards in --dry-run mode: git merge --ff-only would silently advance the caller's local branch even though --dry-run is documented as 'restores the working tree on exit'. Now an out-of-sync checkout is an immediate error in dry-run mode (must be sync'd before the dry-run, not auto-fixed by it). 3. Push-credential probe now mirrors the real force-push: the probe was git push --dry-run (no --force) while the real push at createReleasePR uses --force. After any partial previous run the remote release branch exists and the non-force probe fails, blocking legitimate retries. Changed to git push --dry-run --force to match the actual operation. 4. deleteRelease passes --yes in non-interactive mode: gh release delete without --yes blocks on a confirmation prompt, hanging agent/CI invocations that run with --cleanup --no-wait or --non-interactive. Also: sanitize raw git push stderr before logging (avoids leaking embedded https://token@host credentials from the remote URL in CI logs). RELEASES.md: clarify --dry-run wording — "without touching any remote" was factually wrong (auth checks and the push dry-run probe do contact remotes read-only); changed to "without remote mutations". Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
* build: remove Windows support (unsupported platform) Windows is not a supported platform for Tenderdash. Only Linux and macOS are supported. This commit removes all Windows build targets and stray references so there is zero Windows footprint. Changes: - .goreleaser.yml: remove 'windows' from goos list - Makefile: remove ifeq(OS,Windows_NT)/.exe branch from build-contract-tests-hooks; remove windows/amd64 from TARGET_PLATFORMS in build-reproducible - scripts/dist.sh: remove 'windows' from XC_OS; remove windows/arm and windows/arm64 from XC_EXCLUDE - scripts/build.sh: remove Windows-specific OS_FILE_EXT comment and variable references - libs/os/perms.go: add //go:build unix constraint (file uses golang.org/x/sys/unix and syscall.Stat_t) - internal/libs/tempfile/tempfile.go: remove Windows-specific comment - docs/nodes/running-in-production.md: replace vague cross-platform copy with an explicit "Linux and macOS only, Windows not supported" statement - docs/tutorials/go.md: remove Windows-specific badger workaround section Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(tempfile): check f.Close() error before rename in WriteFileAtomic A silent close failure (e.g. disk-full flush error) would previously cause WriteFileAtomic to proceed with os.Rename and report success while the destination file may be truncated or corrupt. Now the error is propagated so callers can handle it correctly. Reported by copilot on PR #1363. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
…edge (#1365) * fix(consensus): resend catch-up block parts until the peer applies them TestReactorValidatorSetChanges intermittently hung for 120s (e.g. PR #1362 CI: a node stuck at height 17 during a validator-set change). The root cause is a consensus catch-up gossip wedge, not test timing. When a node falls behind, peers catch it up via GossipBlockPartsForCatchup. If the lagging node is still at RoundStepNewHeight/Propose with a nil ProposalBlockParts, it drops the incoming block part ("received a block part when we are not expecting any", state_add_prop_block.go). The sender, however, had already optimistically recorded the part as delivered (updatePeerProposalBlockPart), so prs.ProposalBlockParts.Not().PickRandom() reports nothing missing and the part is never resent. The catch-up commit then arrives, the node stores it and builds an empty part set from the commit header ("Commit came in before proposal", state_data.go), and waits forever for a part that is never resent -> permanent wedge. In production this recovers via propose/round timeouts (which reset peer round state and re-trigger gossip) and via blocksync. The test disables both (onlyOnce mock ticker, consensus-only reactor), turning the latent fragility into a hang. Fix: catch-up block-part gossip no longer optimistically marks the part as delivered; it keeps resending the missing part each gossip tick until the peer applies the block and advances its height. This mirrors the "resend until acked" behavior already used for catch-up commits and removes catch-up's dependency on timeouts to recover a dropped part. Regular same-height block-part gossip is unchanged. Adds TestGossipBlockPartsForCatchupResends as a regression guard. Before: wedge reproduces under high-contention parallel -race stress (captured at heights 17 and 19). After: 0 wedges across ~600 -race runs; the gossiper unit suite and single-instance -race runs pass. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(consensus): correct catch-up gossip comment and add multi-part resend test Fix 1 (gossiper.go ~line 207): remove the false claim that catch-up block-part gossip "mirrors the 'resend until acked' behavior used for catch-up commits." GossipCommit is single-shot: updatePeerCommit calls SetHasCommit on first send and GossipCommit early-returns on HasCommit, so commits are never resent. Keeping a false invariant in a comment near consensus-critical gossip logic is a maintenance hazard; the sentence is replaced with a clean full-stop that preserves the correct WHY. Fix 2 (gossiper_test.go): add TestGossipBlockPartsForCatchupResendsMultiPart. The existing single-part test cannot distinguish "iterates all missing indices" from "always re-picks the only index." The new test builds a 3-part block, leaves all parts missing on the lagging peer, runs 90 gossip ticks (coupon-collector ≈5.5 ticks; P(miss any index) <10^-16), and asserts every part index was sent at least once AND the peer's ProposalBlockParts bit-array was never optimistically marked. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * style(consensus): fix US-locale misspelling flagged by misspell linter 'serialises' → 'serializes' in TestGossipBlockPartsForCatchupResendsMultiPart comment (gossiper_test.go:462), fixing the misspell linter finding that was blocking PR #1365 CI. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…1370) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.68.1 to 0.69.0. - [Release notes](https://github.com/prometheus/common/releases) - [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md) - [Commits](prometheus/common@v0.68.1...v0.69.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-version: 0.69.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/bufbuild/buf](https://github.com/bufbuild/buf) from 1.70.0 to 1.71.0. - [Release notes](https://github.com/bufbuild/buf/releases) - [Changelog](https://github.com/bufbuild/buf/blob/main/CHANGELOG.md) - [Commits](bufbuild/buf@v1.70.0...v1.71.0) --- updated-dependencies: - dependency-name: github.com/bufbuild/buf dependency-version: 1.71.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the go_modules group with 1 update in the / directory: [github.com/opencontainers/runc](https://github.com/opencontainers/runc). Updates `github.com/opencontainers/runc` from 1.3.3 to 1.3.6 - [Release notes](https://github.com/opencontainers/runc/releases) - [Changelog](https://github.com/opencontainers/runc/blob/main/CHANGELOG.md) - [Commits](opencontainers/runc@v1.3.3...v1.3.6) --- updated-dependencies: - dependency-name: github.com/opencontainers/runc dependency-version: 1.3.6 dependency-type: indirect dependency-group: go_modules ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…eReplayNone (#1367) * fix(consensus,autofile): prevent TempDir race in TestHandshakeReplayNone The test was intermittently failing with: testing.go:1464: TempDir RemoveAll cleanup: unlinkat /tmp/TestHandshakeReplayNone.../data: directory not empty Root cause: BaseWAL.Wait() and Group.Wait() only wait on their internal service srvCtx, but processFlushTicks (WAL) and processTicks (Group) are started with the caller-supplied context and exit on ctx.Done() — not on the service srvCtx. In the fast-path (background goroutine already called Stop()), Wait() returned immediately while those goroutines were still mid-execution and could re-open the AutoFile (via openFile()) after the caller assumed the WAL was fully stopped, racing with t.TempDir() cleanup. Fixes applied: - autofile.Group: add goroutineWg (sync.WaitGroup) to track processTicks; expose WaitForGoroutines() that blocks until it has truly exited. - BaseWAL: add goroutineWg to track processFlushTicks; Wait() now calls group.WaitForGoroutines() and wal.goroutineWg.Wait() so all goroutines have exited before the caller can delete temp directories. - replay_test.go / testHandshakeReplay: call wal.Stop() explicitly before wal.Wait() in the cleanup hook so OnStop() (which marks the AutoFile closed) runs synchronously from the cleanup goroutine. - replay_test.go: add missing t.Cleanup for eventBus, buildTMStateFromChain proxyApp/eventBus, and buildAppStateFromChain appClient so services are properly drained before TempDir removal. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(consensus,autofile): cancel goroutine ctx in OnStop to prevent Wait deadlock The previous fix introduced a deadlock: processFlushTicks (BaseWAL) and processTicks (Group) exited on the caller-supplied ctx, but Stop()/OnStop() only cancelled the service-internal srvCtx — not the caller ctx. Calling Wait() (which now blocks on goroutineWg) before the caller ctx was cancelled would hang forever. Failing case: TestWALWriteCommit registers `defer cancel()` first (runs last in LIFO) and `defer { wal.Stop(); wal.Wait() }` second (runs first), so Wait() blocked with the goroutine stuck in select on an uncancelled ctx. Production path: state.go receiveRoutine calls wal.Stop() + wal.Wait() in onExit() without guaranteeing the caller ctx has fired — same deadlock. Fix: in OnStart, derive a child context (context.WithCancel(ctx)) and store the cancel func as procCancel on the struct. OnStop calls procCancel() first, which causes the goroutine to exit on its next select iteration. The child context inherits cancellation from the parent, so the existing "also exit when caller ctx cancels" behaviour is preserved. After this change: Stop() → OnStop() → procCancel() → goroutine exits → goroutineWg.Wait() / WaitForGoroutines() unblock promptly, regardless of whether the original caller ctx has been cancelled. The BaseService contract (Stop precedes Wait) is now unconditionally safe at every call site. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * chore(lint): fix misspellings flagged by golangci-lint Replace British spellings in comments added by the prior fix commit: - wal.go:169 behaviour → behavior - wal.go:204 cancelled → canceled - group.go:76 cancelled → canceled - group.go:154 behaviour → behavior Comments-only; no logic changes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(consensus): cancel ctx before Wait in replay test cleanups to prevent cleanup deadlock Two test helpers in internal/consensus/replay_test.go registered a bare t.Cleanup(*.Wait): - buildAppStateFromChain: t.Cleanup(appClient.Wait) - buildTMStateFromChain: t.Cleanup(proxyApp.Wait) Both appClient and proxyApp are abciclient.Client *interface* values. The service.Service interface only exposes Start/IsRunning/Wait — there is NO Stop() on the interface (it lives on the concrete *BaseService struct). A service is therefore stopped by canceling the context passed to Start(): BaseService.Start spawns a watcher goroutine that calls Stop()->OnStop() when that ctx is canceled, which unblocks Wait(). Consequently a bare Wait() returns only after the caller's ctx is canceled. t.Cleanup runs LIFO, so the helper's Wait() can run BEFORE the caller's cancel() cleanup (or before a deferred cancel if a require fails early), blocking until `go test -timeout` kills the run. Fix: each helper now derives its own child context (context.WithCancel) and cancels it in its cleanup before Wait(), making the helper self-contained regardless of caller cleanup ordering. This matches the cancel()+Wait() pattern already used elsewhere in the file. The team-lead's pasted appClient.Stop()/proxyApp.Stop() snippet would NOT compile — Stop() is not on the interface — so context cancellation is the API-correct mechanism. Note on the CI RED for PR #1367: the failing job (tests (01)) was NOT this deadlock and NOT TestHandshakeReplayNone. It was TestReactorValidatorSetChanges timing out (reactor_test.go:628 context deadline exceeded; node 4 missed the block during a validator-set transition). That test is a long-standing, non-deterministic flake across the tendermint/cometbft/tenderdash lineage (see #1204, #1352, upstream #7985/#3401 and the "fails-non-deterministically" branch) and passes locally x2 with -race on this head. The WAL/autofile goroutine-lifecycle changes only affect Stop/Wait behavior and cannot cause a consensus-layer vote-index mismatch. The CI failure is an UNRELATED FLAKE; a re-run should pass. This commit still lands the latent-deadlock cleanup fix flagged by the bot reviewers (copilot-pull-request-reviewer + thepastaclaw). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * refactor(autofile): override Group.Wait to join background goroutines by default Group embeds service.BaseService, whose Wait() returns as soon as OnStop() closes the quit channel — before the procCancel-driven processTicks goroutine (tracked by goroutineWg) is joined. The PR added WaitForGoroutines() for that join, but only BaseWAL.Wait() knew to chain it; any other direct caller of g.Wait() still observed the pre-PR shutdown race (a flush/check tick could touch the file after the caller believed the Group was fully stopped). Override Wait() on *Group to chain BaseService.Wait() + WaitForGoroutines(), so every consumer gets the full shutdown guarantee. WaitForGoroutines() is kept as the explicit form. The override calls g.BaseService.Wait() (the embedded method), not g.Wait(), so there is no recursion; goroutineWg.Wait() is idempotent, so BaseWAL.Wait()'s existing explicit WaitForGoroutines() call (now also reached via group.Wait()) is harmless. Only direct (*Group).Wait() caller is BaseWAL.Wait() (guarded by IsRunning()); no semantic break and no new deadlock (OnStop calls procCancel before the quit channel closes, so the join always unblocks). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…nsensus (SEC-001) (#1362) * fix(types): stop vote-extension count mismatch from halting consensus (SEC-001) A single Byzantine validator could broadcast a precommit for the about-to-commit block carrying a mismatched (e.g. zero) vote-extension count. Its own signatures are valid, so it passed every admission check and entered votesByBlock. Once the quorum threshold was crossed, types.SignsRecoverer either returned a length-mismatch error or - if the bad vote was in the minimal quorum-crossing set - left too few consistent extension shares to recover, and addVerifiedVote panicked, halting every node (a network-wide liveness DoS). PR #1342 relocated rather than removed this panic; v1.5.x silently skipped zero-extension precommits and so was not affected. Fix (both parts are needed): - signs_recoverer.go: restore the v1.5.x behaviour - a precommit with no vote extensions contributes only its block signature and is skipped for vote-extension recovery instead of producing an error. Dropping the share is safe: every vote's own extension signatures are verified against its validator key before admission (Vote.Verify -> QuorumSignData.Verify), so a Byzantine validator can influence only the count of extensions it offers, never their content. A genuine non-zero count mismatch is still reported (it has no safe canonical interpretation). - vote_set.go: addVerifiedVote no longer commits maj23 and crashes at the exact crossing vote. Because the BLS recovery threshold equals the consensus quorum threshold, the minimal crossing set may not yet hold enough consistent extension shares. It now tentatively sets maj23 (so the recoverer sees the correct quorum-reached state), attempts recovery, and on failure rolls maj23 back and retries as more honest votes arrive; maj23 is finalized only once recovery actually succeeds. A hard fail is retained solely for the genuinely-unattributable case where every validator has already voted for the block and recovery still fails. Adds TestVoteSet_AddVote_MismatchedVoteExtensionCountDoesNotHalt, which drives the real AddVote -> addVerifiedVote -> recovery path with the Byzantine vote added first and asserts no panic, quorum still reached, and a commit that verifies against the threshold public key. Updates two TestSignsRecovererErrors cases that asserted the removed #1342 behaviour. Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(types): recover vote-extensions from the count-consistent majority (SEC-001) Follow-up to 69ef559. That commit fixed the ZERO-extension trigger but a NON-ZERO count mismatch still halted: a Byzantine validator that precommits the winning block with, say, 1 extension while honest validators produce 2 would, once all validators had voted, hit the retained hard-fail panic ("received vote extensions with different length") - an ATTRIBUTABLE Byzantine input, contradicting the comment that the panic only covers unattributable errors. Root cause: addVoteExtensionSigs seeded the canonical extension count from the first vote and errored on any mismatch, so recovery could never fall back to the consistent honest majority. Fix: recover from the count-consistent majority, not the first vote. - vote_set.go: new canonicalVoteExtensionCount groups a block's votes by extension count and sums each group's voting power; the canonical count is the one backed by >= the threshold-signature recovery power. The bar is the FIXED, LLMQ-type-derived recovery threshold (QuorumTypeThresholdVotingPower), NOT the configurable commit gate (QuorumVotingThresholdPower). This matters: the VotingPowerThreshold override (GO-003) can set the commit gate below 1/2 of the power, under which two count-groups could both clear it and the smallest-count tie-break could wrongly pick a Byzantine count - starving recovery and halting the chain. The recovery threshold is always >= ~2/3 (> 1/2) of the quorum power, so at most one group can ever reach it: the selection is deterministic across nodes (no fork), the tie-break is unreachable, and the canonical count is always the honest one under < 1/3 Byzantine power. recoverThresholdSigns passes it to the recoverer and returns an error when no count reaches the threshold (handled by the existing retry/backstop). - validator_set.go: add QuorumTypeThresholdVotingPower (the type-derived recovery threshold, ignoring the override) and route QuorumVotingThresholdPower's fallback through it (no behaviour change); document that QuorumVotingThresholdPower honors the override. - signs_recoverer.go: WithCanonicalVoteExtensionCount makes addVoteExtensionSigs contribute extension shares only from votes carrying the canonical count - excluding a differing-count minority (zero OR non-zero) - while every vote still contributes its block signature. No count mismatch is treated as an error on this path. Excluding a vote is safe: each vote's own extension signatures are verified at admission, so a Byzantine validator can influence only the count it offers, never the content. The retained panic now fires only when every validator has voted yet no count is backed by the recovery threshold power (> 1/3 Byzantine, a BFT-safety violation) or the BLS layer is broken - genuinely unattributable, as the comment states. Also folds in two low-severity review items: - Document IsQuorumReached as lock-free, internal-use-only (called under voteSet.mtx) and non-monotonic during recovery (nil -> tentative -> nil), steering external callers to the locked accessors. No behaviour change. - Make the regression test name/coverage honest. Tests (types/vote_set_test.go): - TestVoteSet_AddVote_InconsistentVoteExtensionCountDoesNotHalt: table-driven over zero-count (all voted), non-zero mismatch (all voted), non-zero mismatch (not all voted); each asserts no panic + valSet.VerifyCommit. - TestVoteSet_AddVote_SubThirdCommitGateUsesRecoveryThreshold: with a sub-1/3 VotingPowerThreshold override, a Byzantine count must NOT be selected; asserts the honest count is canonical and the commit verifies. Fails (halts) on revert. - TestVoteSet_AddVote_NoRecoverableExtensionCountPanics: a > 1/3 split where no count reaches the recovery threshold must fire the backstop hard-fail. Co-Authored-By: Claude Opus 4.8 <[email protected]> * docs(types): correct recovery-threshold comments for quorum-type variability The three inline comments in vote_set.go and validator_set.go incorrectly asserted that the LLMQ recovery threshold is always >= ~2/3 (> 1/2) of quorum power. In practice some devnet/test types (LLMQType_DEVNET, TEST_DIP0024, DEVNET_DIP0024) have exactly 50% thresholds, while all production Platform types are >= 60%. The uniqueness argument (at most one extension-count group can reach the threshold) does not require > 1/2: under the standard < 1/3 Byzantine assumption the Byzantine group holds < 1/3 < 50% <= threshold for all supported types and therefore cannot form a qualifying group on its own. For > 1/2 threshold types the stronger pigeonhole guarantee additionally applies. The tiebreak is exercisable only under BFT-violating Byzantine stake. No logic changes; comments only. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(types): build threshold-sign verification from canonical vote, not triggering vote (SEC-001) quorumDataSigns was constructed from the just-added triggering vote (MakeQuorumSignsWithVoteSet at line 241) and passed into recoverThresholdSignsAndVerify. After recoverThresholdSigns selected the canonical-count group (votes backed by >= QuorumTypeThreshold power) and populated thresholdVoteExtSigs with canonicalCount signatures, makeQuorumSigns() returned a QuorumSigns with VoteExtensionSignatures of length == canonicalCount. But quorumDataSigns.VerifyVoteExtensions checked against the *triggering* vote's extension count via len(q.VoteExtensionSignItems) — causing a spurious length-mismatch error whenever the triggering vote carried a Byzantine-crafted count different from the canonical one. Attack scenario (gate > recovery threshold, supported by validateThreshold when VotingPowerThreshold is set): 10 validators @ 100 power, recovery=700, commit gate=800, 3 Byzantine with ext=1 voting last. 7 honest votes (ext=2) reach 700 (below gate); Byzantine vote 8 triggers (sum=800), recovery succeeds with canonical count 2 but verify fails (1 vs 2 sign items) → maj23 rollback. Same for votes 9 and 10 → all-voted backstop panic. Deterministic liveness DoS under an operator-configurable and validated configuration. Fix: after recoverThresholdSigns returns, find any vote in blockVotes whose total extension count matches len(thresholdVoteExtSigs) (the canonical count) and build the verification QuorumSignData from it. This guarantees sign-item count == recovered-signature count regardless of what the triggering vote carries. Also removes the now-dead quorumDataSigns parameter from recoverThresholdSignsAndVerify and addVerifiedVote, and the MakeQuorumSignsWithVoteSet call that only existed to supply it. Adds a deterministic regression test (gate=800 > recovery=700, Byzantine votes last) that panics pre-fix and passes with the fix. Adds a TODO for the perf suggestion (🟡 thepastaclaw): skip BLS recovery re-attempts when no count-group's power changed since last attempt (deferred; correctness before optimization). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(consensus): log swallowed recovery error, reset stale threshold sigs on rollback, clarify vote-copy Follow-up to the SEC-001 vote-extension fix in addVerifiedVote. Three self-review items on the recovery/rollback path: 1. Observability (:342): the error from recoverThresholdSignsAndVerify was surfaced only on the all-votes-present panic path; on the soft-retry path it was silently discarded. Thread a log.Logger into types.VoteSet (no-op default via functional option, so existing NewVoteSet callers compile unchanged) and propagate the real logger from consensus State through HeightVoteSet. Log the failure at Debug - it is an expected, benign retry that fires on every post-gate vote while maj23 is unset, so Warn/Error would be noise. The error is NOT propagated to AddVote (callers treat that as a rejected/punishable vote). 2. Stale-state rollback (:361): recoverThresholdSigns may set thresholdBlockSig/thresholdVoteExtSigs before the later verification fails. The rollback previously reset only maj23, leaving stale, unverified signatures behind. Reset both signature fields alongside maj23 so they are recomputed on the next successful recovery. 3. Clarity (:365): document why the error path intentionally skips copying votes into voteSet.votes - the vote already lives in the persistent votesByBlock bucket that the next recovery attempt reads, and voteSet.votes is the finalization "publish" step, which must not run while maj23 is rolled back. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(lint): correct British spelling flagged by misspell (behaviour→behavior) Two comment-only changes in height_vote_set.go and vote_set.go; swept all PR-changed Go files — no further British spellings found. Co-authored-by: Claudius the Magnificent <[email protected]> * style(types): convert TODO(perf) to NOTE(perf) per STYLE_GUIDE STYLE_GUIDE.md forbids TODO in source; single token change on vote_set.go:346. Co-authored-by: Claudius the Magnificent <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
* fix(evidence): make evidence sync resilient to peer-routing race syncEvidence was a one-shot walk of the pool that fired immediately on PeerStatusUp, before the p2p router had finished wiring the channel route to the new peer. In that window, Send calls succeed at the transport level but envelopes are silently dropped by the router. With no retry path, the peer would permanently miss any evidence that was already in the pool before it connected. Convert syncEvidence from a one-shot walk to a ticker-based loop that re-sends all pending evidence to the peer every evidenceSyncInterval (1 s) until the peer disconnects. The receiver already handles duplicates via isPending/isCommitted guards, so re-sends are safe. This is the same class of race as the consensus catch-up wedge fixed in #1365 (one-shot gossip, route not ready → silent drop → permanent miss) but in a separate package and mechanism. Also tidy the test: use evidence.GetChannelDescriptor() for the p2ptest channel so the test harness matches the production RecvBufferCapacity, Priority and Name. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(evidence): recover from PeerStatusUp/route-ready race via periodic re-sync The per-peer `syncEvidence` goroutine previously walked the pool once then returned. If PeerStatusUp fired before the p2p channel route was fully wired, the first burst of sends was silently dropped and the peer permanently missed evidence that pre-dated its connection. The fix converts the one-shot walk into a ticker loop that re-sends every `evidenceSyncInterval` (1 s default) until the peer disconnects; duplicates are idempotent on the receiver side via isPending/isCommitted guards, so no protocol changes are required. Two additional hardening changes are included: - Peer-flap lifecycle race (QA-002): on PeerStatusDown the map entry is deleted synchronously (not left for the goroutine's deferred cleanup). Each goroutine also carries a unique identity token (`*struct{}`) so its defer cannot accidentally remove an entry installed by a fast Down→Up reconnect. - Deterministic regression guard (QA-001): `TestSyncEvidenceRetries` wires a recording p2p.Channel and asserts that the same evidence is sent MORE THAN ONCE across ticker ticks. A pre-fix one-shot goroutine would send exactly `numEv` times, making the `count > numEv` assertion fail — a true regression gate. doc.go is updated to remove the stale `broadcastEvidenceIntervalS`/60 s reference and document both propagation paths. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(evidence): address copilot review: comment clarity, log level, test robustness - Fix amplification-factor comment: clarify that P×M messages/s is the worst-case rate and that a larger interval *reduces* send frequency (the previous wording implied the opposite). - Demote per-item "sent evidence to peer" log from Debug → Trace to avoid P×M×1/s debug noise when Debug is enabled. - Replace time.Sleep with require.Eventually in TestSyncEvidenceRetries: poll until sendCount > numEv instead of sleeping a fixed 150 ms, making the test robust to scheduler jitter on slow/loaded CI runners. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(evidence): use non-zero-size sync token and stop rebroadcast on AddEvidence failure Two confirmed-real bugs in the evidence reactor, plus a regression test. 1. Non-zero-size per-peer sync identity token (BLOCKING). peerSyncState.id was *struct{} (new(struct{})). The Go runtime places every zero-size allocation at the single shared runtime.zerobase address, so all tokens compared EQUAL. The deferred-cleanup guard `current.id == myID` was therefore always true, defeating the Down->Up flap protection: a stale goroutine's deferred cleanup could evict a newer goroutine's map entry, leaking the new goroutine and (on reconnect) spawning a second ticker loop per peer. Changed the token to *int / new(int) and updated syncEvidence's parameter type; *int is non-zero-size so each allocation gets a unique address. Comments updated to document the MUST-NOT-be-zero-size rule. 2. Stop rebroadcasting when AddEvidence fails (SUGGESTION). When a peer is behind, verify() returns a plain "missing block for height" error (not *types.ErrInvalidEvidence). handleEvidenceMessage only logged it and still fell through to broadcastEvidence. Because the item never entered the pending set, isPending stayed false and every received copy was re-gossiped, amplifying traffic until the peer caught up. Now we return nil (after logging) for any non-ErrInvalidEvidence error; only successfully-added evidence is broadcast. ErrInvalidEvidence still returns err (peer removal). 3. Regression test: TestReactorPeerFlapNoGoroutineEviction. Deterministically reproduces the Down->Up flap via a gate channel that freezes a sync goroutine mid-walk, so the stale goroutine's deferred cleanup runs strictly after a replacement goroutine is installed. Asserts the two goroutines receive distinct identity tokens and that the stale cleanup does not evict the fresh entry (exactly one routine per peer; no leak). Fails deterministically on the pre-fix *struct{} token (tokens alias to zerobase), passes with *int. Added test-only accessors (PeerRoutineCount/Active/Token) in export_test.go. Resolves thepastaclaw review (commit 6fdb1e6): the BLOCKING *struct{} token finding and the SUGGESTION on rebroadcast after AddEvidence failure. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(evidence): bound resync by MaxBytes, uint64 sync token, guard test (review) Three reviewer-requested hardening changes to the evidence reactor. (c) Replace the *int per-peer sync identity token with a monotonic uint64 counter (Reactor.nextSyncID), incremented under the same mutex that installs the peerSyncState. The old token's distinctness relied on the allocator returning unequal heap addresses; a future switch to *struct{} would silently collapse every token onto runtime.zerobase and reintroduce the Down->Up flap race. A counter is spoof-proof and self-documenting. (b) Bound each syncEvidence tick by ConsensusParams.Evidence.MaxBytes via evpool.PendingEvidence(maxBytes) instead of walking EvidenceFront()->end and sending every pending item. Gossip is now symmetric with what a proposer would include (same budget, same store-ordered prefix) and avoids O(N^2*M) amplification on a full mesh. As a bonus, the ValidateABCI repair-and-store subpath (which writes to the store but not the clist) becomes eligible for ticker re-emission. (a) Lock the bundled handleEvidenceMessage change: a non-ErrInvalidEvidence AddEvidence error now returns nil (no rebroadcast) so unverifiable evidence is not amplified. New TestReactorNoRebroadcastOnNonInvalidEvidenceError asserts broadcastEvidence is not called on that path. Tests: update TestReactorPeerFlapNoGoroutineEviction to assert distinct uint64 ids (and that a stale defer cannot evict the newer entry); add PeerRoutineID and HandleEvidenceMessageForTest test hooks; raise the test fixture's Evidence.MaxBytes to the 1 MiB production default so the bounded resync does not throttle the broadcast tests. Co-authored-by: Claudius the Magnificent <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue being fixed or feature implemented
Release new Tenderdash version
What was done?
How Has This Been Tested?
None
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only