Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc, chainparams: 29775 release notes and follow-ups #30604

Merged
merged 4 commits into from
Aug 9, 2024

Conversation

fjahr
Copy link
Contributor

@fjahr fjahr commented Aug 7, 2024

This completes follow-ups left open in #29775.

  • Adds release notes
  • Addresses the misalignment in deprecation warnings and hints at the intention to remove support for Testnet3.
  • Adds initial minimum chainwork for Testnet4.
  • Use the MAX_TIMEWARP constant as the timewarp defense delta, equal to MAX_FUTURE_BLOCK_TIME.

This chainwork was observed at height 38487.
@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 7, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK tdb3, Sjors, achow101

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

Concept ACK

@fjahr fjahr changed the title doc, chainparams: 29775 follow-ups doc, chainparams: 29775 release notes and follow-ups Aug 8, 2024
@fjahr fjahr force-pushed the 2024-08-t4-follow-up branch from d9e486a to f7e2ed3 Compare August 8, 2024 20:18
@fjahr
Copy link
Contributor Author

fjahr commented Aug 8, 2024

Removed reference to a specific version in the deprecation warning and addressed @Sjors comment by using the MAX_FUTURE_BLOCK_TIME explicitly as the timewarp defense delta.

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

Approach ACK
The commit message of f2f3d80 can be updated to remove "and mention v30 target"

@fjahr fjahr force-pushed the 2024-08-t4-follow-up branch from f7e2ed3 to 35ad61a Compare August 8, 2024 22:08
@fjahr
Copy link
Contributor Author

fjahr commented Aug 8, 2024

The commit message of f2f3d80 can be updated to remove "and mention v30 target"

Fixed

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

ACK 35ad61a

@@ -4188,7 +4188,7 @@ static bool ContextualCheckBlockHeader(const CBlockHeader& block, BlockValidatio
// Check timestamp for the first block of each difficulty adjustment
// interval, except the genesis block.
if (nHeight % consensusParams.DifficultyAdjustmentInterval() == 0) {
if (block.GetBlockTime() < pindexPrev->GetBlockTime() - 60 * 60 * 2) {
if (block.GetBlockTime() < pindexPrev->GetBlockTime() - MAX_FUTURE_BLOCK_TIME) {
Copy link
Member

@Sjors Sjors Aug 9, 2024

Choose a reason for hiding this comment

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

35ad61a: let's define a separate constant and make it clear these are different but related:

/**
 * Maximum number of seconds that the timestamp of the first
 * block of a difficulty adjustment period is allowed to
 * be earlier than the last block of the previous period (BIP94).
 */
static constexpr int64_t MAX_TIMEWARP{MAX_FUTURE_BLOCK_TIME};

/**
 * If the timestamp of the last block in a difficulty period is set
 * MAX_FUTURE_BLOCK_TIME seconds in the future, an honest miner should
 * be able to mine the first block using the current time. This is not
 * a consensus rule, but changing MAX_TIMEWARP should be done with caution.
 */
static_assert(MAX_FUTURE_BLOCK_TIME <= MAX_TIMEWARP);

(I'm less sure about having the static_assert and its documentation in our codebase)

See ongoing discussion in bitcoin/bips#1658

Copy link
Member

@Sjors Sjors Aug 9, 2024

Choose a reason for hiding this comment

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

And see #30614, but that should probably be its own followup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let's define a separate constant

done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And see #30614, but that should probably be its own followup.

Agree, it seems that we currently have the safer option given we don't really know what other mining software is doing (at least that's my feeling). If we do still get consensus on tightening the limit we can do that in another follow-up in the next two weeks but it shouldn't hold up this PR here.

Copy link
Member

@Sjors Sjors left a comment

Choose a reason for hiding this comment

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

ACK 35ad61a modulo the above comment

@@ -334,7 +334,7 @@ class CTestNet4Params : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].min_activation_height = 0; // No activation delay

consensus.nMinimumChainWork = uint256{};
consensus.nMinimumChainWork = uint256{"000000000000000000000000000000000000000000000056faca98a0cd9bdf5f"};
Copy link
Member

Choose a reason for hiding this comment

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

1163b08: I get the same value

@fjahr fjahr force-pushed the 2024-08-t4-follow-up branch from 35ad61a to 92c1d7d Compare August 9, 2024 12:36
@fjahr
Copy link
Contributor Author

fjahr commented Aug 9, 2024

Addressed @Sjors feedback and introduced a separate constant MAX_TIMEWARP.

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

re ACK 92c1d7d
The new constant adds clarity.

@DrahtBot DrahtBot requested a review from Sjors August 9, 2024 13:52
@Sjors
Copy link
Member

Sjors commented Aug 9, 2024

ACK 92c1d7d

@achow101 achow101 added this to the 28.0 milestone Aug 9, 2024
@achow101
Copy link
Member

achow101 commented Aug 9, 2024

ACK 92c1d7d

@achow101 achow101 merged commit 389cf32 into bitcoin:master Aug 9, 2024
16 checks passed
glozow added a commit that referenced this pull request Aug 15, 2024
99eeb51 [doc] mention bip94 support (glozow)

Pull request description:

  Followup to #29775, noticed while looking at #30604 and #30647. See [release process](https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-every-major-and-minor-release).

ACKs for top commit:
  maflcko:
    ACK 99eeb51
  fjahr:
    ACK 99eeb51
  tdb3:
    ACK 99eeb51

Tree-SHA512: 95838d3ace7e5d7b1a2481f2d7bd82902081713e6e89dbf21e0dad16d1cf5295e0c1cfda1f03af72304a5844743d24769f5fa04d4dc9f02f36462ef0ae82a552
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.

5 participants