Skip to content

Activate future block time v2 at testnet4 height 60,000 - #133

Merged
kiwidream merged 6 commits into
1.0.0from
future-time-v2-activation
Jul 15, 2026
Merged

kiwidream merged 6 commits into
1.0.0from
future-time-v2-activation

Conversation

@kiwidream

@kiwidream kiwidream commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #132.

This change replaces inherited Bitcoin timestamp and freshness assumptions with qbit-specific limits while preserving testnet4 compatibility:

  • height-gates future block time v2 independently from P2MR validation-weight v2;
  • keeps the legacy two-hour future-time limit through testnet4 height 59,999 and activates the ten-minute limit at height 60,000;
  • exposes current, next-block, and mining-candidate future-time state and timestamp headroom through RPCs;
  • keeps the historical wallet/RPC timestamp window independently fixed at two hours; and
  • retunes the GUI, fee-estimation, IBD, anti-fee-sniping, and verification-progress freshness windows documented in the issue.

Mining RPCs refuse to return impossible candidates when median time past exceeds the active future-time ceiling. The activation test covers exact boundaries, transient rejection, reorgs, loaded-tip validation, independent activation state, and the median-time-past transition hazard.

Testing

  • Built locally.
  • Ran focused unit or functional tests for the changed area.
  • Ran lint or formatting checks relevant to this change.
  • Not run. Reason:

Validation performed:

  • built qbitd, qbit-cli, test_qbit, and test_qbit-qt;
  • passed the full 1,236-case C++ test suite;
  • passed the Qt test suite, including the exact ten-minute GUI freshness boundary;
  • passed feature_future_block_time_activation.py, p2p_invalid_block.py over both transports, mining_asert_timestamp_edges.py, mining_basic.py, feature_auxpow.py, feature_maxtipage.py, rpc_blockchain.py over both transports, wallet_anchor.py, wallet_create_tx.py, and wallet_listtransactions.py;
  • generated and validated RPC documentation; and
  • passed ./ci/lint/06_script.sh in the Ubuntu 24.04 Docker lint image.

Target Branch

  • This PR targets main or a maintainer-requested release branch such as 0.1.x.

Target: 1.0.0.

Risk / Review Notes

  • Consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed.
  • No consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed.

Notes:

Future block time is height-selected using the candidate block height. Testnet4 activates at 60,000; main, testnet3, signet, and default regtest use v2 from genesis. Regtest can override it with -testactivationheight=futuretime@<height>.

The activation has no median-time-past exception. Operators can monitor getblockchaininfo.future_block_time.next_block_time_headroom_seconds before activation. The two-hour TIMESTAMP_WINDOW, 60-second MAX_TIMEWARP, eleven-block median-time span, and legacy headers-sync history budget remain intact.

Docs / Process Impact

Choose exactly one:

  • I updated public docs because this PR changes user-visible behavior, integration guidance, release/process guidance, or expected validation.
  • No public docs update needed. Reason:

libbitcoinpqc Subtree Checklist (if src/libbitcoinpqc changed)

  • Source commit is reachable from an immutable release tag in Qbit-Org/qbit-libbitcoinpqc.
  • qbit imports the tagged upstream tree directly without pruning or a curated subtree branch.
  • Subtree import/update was performed with contrib/devtools/update-libbitcoinpqc-subtree.sh.
  • test/lint/libbitcoinpqc-subtree-check.sh passes locally.
  • Any default tag change in contrib/devtools/update-libbitcoinpqc-subtree.sh is intentional and matches doc/subtrees/libbitcoinpqc.md.

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

High Risk
Consensus changes how far future block timestamps may be, with a testnet4 activation that can temporarily block mining if median time past exceeds the new ceiling; operators must upgrade and monitor RPC headroom before height 60,000.

Overview
Introduces future block time v2: after network-specific activation, block timestamps may be at most 10 minutes ahead of node time (replacing the inherited 2-hour cap where the legacy rule still applies). Testnet4 keeps 2 hours through height 59,999 and switches at 60,000; main, testnet3, signet, and default regtest use 10 minutes from genesis. Activation is independent of P2MR validation-weight v2 despite sharing testnet4 height 60,000; regtest can set -testactivationheight=futuretime@<height> separately.

Consensus validation, loaded-tip checks, and mining templates use height-selected GetMaxFutureBlockTime. getblockchaininfo, getblocktemplate, and createauxblock expose future_block_time (limits, activation state, next-block min/max timestamps and headroom). Mining RPCs return time-too-new instead of impossible templates when median time past leaves no valid timestamp—relevant at the testnet4 boundary if legacy future-dated blocks push MTP high.

TIMESTAMP_WINDOW stays 2 hours for wallet/RPC historical searches. Non-consensus freshness is retuned: GUI synced gap 10 min, fee-estimation tip age 20 min, default IBD max tip age 3 h, anti-fee-sniping 1 h, verification-progress “recent” window 15 min. Headers sync still budgets the legacy 2-hour future-time history.

Docs, release notes, functional test feature_future_block_time_activation.py, and several tests defer or adjust mock-time behavior so long synthetic chains do not collide with the new rule.

Reviewed by Cursor Bugbot for commit 6cbe5ae. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread src/rpc/mining.cpp Resolved

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a65d504. Configure here.

Comment thread src/kernel/chainparams.cpp Resolved
@kiwidream
kiwidream force-pushed the future-time-v2-activation branch from 41e99bd to 6cbe5ae Compare July 15, 2026 11:58
@kiwidream
kiwidream merged commit c6ab9b3 into 1.0.0 Jul 15, 2026
37 checks passed
kiwidream added a commit that referenced this pull request Jul 15, 2026
* Activate future block time v2 on testnet4

* Fix future-time v2 CI regressions

* test: isolate mempool limit synthetic chain

* test: preserve legacy timestamp scenarios

* test: derive nulldummy block time from tip

* test: keep sequence-lock blocks within time limit
kiwidream added a commit that referenced this pull request Jul 15, 2026
* ci: enable validation on 1.0.0 (#73)

* Fix scanner high findings (#72)

* Resolve scanner medium findings (#74)

* Reject malformed P2MR leaf versions in Qt (#82)

* Bind builder attestations to signed-tag source (#84)

* Bind builder attestations to release source

* Fix builder workflow source environment

* Restore verified release tag after checkout

* qt: avoid wallet shutdown deadlock during model adoption (#87)

* Use aggregate work rate for assumevalid burial (#88)

* p2p: use recent chainwork for anti-DoS thresholds (#89)

* qt: bind P2MR proofs to expected signer (#85)

* Complete restricted-output fundrawtransaction edge coverage (#86)

* test: extend restricted-output raw funding coverage

* test: use documented raw funding fee option

* Prevent closing wallet progress dialogs (#97)

* qt: minimize P2MR proof exports (#95)

* Fix Qt wallet shutdown lifetime (#90)

* Fix Qt wallet shutdown lifetime

* Fix Qt shutdown CI coverage

* Test active wallet shutdown during transaction preparation

* Use portable thread in Qt shutdown test

* validation: reject height-invalid AuxPoW substitutions (#106)

* Bound qbit-qt P2MR proof parsing (#96)

* Bound Qt P2MR proof parsing

* Fix GCC range-loop warning

* qt: bind proof limit to minimal export

* rpc: default to portable P2MR proofs

* test: update PQC usage RPC expectations

* doc: qualify legacy P2MR proof compatibility

* Cache Cadence lane predecessors (#108)

* build: prohibit PQC runtime test controls in qbit (#107)

* build: prohibit PQC runtime test controls

* build: prevent PQC production mode cancellation

* ci: make PQC build policy check executable

* ci: reset cached IWYU sources before tidy setup

* docs: show qbit version and full logo in RPC sidebar (#119)

* doc: update RPC docs branding

* test: handle missing MkDocs in RPC docs suite

* Activate P2MR validation weight v2 on testnet4 at height 60,000 (#109)

* Activate P2MR validation weight v2 at height 60,000

* test: cover P2MR weight in getblockchaininfo

* validation: pre-enforce forthcoming P2MR weight rule

* doc: bound block-wide P2MR verification work

* test: cover P2MR validation-weight boundaries

* test: avoid mixed enum flag expressions

* Make resumed release draft notes deterministic (#116)

* release: make draft notes deterministic

* release: harden draft validation edge cases

* P2MR v1 conformance and release framework (#118)

* doc: define the qbit P2MR v1 consensus profile

* test: add the qbit P2MR v1 conformance corpus

* ci: gate qbit P2MR v1 conformance with an independent oracle

* release: gate qbit P2MR v1 conformance and integration signoff

* ci: execute P2MR CHECKSIGADD and release validator tests

* build: preserve P2MR corpus line endings

* test: hard-fail invalid P2MR oracle signatures

* ci: initialize P2MR target directory at runtime

* ci: test p2mr release gate in release-only profile

* test: make p2mr v1 corpus fully reproducible

* test: execute p2mr data signature opcodes

* test: type p2mr generator mutation fixtures

* release: sync p2mr support matrix digest

* test: require CHECKSIGADD boundary fixtures

* test: fix rebased P2MR conformance checks

* test: close P2MR conformance review gaps

* test: align P2MR conformance with weight v2

* Harden P2MR corpus and oracle conformance evidence (#127)

* test: prove P2MR corpus mutation resistance

* test: cover P2MR signature opcode underflow

* release: sync hardened P2MR evidence digest

* qt: preserve PQC usage after signing failures (#128)

* qt: preserve PQC usage after signing failures

* docs: align release note with PR 128

* Enforce immutable local release publication (#117)

* release: enforce immutable local publication

* release: preserve resumed draft metadata

* release: fail closed on remote verification

* release: discover resumable drafts safely

* release: re-pin immutable publication tags (#130)

* Establish mainnet 3-of-5 release-key policy (#134)

* release: establish mainnet 3-of-5 signer policy

* ci: always verify operator policy approvals

* ci: use merge queue base for policy history

* Stage v1.0.0 mainnet launch; placeholder genesis and AuxPoW chain ID (#131)

* Stage v1.0.0 mainnet launch configuration

* test: derive subversion expectation from release version

* ci: enforce staged mainnet publication posture

* release: lock staged mainnet launch difficulty

* ci: test chain ID finalization contract

* release: separate staged and final genesis targets

* ci: require live chain ID assertion

* Activate future block time v2 at testnet4 height 60,000 (#133)

* Activate future block time v2 on testnet4

* Fix future-time v2 CI regressions

* test: isolate mempool limit synthetic chain

* test: preserve legacy timestamp scenarios

* test: derive nulldummy block time from tip

* test: keep sequence-lock blocks within time limit

* ci: retrigger validation after release rebase

* test: isolate pruning timestamps from future-time v2

* docs: publish v1.0.0 mainnet guidance

* consensus: pin mainnet genesis and ASERT anchor
@kiwidream kiwidream mentioned this pull request Jul 15, 2026
9 of 14 tasks
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.

2 participants