test: clarify timewarp grace period griefing attack #31725

pull Sjors wants to merge 1 commits into bitcoin:master from Sjors:2025/01/timewarp-grief changing 1 files +44 −14
  1. Sjors commented at 3:07 pm on January 23, 2025: member

    Adjust the timewarp test to better illustrate the griefing attack discussed here: https://delvingbitcoin.org/t/timewarp-attack-600-second-grace-period/1326/19

    Changing MAX_TIMEWARP to something > MAX_FUTURE_BLOCK_TIME in consensus.h and mining_basic.py will cause the updated test to fail. I’m not proposing such a change here of course. The new test should be useful guidance for pool software developers, for why they really should use curtime, or least not ignore mintime.

    Additionally, if the proposal is changed to make MAX_TIMEWARP > MAX_FUTURE_BLOCK_TIME then this test will break, which could be used to demonstrate there’s no such griefing attack anymore.

    Originally part of #31600.

  2. DrahtBot commented at 3:07 pm on January 23, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31725.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    No conflicts as of last run.

  3. DrahtBot added the label Tests on Jan 23, 2025
  4. DrahtBot added the label CI failed on Jan 26, 2025
  5. DrahtBot removed the label CI failed on Jan 26, 2025
  6. DrahtBot added the label Needs rebase on Jan 31, 2025
  7. test: clarify timewarp griefing attack
    On testnet4 with the timewarp mitigation active, when pool software
    ignores the curtime and mintime fields provided by the getblocktemplate
    RPC or by createNewBlock() in the Mining interface, they are vulnerable
    to a griefing attack.
    
    The test is expanded to illustrate this.
    6065b78e22
  8. Sjors force-pushed on Feb 1, 2025
  9. Sjors commented at 9:07 am on February 1, 2025: member
    #31600 landed, ready for review
  10. Sjors marked this as ready for review on Feb 1, 2025
  11. DrahtBot removed the label Needs rebase on Feb 4, 2025


Sjors DrahtBot

Labels
Tests


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-02-07 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me