Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Jun 18, 2021

The coinbase scriptSig in this unit test has several issues:

While BIP34 isn't currently enforced in this unit test, this should be fixed to avoid confusion and to promote self-consistency.

The change obviously requires new proof of work (BLOCKINFO).

Also change the block version from 1 to VERSIONBITS_TOP_BITS, because this test shouldn't care about the block version and bumping it is required for other changes.

@DrahtBot DrahtBot added the Tests label Jun 18, 2021
@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 18, 2021

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

Conflicts

No conflicts as of last run.

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

Code review ACK faa670d

Checked that the block's coinbase scriptSig assignment matches now the BIP34 specification, verified upated proof of work (BLOCKINFO) by running the test.
(By the way, being curious, how did you re-create it? I guess putting some grinding code directly into the loop? Could be interesting if ever other contributors want to change the test in a way that needs new PoW)

@maflcko
Copy link
Member Author

maflcko commented Jul 9, 2021

By the way, being curious, how did you re-create it? I guess putting some grinding code directly into the loop?

Jup, IIRC I just ground in the loop and used std::cout or something similar to create the new table.

@maflcko maflcko merged commit 7d60f7e into bitcoin:master Aug 5, 2021
@maflcko maflcko deleted the 2106-test34 branch August 5, 2021 07:51
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Aug 5, 2021
…k_validity unit test

faa670d test: Properly set BIP34 height in CreateNewBlock_validity unit test (MarcoFalke)

Pull request description:

  The coinbase scriptSig in this unit test has several issues:

  * The BIP34 height is not the "first item" as required (See https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki#specification)
  * It uses the wrong encoding ( See https://github.com/bitcoin/bitcoin/blob/da69d9965a112c6421fce5649b5a18beb7513526/src/validation.cpp#L3250 )
  * It uses the wrong height (off by one)

  While BIP34 isn't currently enforced in this unit test, this should be fixed to avoid confusion and to promote self-consistency.

  The change obviously requires new proof of work (`BLOCKINFO`).

  Also change the block version from `1` to `VERSIONBITS_TOP_BITS`, because this test shouldn't care about the block version and bumping it is required for other changes.

ACKs for top commit:
  theStack:
    Code review ACK faa670d

Tree-SHA512: 8dbe2d5300a640f3e1817ff048906e60463aca64ba50fec8ee4f18fb1c70e511008755b0b5baba81114a1a6265fdfae9a4b7ae8acadfb2c7ad43223157a0386c
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants