Skip to content

feat(platform)!: activate Tenderdash consensus version 2 with protocol version 15 - #5941

Merged
lklimek merged 2 commits into
v5.1-devfrom
feat/tenderdash-consensus-v2-pv15
Nov 16, 2026
Merged

lklimek merged 2 commits into
v5.1-devfrom
feat/tenderdash-consensus-v2-pv15

Conversation

@Claudius-Maginificent

@Claudius-Maginificent Claudius-Maginificent commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR: When the network upgrades to protocol version 15, it also switches its consensus engine to the newer version that notices an offline block proposer and moves on to the next one.

User story

As a Dash Platform user, I want my transaction to be included quickly even when the validator whose turn it is to propose a block is offline, to achieve predictable confirmation times.

As a masternode operator, I want the faster recovery from offline proposers to switch on together with the protocol upgrade, to achieve it without a separate coordinated network event.

Scenario

Base flow

The network is idle, waiting for transactions. The validator whose turn it is to propose the next block has gone offline. A user then submits a transaction.

Actual behavior

Nobody notices the offline proposer until the transaction arrives. The transaction then waits for the full proposal timeout before another validator takes over.

Expected behavior

From protocol version 15, an idle proposer regularly signals that it is alive. When validators stop hearing from it, they hand the round to the next proposer in advance, so a new transaction is picked up without waiting out the timeout.

Detailed discussion

What was done

  • PLATFORM_V15.consensus.tenderdash_consensus_version is set to 2 (it was 1). At activation, consensus_params_update sends VersionParams { app_version: 15, consensus_version: 2 } together with the PV15 evidence policy. That enables Tenderdash CONSENSUS_VERSION_2: proposer heartbeats, round skip votes and round skip certificates (Tenderdash v2.0.0-dev.2, feat(consensus)!: hand a silent proposer's idle round to the next proposer tenderdash#1572). A fresh chain started at PV15 gets the same value from InitChain.
  • proposer_heartbeat and proposer_silence are not set, so Tenderdash uses its defaults of 1 s and 5 s (TimeoutParamsOrDefaults). Raising ConsensusVersion to 2 clears any stored values, per the Tenderdash spec (spec/consensus/consensus-proposer-liveness.md § Parameters).
  • consensus_params_update_v2 emergency updates (mainnet epoch 3, testnet epoch 1480) now send max(1, new tenderdash_consensus_version) instead of a hardcoded 1. Without this, an emergency update would lower a PV15 chain from version 2 to 1. Only PV15 selects consensus_params_update 2, so earlier protocol versions are unaffected.
  • PV15 note 44 describes the change.

In-place changes to shipped generations

consensus_params_update_v2 is edited in place. It is selected only by DRIVE_ABCI_METHOD_VERSIONS_V11 / PV15, which has not been activated on any network (v5.1.0-dev.1 is a dev prerelease). PV14 and earlier select v0/v1, which are unchanged.

Testing

  • New unit test should_activate_tenderdash_consensus_version_2_with_protocol_version_15 covers PV14 → PV15 on mainnet, testnet, regtest and devnet.
  • Updated should_install_zero_evidence_bytes_on_activation_and_skipped_upgrades (expects 2) and should_include_evidence_policy_alongside_emergency_version_updates (an emergency update must not lower the version). Both failed before the change and pass after it.
  • Strategy test should_emit_consensus_params_update_evidence_policy_once_across_activation_and_restart now also checks consensus_version on the real activation block.
  • All consensus_params_update, init-chain and upgrade unit tests in drive-abci, the platform-version tests and the related strategy tests pass. cargo clippy -p drive-abci -p platform-version --all-targets -D warnings is clean.

Breaking changes

Consensus-breaking. After PV15 activates, only Tenderdash 2.0 or later can follow the chain. Drive already rejects a Tenderdash with a different ABCI version (info handler, ABCI 1.5.0), and dashmate on v5.1-dev ships dashpay/tenderdash:2.0.0-dev.2. Validators that sign through a socket or gRPC remote signer send no heartbeats, so their idle rounds are skipped after the silence timeout.

Checklist

  • I have performed a self-review of my own code
  • My Rust, FFI, WASM, Swift or Kotlin changes follow the coding conventions
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request
  • If I added or changed a system contract's document schemas, I checked the contract viewer link posted on this pull request

Prior work

Attribution

🤖 Co-authored by Claudius the Magnificent AI Agent

🤖 Generated with Claude Code

https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC

PR Hygiene · e2ad4f3

  • Bots — thepastaclaw ✓
  • Self-review — not asked of a bot author
  • Build green
  • Approvals
    • rs-drive-abci (packages/rs-drive-abci/src/execution/engine/consensus_params_update/mod.rs, packages/rs-drive-abci/src/execution/engine/consensus_params_update/v2/mod.rs, packages/rs-drive-abci/src/execution/validation/state_transition/processor/traits/is_allowed.rs and 1 more) — approved by shumkov
    • files with no dedicated owner (packages/rs-platform-version/src/version/v15.rs) — approved by shumkov

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

Summary by CodeRabbit

  • Bug Fixes
    • Emergency consensus updates now retain the appropriate consensus version instead of reverting to version 1, including when platform versions remain unchanged.
    • Platform version 15 uses consensus version 2, preserving proposer heartbeats and round skipping during upgrades and restarts.
    • Upgrade checks verify that emitted consensus updates match the platform version’s supported consensus version.

…l version 15

PLATFORM_V15 sets tenderdash_consensus_version to 2, so the PV15
activation block's consensus parameter update turns on Tenderdash
proposer liveness and round skipping (CONSENSUS_VERSION_2, Tenderdash
2.0). Heartbeat and silence timeouts keep Tenderdash defaults.

consensus_params_update v2 (selected only by PV15) emergency updates now
force at least consensus version 1 instead of exactly 1, so they cannot
lower version 2.

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

PV15 now selects Tenderdash consensus version 2. Emergency consensus updates use the new platform’s Tenderdash consensus version when it exceeds 1. Updated tests check the version during activation and emergency updates.

Changes: PV15 consensus version

Layer / File(s) Summary
Set the PV15 Tenderdash consensus version
packages/rs-platform-version/src/version/v15.rs, packages/rs-drive-abci/src/execution/validation/state_transition/processor/traits/is_allowed.rs
PV15 now selects Tenderdash consensus version 2. Documentation describes activation settings, compatibility, and the emergency-update minimum version. Comments about tradeable-token mode rejection were removed.
Layer / File(s) Summary
Apply and verify emergency consensus updates
packages/rs-drive-abci/src/execution/engine/consensus_params_update/v2/mod.rs, packages/rs-drive-abci/src/execution/engine/consensus_params_update/mod.rs, packages/rs-drive-abci/tests/strategy_tests/test_cases/upgrade_fork_tests.rs
Emergency updates use the new platform’s Tenderdash consensus version when it exceeds 1; otherwise, they use 1. Tests check version 2 during PV14-to-PV15 activation and emergency updates.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related PRs

  • dashpay/platform#5489: Adds the PV15 evidence policy and method-table selection in the same consensus-parameter update path.

Suggested reviewers: thepastaclaw

Merge Risk: Minimal · up to e2ad4

PV15 now activates Tenderdash consensus version 2, and emergency updates no longer lower it to 1. No concrete merge-blocking problem was found in the supplied changes. The PR is consensus-breaking by design and requires Tenderdash 2.0 or later after activation.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: activating Tenderdash consensus version 2 together with protocol version 15. The raw summary confirms this. PLATFORM_V15 sets consensus version 2, emergency consensus …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: activating Tenderdash consensus version 2 together with protocol version 15. The raw summary confirms this. PLATFORM_V15 sets consensus version 2, emergency consensus updates now keep the configured version, and the tests expect version 2. The title is short and specific, and it does not describe anything absent from the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between aebfe85 and e2ad4f3.

Files selected for processing: 1

  • packages/rs-drive-abci/src/execution/validation/state_transition/processor/traits/is_allowed.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions github-actions Bot added this to the v5.1.0 milestone Nov 16, 2026
@lklimek
lklimek marked this pull request as ready for review November 16, 2026 06:38
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 16, 2026
@thepastaclaw

thepastaclaw commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit e2ad4f3) · triage: critical

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

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 protocol-15 activation is correctly wired through PlatformVersion and the shared version-dispatched consensus-parameter update path. No in-scope correctness or consensus-safety defects were found; the failed Rust workspace check is attributable to pre-existing rustfmt drift in an unchanged file.

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: architecture-layering); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.1-sol (effort low) — The diff changes protocol-version activation and consensus parameter updates in rs-drive-abci, directly altering consensus behavior and the chain's Tenderdash compatibility boundary.
  • 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)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — platform-versioning (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — tenderdash-consensus-security (completed, effort xhigh); agent phase2-reviewer
Out-of-scope follow-up suggestions (2)

These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.

  • Remote signers cannot participate in proposer-liveness votes — The pinned Tenderdash implementation explicitly returns an unsupported-operation error for both SignProposerHeartbeat and SignRoundSkipVote in its socket and gRPC remote-signer clients. As a result, deployments whose round-skip threshold cannot be met by locally signing validators will not obtain the advertised fast recovery from silent proposers after protocol version 15 activates.
    • Follow-up: Track a follow-up dashpay/tenderdash change adding proposer-heartbeat and round-skip-vote requests to the socket and gRPC remote-signer protocols, and document or gate protocol-15 rollout for deployments that rely on remote signing.
  • Rust workspace CI failure indicates a regression — Not this PR's responsibility: the failed job stopped on rustfmt drift at packages/rs-drive-abci/src/execution/validation/state_transition/processor/traits/is_allowed.rs:815, an unchanged file outside the diff.
    • Follow-up: Consider creating a separate issue or author/maintainer-requested PR for this.

@github-actions github-actions Bot removed the waiting-bots Waiting for the review bots to report on this head label Nov 16, 2026
lklimek
lklimek previously approved these changes Nov 16, 2026
shumkov
shumkov previously approved these changes Nov 16, 2026
@lklimek
lklimek dismissed stale reviews from shumkov and themself via e2ad4f3 November 16, 2026 11:56
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 16, 2026
@lklimek

lklimek commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

/skip-bots

@github-actions github-actions Bot added bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. and removed waiting-bots Waiting for the review bots to report on this head labels Nov 16, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

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 1 + Phase 2

Static verification found two in-scope suggestions. The V11 method-table documentation omits the new emergency-update floor, and enabling Tenderdash consensus version 2 leaves mixed deployments with socket or gRPC remote signers unable to produce the round-skip votes needed for proposer recovery. CI shows no failed code checks on this head; Rust workspace tests passed, while several broader suites were skipped.

🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 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.

Follow-up candidates (optional) (2)

New non-blocking observations on code unchanged since the last full review. No inline threads are opened for them and later reviews do not repeat them: fix forward or track separately if they are worth it.

🟡 Suggestion: Document the emergency consensus-version floor in the V11 method table
packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v11.rs:116

The canonical V11 method-table documentation currently says that engine.consensus_params_update version 2 installs the full evidence policy when it changes, but it omits the behavior introduced by this PR. The v2 implementation now uses max(1, new_platform_version.consensus.tenderdash_consensus_version) for emergency updates, so it also prevents an active Tenderdash consensus version from being lowered. Keeping this description aligned with the implementation will prevent readers from missing the reason for the changed emergency path.

/// - `engine.consensus_params_update` 2 installs the full evidence policy when it changes and never lowers the Tenderdash consensus version on an emergency update.

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

🟡 Suggestion: Remote-signing validators can prevent round-skip recovery
packages/rs-platform-version/src/version/v15.rs:968

Protocol version 15 enables Tenderdash consensus version 2 for every v15 chain, but the pinned Tenderdash socket and gRPC SignerClient implementations return ErrSigningNotSupported for both proposer heartbeats and round-skip votes. For the production LLMQ_100_67 configuration, the round-skip collector requires 67 of 100 voting shares; if remote-signer-backed validators represent at least 34% of the quorum, the remaining validators cannot form a certificate. An offline proposer therefore still forces transactions to wait for the ordinary proposal timeout, so the advertised idle-round recovery does not work for that supported signer deployment. The breaking-changes text mentions missing heartbeats but not the equally necessary missing skip votes. Gate activation on a liveness-capable signer deployment or extend the upstream remote-signer protocol before relying on version 2 for these validators.

source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.1-sol (phase2-reviewer: general, architecture-layering, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security)

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: architecture-layering); reviewer 4: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 8: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.1-sol (effort low) — The diff changes protocol-version activation and consensus-parameter updates in rs-drive-abci, directly altering the consensus engine and behavior of the network, which is a critical consensus surface.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (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)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Code unchanged since the last final review (aebfe85b): 2 new suggestion(s) listed as follow-up candidates, not posted inline
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — platform-versioning (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — tenderdash-consensus-security (completed, effort xhigh); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.

No unresolved findings remain from the prior review on this head.

@github-actions github-actions Bot removed the bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Policy satisfied — this can merge.
Full checklist in the description.

@lklimek
lklimek merged commit ce3ca4b into v5.1-dev Nov 16, 2026
36 checks passed
@lklimek
lklimek deleted the feat/tenderdash-consensus-v2-pv15 branch November 16, 2026 13:32
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.

4 participants