OP_CHECKBLOCKATHEIGHT anti-replay (BIP 115; logic only) #10391

pull luke-jr wants to merge 5 commits into bitcoin:master from luke-jr:cbah changing 21 files +210 −77
  1. luke-jr commented at 4:15 AM on May 12, 2017: member

    No description provided.

  2. script: Allow interpreter to fail with SCRIPT_ERR_NOT_FINAL to indicate a context-dependent/non-final status b779f5a12a
  3. policy: Split STANDARD_SCRIPT_VERIFY_FLAGS between contextual and non-contextual 7aabfd8111
  4. Pass CChain through to signature checker in contextual verifications 04b0a00c72
  5. script: Implement OP_CHECKBLOCKATHEIGHT c1bf3d75ed
  6. CHistoricalChain to fix context in CVerifyDB 316d727dda
  7. dcousens commented at 4:22 AM on May 12, 2017: contributor
  8. in src/script/interpreter.cpp:443 in 316d727dda
     439 | +                    if (stack.size() < 2) {
     440 | +                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
     441 | +                    }
     442 | +
     443 | +                    // nHeight is a 32-bit signed integer field.
     444 | +                    const int32_t nHeight = CScriptNum(stacktop(-1), true, 4).getint();
    


    WaveringAna commented at 2:39 AM on July 10, 2017:

    Can this cause a buffer overflow if a block height over 2147483647 occurs?


    luke-jr commented at 3:29 AM on July 10, 2017:

    No? Why would it?


    WaveringAna commented at 3:41 AM on July 10, 2017:

    nHeight is a int32_t, if someone makes a transaction with 2147483648 as the referenced block, it would cause an overflow


    luke-jr commented at 4:25 AM on July 10, 2017:

    Not all overflows are buffer overflows. In this case, CScriptNum explicitly limits the size.

  9. luke-jr commented at 7:05 PM on November 16, 2017: member

    The BIP needs revising for static analysis compat.

  10. luke-jr closed this on Nov 16, 2017

  11. DrahtBot locked this on Sep 8, 2021

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: 2026-04-14 15:15 UTC

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