Skip to content

feat(consensus)!: specify full consensus parameter commitment and remove app version parameter - #1593

Draft
lklimek wants to merge 21 commits into
devfrom
docs/v2-consensus-params-commitment
Draft

lklimek wants to merge 21 commits into
devfrom
docs/v2-consensus-params-commitment

Conversation

@lklimek

@lklimek lklimek commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR: Specify how every consensus parameter becomes verifiable from signed block headers, activated by consensus version 3, and remove the deprecated application version from consensus parameters.

User story

As a node operator, I want a node that joins the network through state sync to verify every network setting it receives, so that a malicious or compromised source cannot make it halt, vote differently or diverge.

As an application developer, I want one place that sets the application version, so that blocks and node state cannot disagree about it.

Scenario

Base flow

A node bootstraps with state sync and receives the network's consensus parameters from an RPC server or peers.

Actual behavior

Only block size, block gas and the consensus version are covered by the signed parameter hash. All other settings (evidence limits, validator key types, synchrony bounds, timeouts, mempool recheck) are accepted without verification and stay in the node's state; a forged value typically makes the node halt later, and nothing detects it. The application version can come from two places that may disagree.

Expected behavior

Once a network switches to consensus version 3, the signed hash covers every parameter, so forged settings are rejected at bootstrap. The application version comes only from the application's block proposal response.

Detailed discussion

What was done

  • Specification spec/consensus/consensus-params-commitment.md (linked from the spec index, consensus page and book):
    • full, domain-separated parameter snapshot HashedParamsV2 (17 fields including the proposer liveness timeouts, canonical encoding);
    • selection by VersionParams.consensus_version: version 3 and higher use the full hash, lower versions keep the legacy hash (version 2, proposer liveness, keeps its two hashed timeouts); each parameter set is hashed by its own version, so block H-1 already signs the full next-parameter hash;
    • consensus version must never decrease (today any change is accepted, including 1 to 0), and unknown versions are rejected; validation is specified, not implemented here;
    • version.BlockProtocol is not bumped: activation is only through the consensus version;
    • impact of forged parameters today, per parameter, including the risk of a voting-power threshold below 2/3 (minority polkas can unlock honest validators across rounds);
    • voting-power threshold in updates: voting_power_threshold follows the other optional parameter fields (absent keeps the previous value, 0 clears the override so the quorum-type threshold applies, a positive value sets it), while a present validator group still replaces pub_key_types; the same rule holds at and after activation (the parameter merge and validator-set update do not implement it yet, recorded for the implementation PR);
    • remaining implementation steps and acceptance scenarios.
  • Protobuf: HashedParamsV2 and CONSENSUS_VERSION_3 added; VersionParams.app_version removed with field 1 and its name reserved. Bindings and spec/abci/api.md regenerated.
  • Go (application version only): State.Version.Consensus.App follows the committed block header instead of consensus parameters; rollback takes it from the block it rolls back to; kvstore and the e2e app no longer set the removed field. InitChain no longer resets the state application version to the parameter value, and kvstore InitChain no longer returns a version group (which reset a genesis consensus version to 0).
  • Not implemented here: computing or verifying the full hash, the consensus-version validation rules, taking NodeInfo application version from Info, relaxing state-sync verifyApp to >=.

Follow-up outside this repository

  • Dash Platform (rs-drive-abci InitChain): determine the initial protocol version per network or from configuration instead of RequestInitChain.consensus_params.version.app_version; required before Platform upgrades to this Tenderdash.
  • dashmate status: stop reading the active protocol version from /consensus_params.

Coordination

CONSENSUS_VERSION_2 on dev is proposer liveness (#1572); this PR keeps it and its legacy hash. The full parameter commitment activates at CONSENSUS_VERSION_3, the same version as same-block randomness (#1582/#1583), so both share one hard fork. This PR is not stacked on #1583: both define version 3, and whichever merges second extends the other's enum and specification text. The commitment can move to a later consensus version if the two activations need to be separated.

Breaking changes

  • ABCI: ConsensusParams.version.app_version no longer exists; applications must stop setting it (old applications sending it are ignored by protobuf decoding). Genesis files containing it still load, but the value is ignored.
  • InitChain no longer carries an application version, and Tenderdash provides no replacement: the application must determine its initial protocol version itself. Dash Platform reads it from RequestInitChain.consensus_params.version.app_version today and must switch (e.g. per network or from its configuration) before upgrading; otherwise a node syncing from genesis starts at the wrong protocol version and halts on an app-hash mismatch.
  • /consensus_params RPC no longer reports an application version; tools reading it (e.g. dashmate status) must use another source.
  • Activating consensus version 3 changes consensus hashes from that height and requires a coordinated upgrade before height H-1. Historical blocks keep the legacy hash.

Testing

  • New tests (each failed before the change, or against an injected regression): TestStateUpdateTakesAppVersionFromCommittedHeader, extended TestRollback, TestGenesisDocFromJSON_IgnoresRemovedAppVersion, TestHandshakeInitChainKeepsInfoAppVersion, TestConsensusParamsDecodeIgnoresRemovedAppVersion.
  • go test -race on types/..., proto/..., internal/state/..., internal/statesync/..., abci/example/..., internal/rpc/core, and replay/handshake/InitChain tests in internal/consensus pass after merging dev.
  • go vet over all packages (except cmd/abcidump, which needs libpcap) passes after merging dev; golangci-lint reports nothing new except that environment issue; protobuf regeneration is reproducible (second run leaves the tree clean); buf lint passes.
  • Not run locally: clang-format for protobuf files.

🤖 Co-authored by Claudius the Magnificent AI Agent

🤖 Generated with Claude Code

lklimek and others added 2 commits October 21, 2026 12:25
* refactor(db)!: own GoLevelDB and memory database adapters

Retain the GoLevelDB, MemDB and PrefixDB adapters from cometbft-db v1.0.4
under libs/db, with their license, provenance and contract tests. Upstream
plans to retire the shared wrapper and discourages new dependencies on it.

Preserve engine versions, persistence behavior, node configuration and SQL
indexing while removing unused backend registrations and dependencies.
Verify old-to-local-to-old persisted data compatibility and storage race tests.

BREAKING CHANGE: exported DB APIs now use Tenderdash's libs/db interfaces;
custom providers must update imports or adapt their Batch/Iterator return types.

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>

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

* fix(db): retain upstream attribution and modification notices

Mark the eight modified upstream files and preserve cometbft-db's tm-db
ancestry while retaining the original Apache license verbatim.

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>

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

* fix(db): release debug iterators and characterize empty values

Release the GoLevelDB Print iterator before returning. Replace the skipped
empty-value check with explicit backend Get/Has expectations and document
the inherited difference tracked in issue #1554.

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>

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

---------

Co-authored-by: Codex GPT-6 <[email protected]>
Co-authored-by: Claude GPT-6 <[email protected]>
Define a draft canonical full snapshot, independent commitment selector,
activation boundary, historical verification and state-sync trust rules.
Add the source protobuf schema and an implementation and verification plan.
Runtime support and generated bindings are intentionally deferred.

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>

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

coderabbitai Bot commented Nov 4, 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

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@lklimek
lklimek changed the base branch from v1.9-dev to v1.8-dev November 4, 2026 16:28
@thepastaclaw

thepastaclaw commented Nov 4, 2026 •

Copy link
Copy Markdown

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 64d9938. Normal review starts when eligible; priority review starts as soon as a slot is available.

Retain v1.8-dev runtime and dependency state and its current specification,
with only the full-commitment proposal and its two discovery links added.
Conflict resolutions approved by the maintainer.

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>

Co-Authored-By: Codex GPT-6 <[email protected]>
@lklimek
lklimek marked this pull request as ready for review November 4, 2026 16:31
@lklimek
lklimek marked this pull request as draft November 4, 2026 16:31
@Claudius-Maginificent Claudius-Maginificent added priority: low Low priority — nice to have priority: medium Medium priority and removed priority: low Low priority — nice to have labels Nov 5, 2026
@lklimek lklimek added this to the v2.0 milestone Nov 6, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 1 + Phase 2

The draft clearly separates proposed consensus behavior from current runtime behavior, but the production protobuf changes leave checked-in bindings inconsistent with their source schema. Exact-head CI confirms that this change causes check-proto to fail; the other build, test, lint, and documentation checks pass, while PR Hygiene remains pending. Static verification also confirmed a minor navigation omission; no builds or tests were run locally.

🔴 1 blocking | 💬 1 nitpick(s)

1 finding(s) not shown inline (the lines are not part of this PR's diff)

💬 Nitpick: Add the draft to the consensus section's contents
spec/consensus/readme.md:15-22

The new chapter is linked from spec/README.md, spec/consensus/consensus.md, and book/SUMMARY.md, but is missing from this consensus-section Contents list. Add a direct link here as well so the section index exposes the new design alongside the other consensus documents. The chapter remains reachable through the overview, so this is a navigation consistency issue rather than a publication blocker.

source: muse-spark-1.3-contributor (phase1-reviewer: general)

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — The normative commitment specification and protobuf source schema require substantive design review, but the diff does not implement runtime consensus, hashing, or activation changes and therefore does not meet the critical tier.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — tenderdash-consensus-security (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `proto/tendermint/types/params.proto`:
- [BLOCKING] proto/tendermint/types/params.proto:24-27: Keep production protobuf sources and generated bindings consistent
  This adds ConsensusParams.commitment_version and HashedParamsV2 to the production schema, but params.pb.go contains neither addition. Consumers generating from the source therefore receive a different API from consumers using the checked-in Go bindings. AGENTS.md identifies proto/ as the source of truth and directs protobuf changes to be regenerated with make proto-gen. The exact-head check-proto log independently confirms the mismatch: Actions run 42231728858 reports changes to canonical.pb.go, params.pb.go, and types.pb.go, totaling 1,232 insertions and 143 deletions, then exits with "Protobuf generated code requires update". Deferring runtime implementation is reasonable for this design draft, but does not justify introducing inconsistent production schema artifacts. Include the regenerated bindings without enabling FULL behavior, or move the proposed schema into an inert specification example until generation is ready.

In `spec/consensus/readme.md`:
- [NITPICK] spec/consensus/readme.md:15-22: Add the draft to the consensus section's contents
  The new chapter is linked from spec/README.md, spec/consensus/consensus.md, and book/SUMMARY.md, but is missing from this consensus-section Contents list. Add a direct link here as well so the section index exposes the new design alongside the other consensus documents. The chapter remains reachable through the overview, so this is a navigation consistency issue rather than a publication blocker.

Comment thread proto/tendermint/types/params.proto Resolved
…e labels

Specify complete removal of ConsensusParams.Version.AppVersion: reserve
VersionParams field 1 and HashedParamsV2 tag 9, make
ResponsePrepareProposal.app_version the only source of Header.Version.App,
remove State.Version.Consensus.App, source NodeInfo app version from Info and
relax state-sync verifyApp to Info.app_version >= header app version.

Rename the spec to consensus-params-commitment.md and remove release labels
from the chapter, links and proto comments; HashedParamsV2 names the snapshot
schema only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lklimek lklimek modified the milestones: v2.0, v3.0 Nov 6, 2026
lklimek and others added 8 commits November 6, 2026 15:29
Drop the separate commitment_version selector. CONSENSUS_VERSION_2 keeps
version 1 proposer selection and hashes the complete HashedParamsV2
snapshot; lower versions keep the legacy hash. Specify the missing range
and no-downgrade checks and activation through consensus_param_updates.

Renumber HashedParamsV2 contiguously with consensus_version at tag 1.
Keep VersionParams.app_version as deprecated until the implementation
reserves it, and regenerate Go bindings and the ABCI API reference.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reserve VersionParams field 1 (app_version) and drop
types.VersionParams.AppVersion with its conversions. State takes its
application version from the committed block header, which the proposer's
PrepareProposal response sets, and rollback takes it from the header of
the block rolled back to. The kvstore example and e2e app stop sending
the field. Genesis JSON with consensus_params.version.app_version still
loads; the key is ignored.

BREAKING CHANGE: ABCI applications can no longer set the application
version through consensus parameter updates; field 1 is ignored on decode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l bump

Reject any consensus-version decrease, not only below 2, and record that
this changes today's behavior. State that activation must not bump
version.BlockProtocol and why. Describe which parts of the app version
removal this change implements and which remain.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
State-synced nodes take every consensus parameter except block size,
gas, consensus version and the pinned voting threshold on trust. List
per-parameter effects of forged values, why they persist and go
undetected, and how the full commitment closes the gap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Precommit finalization needs the DKG recovery threshold, but prevote
polkas use the configurable threshold, so a low threshold lets a
minority unlock honest validators across rounds. Record why the
state-sync pin must not be dropped before the full commitment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Point to the #1052 override that permits thresholds below 2/3 through
genesis or consensus_param_updates, and state that state sync cannot
forge the threshold because it is pinned to the trusted local value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lklimek lklimek changed the title docs(consensus): define full parameter commitments for v2.0 feat(consensus)!: specify full consensus parameter commitment and remove app version parameter Nov 6, 2026
lklimek and others added 2 commits November 6, 2026 16:29
Check that the handshake keeps the application version from
ResponseInfo when InitChain returns a version parameter group, and that
ConsensusParams encoded with VersionParams field 1 still decode with the
field dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…sion

InitChain carries no application version and Tenderdash adds no
replacement, so the application determines its initial protocol version
itself. Record the Dash Platform dependency and the required order of
upgrades, and stop documenting app_version as a genesis consensus
parameter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — Final validation — Phase 2 only (queue backlog)

New on this head: This revision regenerates the protobuf bindings, moves application-version tracking out of consensus parameters, and adds regression tests for commit, rollback, InitChain, and legacy decoding. The full consensus-parameter hash remains a draft; this head does not activate it. On the exact head, protobuf, build, lint, unit, and end-to-end checks passed; PR Hygiene and the review check were pending.

🟡 5 suggestion(s) | 💬 2 nitpick(s)

Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.

1 finding(s) not shown inline (the lines are not part of this PR's diff)

💬 Nitpick: Add the draft to the consensus section's contents
Impact: Readers browsing the Consensus section's Contents list cannot navigate directly to the parameter-commitment draft.
spec/consensus/readme.md:15-22

The new links in the spec index, consensus overview, and book improve discoverability, but this section's own Contents list still omits the draft. Add a direct link to ./consensus-params-commitment.md here and label it as a draft.

source: gpt-6.2-sol (phase2-reviewer: general, tenderdash-consensus-security)

Review provenance

Source: reviewer 1: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.2-sol (effort low) — The PR makes a breaking ABCI schema change and updates how execution and rollback track the application version, but the full parameter hash and consensus-version validation rules are specified rather than implemented.
  • Phase 1 reviewers: not run (skipped for throughput: 11 PRs queued, above the 10 limit)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — tenderdash-consensus-security (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `abci/example/kvstore/kvstore.go`:
- [SUGGESTION] abci/example/kvstore/kvstore.go:303-306: Fresh nodes reject the first block of older kvstore chains with genesis consensus version 1
  Impact: An operator joining or rebuilding one of these kvstore chains from genesis with the new binary cannot sync past its first block.
  The first signed block fails `validateBlock` with a consensus-hash mismatch. Without an explicit initial-height override, the old kvstore `InitChain` returned a non-nil `VersionParams` whose consensus version defaulted to 0, so `execInitChain` replaced the genesis version and the chain committed a version-0 hash. This change omits the version group, so a fresh node using the same genesis preserves version 1 and computes a different hash. This is independent of the removed app-version field, which was never hashed. Preserve the old effective version for existing kvstore chains or document how their operators can sync under the old rules before upgrading, and add a first-block replay regression with genesis version 1.

In `spec/consensus/consensus-params-commitment.md`:
- [SUGGESTION] spec/consensus/consensus-params-commitment.md:401-409: The draft gives version 2 a different hash from the one already on dev
  Impact: A node implementing the draft on current dev would compute a different consensus-parameter hash for version-2 blocks than a node using the existing proposer-liveness rule.
  The same version would identify two incompatible encodings. Unlike the prior draft's separate commitment selector, this revision assigns the full hash to consensus version 2 and still describes #1572 as open. #1572 has merged, and `origin/dev` at `1871893d0` already hashes the effective proposer heartbeat and silence timeouts under version 2 (`types/params.go:458–475`). The conflict is with the integration branch, not an active hash change on this head. On rebase, preserve dev's version-2 rule for historical verification, assign the full commitment a distinct version, and include both effective timeouts in the full snapshot and test vectors.
- [SUGGESTION] spec/consensus/consensus-params-commitment.md:137-142: The draft's no-decrease rule would reject valid legacy blocks during catch-up
  Impact: Once the draft is implemented as written, a node replaying or block-syncing a chain that previously committed a version 1-to-0 update would stop at that block.
  Preserving the legacy hash encoder alone does not preserve replay. This revision replaces the old FULL-to-LEGACY restriction with an unconditional check at `populateConsensusParams`. Block sync and startup replay both reach that merge through `ProcessProposal` and `NewStateChangeset`; even the replay call with `verify=false` builds the changeset. A present version group can currently set the version to 0, and the `rotate` e2e network exercises `1 → 0 → 1`. Specify an activation boundary for the new validation rule, preserve the historical update rules before it, and add a replay vector that accepts the legacy decrease but rejects a decrease after enforcement starts.
- [SUGGESTION] spec/consensus/consensus-params-commitment.md:390-397: The snapshot version check reads the successor block's version
  Impact: At an application upgrade boundary, an app that meets the draft's version requirement for the restored height can still have its snapshot rejected against the next block's higher version.
  Changing equality to `>=` at the existing call site would still check the wrong height for the rule in this draft. Both state providers populate `State.Version` from the verified header at H+1 (`stateprovider.go:171–179,328–336`), and `syncer.go:434` passes that value to `verifyApp` for the snapshot at H. To enforce the stated rule, pass the authenticated version from the header at H explicitly and test a snapshot whose header and successor have different app versions.
- [NITPICK] spec/consensus/consensus-params-commitment.md:355-357: The compatibility note points ABCI developers to a response without parameter updates
  Impact: An application developer following the migration note could look for the removed field in `FinalizeBlock` and miss the `ProcessProposal` response that actually carries it.
  `ResponseFinalizeBlock` cannot carry a consensus-parameter update (`proto/tendermint/abci/types.proto:596–609`). Both `ResponsePrepareProposal` and `ResponseProcessProposal` carry `consensus_param_updates` at field 4. Replace `FinalizeBlock` with `ProcessProposal` in the compatibility list.

In `types/params.go`:
- [SUGGESTION] types/params.go:75-77: Dashmate shows the startup protocol version after an in-place upgrade
  Impact: Operators running the current dashmate with this Tenderdash can see a stale active protocol version after the node commits blocks at a new version without restarting.
  Removing `app_version` from `/consensus_params` makes dashmate's live lookup return no value. Its Platform status scope falls back to `/status.node_info.protocol_version.app`, but Tenderdash builds that `NodeInfo` at startup (`node/node.go:533,580`) and returns it unchanged (`internal/rpc/core/status.go:60–62`). The PR description calls out the consumer but does not link a migration; dashpay/platform#4136 added the lookup rather than replacing it. Track the companion change in Platform so dashmate reads the latest committed header's `version.app` for the active version and keeps ABCI `Info` for the desired version.

In `spec/consensus/readme.md`:
- [NITPICK] spec/consensus/readme.md:15-22: Add the draft to the consensus section's contents
  Impact: Readers browsing the Consensus section's Contents list cannot navigate directly to the parameter-commitment draft.
  The new links in the spec index, consensus overview, and book improve discoverability, but this section's own Contents list still omits the draft. Add a direct link to `./consensus-params-commitment.md` here and label it as a draft.

Comment on lines 303 to 306
consensusParams, ok := app.consensusParamsUpdates[app.initialHeight]
if !ok {
consensusParams = types1.ConsensusParams{
Version: &types1.VersionParams{
AppVersion: uint64(app.LastCommittedState.GetHeight()) + 1,
},
}
consensusParams = types1.ConsensusParams{}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Fresh nodes reject the first block of older kvstore chains with genesis consensus version 1
Impact: An operator joining or rebuilding one of these kvstore chains from genesis with the new binary cannot sync past its first block.

The first signed block fails validateBlock with a consensus-hash mismatch. Without an explicit initial-height override, the old kvstore InitChain returned a non-nil VersionParams whose consensus version defaulted to 0, so execInitChain replaced the genesis version and the chain committed a version-0 hash. This change omits the version group, so a fresh node using the same genesis preserves version 1 and computes a different hash. This is independent of the removed app-version field, which was never hashed. Preserve the old effective version for existing kvstore chains or document how their operators can sync under the old rules before upgrading, and add a first-block replay regression with genesis version 1.

source: gpt-6.2-sol (phase2-reviewer: general, tenderdash-consensus-security)

Comment on lines +401 to +409
1. Resolve the integration blocker before freezing this snapshot. This document
allocates `CONSENSUS_VERSION_2`. Open
[#1572](https://github.com/dashpay/tenderdash/pull/1572) also assigns
`ConsensusVersion = 2` to heartbeat behavior and adds two timeouts to its legacy
hash; [#1583](https://github.com/dashpay/tenderdash/pull/1583) also uses version 2
for randomness. Reconcile these number assignments before any of them merges.
Any heartbeat parameters merged before activation MUST be added to the full
mapping/schema and vectors before freezing it. Preserve any merged legacy hash
variant for replay. The 15-field draft above MUST NOT activate while that

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: The draft gives version 2 a different hash from the one already on dev
Impact: A node implementing the draft on current dev would compute a different consensus-parameter hash for version-2 blocks than a node using the existing proposer-liveness rule.

The same version would identify two incompatible encodings. Unlike the prior draft's separate commitment selector, this revision assigns the full hash to consensus version 2 and still describes #1572 as open. #1572 has merged, and origin/dev at 1871893d0 already hashes the effective proposer heartbeat and silence timeouts under version 2 (types/params.go:458–475). The conflict is with the integration branch, not an active hash change on this head. On rebase, preserve dev's version-2 rule for historical verification, assign the full commitment a distinct version, and include both effective timeouts in the full snapshot and test vectors.

source: gpt-6.2-sol (phase2-reviewer: general, tenderdash-consensus-security)

Comment on lines +137 to +142
2. **Never decrease.** Where an ABCI update is merged and validated
([`internal/state/current_round_state.go:171`](../../internal/state/current_round_state.go)),
reject any candidate whose consensus version is lower than the current one.
`ValidateConsensusParams` sees only the candidate, so this check compares the
current and candidate parameters. This changes today's behavior, which
accepts any decrease, including 1 to 0.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: The draft's no-decrease rule would reject valid legacy blocks during catch-up
Impact: Once the draft is implemented as written, a node replaying or block-syncing a chain that previously committed a version 1-to-0 update would stop at that block.

Preserving the legacy hash encoder alone does not preserve replay. This revision replaces the old FULL-to-LEGACY restriction with an unconditional check at populateConsensusParams. Block sync and startup replay both reach that merge through ProcessProposal and NewStateChangeset; even the replay call with verify=false builds the changeset. A present version group can currently set the version to 0, and the rotate e2e network exercises 1 → 0 → 1. Specify an activation boundary for the new validation rule, preserve the historical update rules before it, and add a replay vector that accepts the legacy decrease but rejects a decrease after enforcement starts.

source: gpt-6.2-sol (phase2-reviewer: general, tenderdash-consensus-security)

Comment thread types/params.go
Comment on lines 75 to 77
type VersionParams struct {
AppVersion uint64 `json:"app_version,string"`
ConsensusVersion int32 `json:"consensus,string"`
ConsensusVersion int32 `json:"consensus,string"`
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Dashmate shows the startup protocol version after an in-place upgrade
Impact: Operators running the current dashmate with this Tenderdash can see a stale active protocol version after the node commits blocks at a new version without restarting.

Removing app_version from /consensus_params makes dashmate's live lookup return no value. Its Platform status scope falls back to /status.node_info.protocol_version.app, but Tenderdash builds that NodeInfo at startup (node/node.go:533,580) and returns it unchanged (internal/rpc/core/status.go:60–62). The PR description calls out the consumer but does not link a migration; dashpay/platform#4136 added the lookup rather than replacing it. Track the companion change in Platform so dashmate reads the latest committed header's version.app for the active version and keeps ABCI Info for the desired version.

source: gpt-6.2-sol (phase2-reviewer: general, tenderdash-consensus-security)

Comment on lines +390 to +397
3. **State sync.** `verifyApp`
([`internal/statesync/syncer.go:697`](../../internal/statesync/syncer.go)) MUST
require `ResponseInfo.app_version >= Header.Version.App` of the trusted snapshot
header instead of equality; the header value is reached through the state
provider's `State.Version`
([`internal/statesync/stateprovider.go:177`](../../internal/statesync/stateprovider.go)).
Applications may report their latest supported protocol version in Info, as
Dash Platform does.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: The snapshot version check reads the successor block's version
Impact: At an application upgrade boundary, an app that meets the draft's version requirement for the restored height can still have its snapshot rejected against the next block's higher version.

Changing equality to >= at the existing call site would still check the wrong height for the rule in this draft. Both state providers populate State.Version from the verified header at H+1 (stateprovider.go:171–179,328–336), and syncer.go:434 passes that value to verifyApp for the snapshot at H. To enforce the stated rule, pass the authenticated version from the header at H explicitly and test a snapshot whose header and successor have different app versions.

source: gpt-6.2-sol (phase2-reviewer: general, tenderdash-consensus-security)

Comment on lines +355 to +357
6. **Compatibility.** Protobuf decoding ignores field 1 sent by older applications
in `InitChain`, `PrepareProposal` or `FinalizeBlock` parameter updates, and in
stored parameters. Genesis JSON containing

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 Nitpick: The compatibility note points ABCI developers to a response without parameter updates
Impact: An application developer following the migration note could look for the removed field in FinalizeBlock and miss the ProcessProposal response that actually carries it.

ResponseFinalizeBlock cannot carry a consensus-parameter update (proto/tendermint/abci/types.proto:596–609). Both ResponsePrepareProposal and ResponseProcessProposal carry consensus_param_updates at field 4. Replace FinalizeBlock with ProcessProposal in the compatibility list.

source: gpt-6.2-sol (phase2-reviewer: general, tenderdash-consensus-security)

Comment thread proto/tendermint/types/params.proto Resolved
lklimek and others added 4 commits December 3, 2026 07:56
Resolve conflicts with proposer liveness on dev: keep dev's
CONSENSUS_VERSION_2 meaning and its HashedParams fields 4/5, keep this
branch's app_version removal and HashedParamsV2 draft. The version the
full commitment activates at is moved in the following commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
CONSENSUS_VERSION_2 on dev is proposer liveness. The full parameter
commitment now activates at CONSENSUS_VERSION_3, the same version as
same-block randomness (#1583), so both share one hard fork.

- Add CONSENSUS_VERSION_3 to the ConsensusVersion enum.
- Cover the proposer liveness timeouts in HashedParamsV2 (tags 16, 17).
- Update the specification: hash-rule table per version, activation at
  version 3, shared activation, and refreshed source line references.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Commit the proposer liveness pair as derived in effect, with vectors.
- Gate version 3 on the runtime of both changes that share it.
- Name the header that state sync compares the app version against.
- Correct the legacy version-group note and the low-threshold claim.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
voting_power_threshold follows the other optional parameter fields: an
absent value keeps the previous threshold, 0 clears the override so the
quorum-type threshold applies, and a positive value sets it, while a
present validator group still replaces pub_key_types. The rule is the
same at and after activation of the full commitment. Record that the
parameter merge and the validator-set update do not implement it yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants