Skip to content

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

Open
Claudius-Maginificent wants to merge 1 commit into
v5.1-devfrom
feat/tenderdash-consensus-v2-pv15
Open

Claudius-Maginificent wants to merge 1 commit 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 · aebfe85

  • Bots — thepastaclaw ✓
  • Self-review — not asked of a bot author
  • Build failed
  • 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/tests/strategy_tests/test_cases/upgrade_fork_tests.rs) — QuantumExplorer or shumkov
    • files with no dedicated owner (packages/rs-platform-version/src/version/v15.rs) — QuantumExplorer or 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.
    • Platform version 15 uses consensus version 2, preserving proposer heartbeats and round skipping during upgrades and restarts.
    • Upgrade checks now verify that 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 <noreply@anthropic.com>
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 uses 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
PV15 now selects Tenderdash consensus version 2. Documentation describes the activation settings, compatibility, and emergency-update minimum version.

Emergency consensus updates

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 used alongside the consensus-parameter update changes.

Suggested reviewers: lklimek, shumkov, thepastaclaw

Merge Risk: Minimal · up to aebfe

This change turns on Tenderdash consensus version 2 when protocol version 15 activates, and emergency updates will not lower it. The activation and emergency-update paths look correct, and no merge-blocking issue was found. Validators must run Tenderdash 2.0 or later by activation. Dashmate migrates its managed configurations to a 2.0 image, but validators running custom images outside dashmate need to upgrade themselves.

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 shows the changes to PLATFORM_V15 consensus config to version 2, the v2 em…
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 shows the changes to PLATFORM_V15 consensus config to version 2, the v2 emergency update handling, and the related tests. The title is specific, concise, and marked as breaking with the '!' suffix, which matches the PR objectives describing a breaking change. The title does not mention the emergency-update guard or the test changes, but those are secondary details.

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 adfa029 and aebfe85.

Files selected for processing: 4

  • 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/tests/strategy_tests/test_cases/upgrade_fork_tests.rs
  • packages/rs-platform-version/src/version/v15.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 aebfe85) · 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

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants