Skip to content

Conversation

jnewbery
Copy link
Contributor

This implements two of the suggestions from code reviews of PR 20799:

  • Remove fUseWTXID parameter from CBlockHeaderAndShortTxIDs constructor
  • Remove segwit argument from build_block_on_tip()

@jnewbery
Copy link
Contributor Author

cc @dergoegge @MarcoFalke

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

lgtm

@naumenkogs
Copy link
Member

Concept ACK.
I will give a full ACK once you resolve Marko's suggestions, which I endorse too.

All uses of CBlockHeaderAndShortTxIDs in the product code are
constructed with fUseWTXID=true, so remove the parameter.

There is one use of the CBlockHeaderAndShortTxIDs constructor with
fUseWTXID=false in the unit tests. This is used to construct a
CBlockHeaderAndShortTxIDs for a block with only the coinbase
transaction, so setting fUseWTXID to true or false makes no difference.

Suggested in bitcoin#20799 (review)
jnewbery added a commit to jnewbery/bitcoin that referenced this pull request May 17, 2022
Suggested in
bitcoin#25147 (comment)

May make IBD minimally faster by avoiding the construction of
CBlockHeaderAndShortTxIDs objects where unnecessary.
@jnewbery jnewbery force-pushed the 20205_20799_follow_ups branch from 3ab9f69 to 97e4a5d Compare May 17, 2022 09:44
@jnewbery
Copy link
Contributor Author

Thanks for the review @MarcoFalke and @naumenkogs. I've addressed all your comments.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

still lgtm

jnewbery added a commit to jnewbery/bitcoin that referenced this pull request May 17, 2022
Suggested in
bitcoin#25147 (comment)

May make IBD minimally faster by avoiding the construction of
CBlockHeaderAndShortTxIDs objects where unnecessary.
@jnewbery jnewbery force-pushed the 20205_20799_follow_ups branch from 97e4a5d to 8184dcb Compare May 17, 2022 09:58
@naumenkogs
Copy link
Member

ACK 8184dcb

@fanquake fanquake requested a review from dergoegge May 18, 2022 08:36
The only place that segwit=True is for a block that contains only the
coinbase transaction. Since the witness commitment is optional if none
of the transactions have a witness, we can leave it out. This doesn't
change the test coverage, which is testing p2p compact block logic.

Suggested in bitcoin#20799 (comment)
@jnewbery jnewbery force-pushed the 20205_20799_follow_ups branch from 8184dcb to bf6526f Compare May 18, 2022 12:48
@dergoegge
Copy link
Member

Code review ACK bf6526f

@fanquake fanquake requested a review from naumenkogs May 18, 2022 14:42
@naumenkogs
Copy link
Member

ACK bf6526f

@fanquake fanquake merged commit fdb82a3 into bitcoin:master May 19, 2022
@jnewbery jnewbery deleted the 20205_20799_follow_ups branch May 19, 2022 09:48
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 28, 2022
@bitcoin bitcoin locked and limited conversation to collaborators May 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants