Skip to content

chore: merge v1.7-dev into v1.8-dev - #1452

Merged
lklimek merged 5 commits into
v1.8-devfrom
merge-1.7-1.8
Sep 9, 2026
Merged

lklimek merged 5 commits into
v1.8-devfrom
merge-1.7-1.8

Conversation

@lklimek

@lklimek lklimek commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

TL;DR: Brings v1.7-dev's consensus/p2p security-hardening fixes into v1.8-dev, plus a lint-pin sync and a changelog reorg found while merging.

User story

As a node operator running v1.8-dev, I want the consensus and block-sync hardening already shipped on v1.7-dev, so that I get the same resilience against malformed remote input and slow/adversarial peers.

Scenario

Base flow

v1.8-dev branched off before v1.7-dev's hardening work landed, so the two lines diverged: v1.7-dev (PR #1442, #1451) fixed several consensus/p2p robustness issues that v1.8-dev never received.

Actual behavior

v1.8-dev lacks the proposal-metadata correction, verifyCommit control-flow fix, stricter light-block public-key-share validation, vote-extension canonical-voter binding, and the block-sync backpressure/backfill-bounding fixes present on v1.7-dev.

Expected behavior

v1.8-dev carries all of the above, verified to not regress existing v1.8-dev behavior.

Detailed discussion

What was done

  • Merged origin/v1.7-dev into this branch (forked from v1.8-dev tip). 3 conflicts resolved: docs/nodes/state-sync.md (both sides' prose combined, nothing dropped), go.mod/go.sum (kept the newer toolchain graph already present on this branch; its grpc v1.83.2 CVE-2026-84304 fix is preserved — verified via go mod tidy -diff). internal/statesync/reactor.go auto-merged (disjoint regions).
  • Synced Makefile's GOLANGCI_LINT_VERSION (v2.12 → v2.13) with .github/workflows/lint.yml, which it claims to track but had drifted from; the stale pin made make lint panic locally under Go 1.27 (staticcheck/honnef v0.7.0 bug in buildir).
  • Reorganized CHANGELOG.md: filed all post-v1.7.0 [Unreleased] entries under a new [1.8.0] heading (decided by commit date, since no v1.8.0 tag/date exists yet and entries carry no per-entry dates).
  • Reviewed the incoming block-sync response scheduler (internal/blocksync/p2p_msg_handler.go) and the p2p delivery-notification machinery for concurrency issues — found none; see Testing.
  • Benchmarked whether the incoming BlockSyncChannel.SendQueueCapacity reduction (1000 → 4) throttles catch-up throughput — it does not; see Testing.

Testing

  • go build ./..., go vet ./... — clean.
  • go test -p 1 -race -tags deadlock -count=3 ./internal/blocksync/... ./internal/p2p/... — 0 races.
  • go test -p 1 -race -tags deadlock ./internal/statesync/... ./node/... ./dash/core/... ./light/... — all packages pass.
  • [email protected] run --new-from-rev=origin/v1.8-dev (matching CI's pin) — 0 issues.
  • A/B throughput probe (real TCP MConnection, 256 KiB payloads, production SendRate): SendQueueCapacity=4 vs =1000 — statistically identical throughput (~4.7–5.0 MiB/s), both pinned at the SendRate ceiling; queue depth is a burst buffer in front of a rate-limited drain and doesn't set steady-state throughput.
  • Full e2e run on networks/dashcore.toml (one of the two CI matrix testnets): pass in 9m25s, all assertions green, 7 node perturbations (disconnect/restart/kill/pause) all recovering in 10–60s.

Breaking changes

None expected. verifyCommit, light-block public-key-share validation, and vote-extension canonical-voter binding are strictly stricter/more-correct versions of existing logic (see individual v1.7-dev PRs #1442/#1451 for rationale); BlockSyncChannel.SendQueueCapacity 1000→4 is a p2p tuning change shown not to affect throughput.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Prior work

Known issue (not fixed in this PR)

test/e2e/networks/ci.toml's full01 node lacks privval_protocol = "dashcore", so it won't start under this branch's full-node Core-RPC requirement. CI is unaffected — the workflow only runs dashcore.toml/rotate.toml, both of which set it correctly; only local make runner/ci is affected. Left out of scope; flagging for a follow-up.

Attribution

🤖 Generated with Claude Code

lklimek and others added 5 commits September 9, 2026 12:04
…tension-count mismatch, patch grpc CVE (#1451)

* fix(statesync): bound backfill fetch-ahead of verification

blockQueue.nextHeight allocated the next height to fetch without reference
to how far verification had progressed, tracking only what had been fetched.
Fetching a light block costs a round trip while verifying one costs a BLS
commit check on a single serialized loop, so peers serving faster than this
node verifies grew the fetched-but-unverified backlog in the unbounded
pending map across the entire backfill span - a memory-exhaustion vector on
the long backfill a new node joining an established chain performs.

Bound the heights that may be allocated but not yet verified, scaled to the
fetcher count so the pipeline still saturates its workers. Heights needing a
re-fetch are exempt: they are already counted against the bound and the
verify loop cannot advance past them, so withholding one would deadlock the
run the bound exists to protect.

Measured with the backpressure probe over spans of 200, 800 and 3200: peak
fetch-ahead depth falls from 159 to 16 at span 200 and stays at 16 for every
larger span, where it previously tracked the span. Run duration and blocks
served over the span are unchanged, so the happy path pays nothing.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix(statesync): don't disconnect a peer over a vote-extension count mismatch

backfill treated every error from ValidatorSet.VerifyCommit as grounds to
disconnect the peer that supplied the commit. types.ErrVoteExtensionCountMismatch
does not deserve that: an honest peer relaying a commit whose vote-extension
configuration differs from this node's reaches it, which is an application
disagreement rather than a forged signature.

verifyCommit already leaves that error untyped for exactly this reason, and
internal/consensus evicts only on the typed ErrInvalidCommitSignature. Backfill
is the error's only untrusted-input path, so disconnecting here defeated the
whole carve-out. Score the peer down instead, matching the severity the
neighbouring refusals already use for causes an honest peer can produce.

The peer is still withdrawn from the run, which is what keeps the run healthy,
and every other verification failure still costs the connection.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* chore(deps): update google.golang.org/grpc to v1.83.2

v1.82.1 is affected by CVE-2026-84304: internal/transport stores each
fragmented HTTP/2 DATA frame as a separate recvMsg, so an unauthenticated
peer multiplexing streams of one-byte frames exhausts heap while staying
inside the flow-control windows. This repo exposes gRPC servers in
abci/server and privval/grpc, so the path is reachable.

Fixed upstream in v1.83.1 by receive-buffer compaction; v1.83.2 is the
latest patch of that minor and adds rejection of requests carrying neither
:authority nor Host. Release notes for v1.83.0 through v1.83.2 record no
breaking API changes, and this repo uses only NewServer, NewClient and
generated stubs.

Pulls in transitive updates to golang.org/x/crypto, x/net and x/text.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
* test(security): reproduce remote consensus vulnerabilities

Add failing regression coverage for vote-extension recovery panics,
proposal metadata malleability, validator-set state binding, and
CoreChainLockedHeight omission from the header hash.

Co-Authored-By: Claude GPT-6 <[email protected]>

* fix(security): harden remote consensus inputs

* fix(consensus): publish corrected proposal metadata safely

Avoid mutating a proposal that may still be read by gossip workers, and address the static-analysis findings reported by CI.

Co-Authored-By: Codex GPT-6 <[email protected]>

* fix(consensus): address review findings

Co-Authored-By: Codex GPT-6 <[email protected]>

* fix: harden block delivery and state sync validation

* fix(consensus): preserve connection ordering and authenticate backfill state

* fix(statesync): load trusted params from current local state

---------

Co-authored-by: Lukasz Klimek <[email protected]>
Co-authored-by: Claude GPT-6 <[email protected]>
Co-authored-by: Codex GPT-6 <[email protected]>
# Conflicts:
#	docs/nodes/state-sync.md
#	go.mod
#	go.sum
The Makefile comment claims it is kept in step with
.github/workflows/lint.yml, but it was still pinned to v2.12 while CI
uses v2.13. Under the repo's Go 1.27 toolchain, golangci-lint v2.12.2's
staticcheck/honnef v0.7.0 panics in buildir on stdlib internal/poll,
so `make lint` never completes locally.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Every entry under the Unreleased heading landed after the v1.7.0 tag
(2026-08-18): the four commits that touched CHANGELOG.md since the tag
are 6278666, 98df1e8, e8a57b2 and edf4bab, all dated
2026-09-07..2026-09-09. The entries carry no per-entry dates, so commit
dates decide, and they place the whole section in 1.8.0.

The heading carries no release date because 1.8.0 is not tagged yet.
scripts/release/release.sh regenerates CHANGELOG.md in full from git
history via git-cliff, so the release itself supplies the date.

Co-Authored-By: Claude Opus 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 38753fb9-78c2-4b32-88cd-c7f3e5429e8b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lklimek
lklimek marked this pull request as ready for review September 9, 2026 14:27
@lklimek
lklimek enabled auto-merge September 9, 2026 14:27
@thepastaclaw

thepastaclaw commented Sep 9, 2026 •

Copy link
Copy Markdown

🕓 Queued for automated review — 19th in line, estimated start in ~6 h (commit b609ca3)
Estimated review time once started: ~35 min (two-phase automated review; median of recent runs).

  • Request priority review — tick this box and the review moves to the front of the queue.

@lklimek
lklimek merged commit 3b30d21 into v1.8-dev Sep 9, 2026
21 checks passed
@lklimek
lklimek deleted the merge-1.7-1.8 branch September 9, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants