Skip to content

fix(testnet): restore GRANDPA finality after warp sync - #3055

Closed
UnArbosFive wants to merge 2 commits into
revert-block-author-transaction-feesfrom
fix/testnet-grandpa-finality-sdk-pin
Closed

fix(testnet): restore GRANDPA finality after warp sync#3055
UnArbosFive wants to merge 2 commits into
revert-block-author-transaction-feesfrom
fix/testnet-grandpa-finality-sdk-pin

Conversation

@UnArbosFive

@UnArbosFive UnArbosFive commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Root cause and fix

Warp sync seeded the client-side GRANDPA voter from a hard-coded checkpoint. The checkpoint contained one authority that was not in the live authority set and asserted a set ID ahead of the live chain. A warped node could therefore advance best while rejecting live GRANDPA commits and leaving finalized at the warp point.

The pinned SDK revision preserves the authority set verified during warp sync when initializing GRANDPA after state import. The Subtensor checkpoint must therefore match the historical chain state exactly.

The same SDK pin also repairs persistent GRANDPA state growth. On startup it removes every current_rounds entry at or below the last completed round, including both voted and unvoted entries. Those rounds cannot be resumed after restart; retaining them only caused subsequent votes to clone and rewrite dead state.

Scope and safety

The checkpoint path remains guarded by the exact testnet genesis hash. Mainnet and other chains retain their existing InitialSetId path and do not consume the testnet checkpoint authority list.

The stale-round cleanup is chain-agnostic but narrowly bounded: it removes only rounds already concluded according to the persisted last completed round and retains every round strictly above it. It does not change consensus rules, runtime logic, Wasm, authority rotation, block validity, or on-chain state.

SDK pin

cacb4310f20c7cac83eb3ccd8ed5a5ad4212608a is an immutable merge commit on polkadot-stable2506-2-otf-patches. The pin includes both SDK fixes and does not depend on either feature branch remaining available.

Validation

  • cargo metadata --locked --format-version 1 --no-deps
  • cargo fmt --all -- --check
  • SKIP_WASM_BUILD=1 cargo test -p node-subtensor grandpa_warp_sync --locked
    • 2 library-target tests passed
    • 2 binary-target tests passed
  • git diff --check
  • built a 2506-compatible node against the cleanup revision and started it on an isolated reflink snapshot of an archive RocksDB:
    • first startup removed 1,916,103 stale GRANDPA current-round entries and completed startup;
    • second startup removed no additional entries and completed startup, confirming idempotence.

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subtensor Ready Ready Preview Aug 6, 2026 1:08am

Request Review

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

eco-tests changed — indexer review required

This PR modifies files under eco-tests/. and may affect downstream indexing.
cc @evgeny-s — please review manually

Changed files
  • eco-tests/Cargo.toml

@github-actions
github-actions Bot requested a review from evgeny-s August 5, 2026 23:56
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

VERY HIGH account-profile scrutiny (35-day-old account, 0 public repos), moderated by admin permission and substantial repository activity; no Gittensor association; targets integration branch revert-block-author-transaction-fees with open PR #3053 into main.

Static review found a uniform workspace-wide replacement of the prior Polkadot SDK revision with immutable commit cacb4310f20c7cac83eb3ccd8ed5a5ad4212608a. The authority removal and set-ID correction remain restricted to the testnet checkpoint path; no runtime, workflow, or AI trust-boundary files changed.

Findings

No findings.

Conclusion

No malicious behavior or security vulnerability was found in the supplied diff.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

UNKNOWN Gittensor association; recent account, but established repository contributor with admin permission and substantial activity.

The prior description discrepancy is resolved: the body now identifies cacb4310f20c7cac83eb3ccd8ed5a5ad4212608a and explains that it contains both upstream fixes. The SDK revision is applied consistently across the workspace manifests and lockfile.

The checkpoint correction remains scoped to the exact testnet genesis hash and updates the existing exact-value tests. This is node-side only, so no runtime spec-version bump is required.

PR #2971 is the only semantic overlap and lacks the complete SDK-pin repair. This PR is the better candidate. Recommend closing #2971.

git diff --check passed. No additional runtime confirmation was necessary.

Findings

No findings.

Conclusion

No actionable domain issue was found. The change is coherent, narrowly scoped, documented, and adequately validated.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@UnArbosFive
UnArbosFive force-pushed the fix/testnet-grandpa-finality-sdk-pin branch from f4068f0 to a85d83d Compare August 6, 2026 00:19
@UnArbosFive
UnArbosFive changed the base branch from main to revert-block-author-transaction-fees August 6, 2026 00:19
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@UnArbosFive
UnArbosFive marked this pull request as ready for review August 6, 2026 01:19
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

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.

1 participant