Skip to content

Conversation

@glozow
Copy link
Member

@glozow glozow commented Oct 31, 2023

This is part of #27463. It splits off the more trivial changes from #26711 for ease of review, as requested in #26711 (comment).

  • Split package sanitization in policy/packages.h into helper functions
  • Rename CheckPackage to IsPackageWellFormed
  • Improve the CreateValidTransaction unit test utility to:
    • Configure the target feerate and return the fee paid
    • Signal BIP125 on transactions to enable RBF tests
    • Allow the specification of multiple inputs and outputs
  • Move CleanupTemporaryCoins into its own function to be reused later without duplication

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 31, 2023

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 dergoegge, instagibbs

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #26711 (validate package transactions with their in-package ancestor sets by glozow)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@fanquake fanquake requested a review from instagibbs October 31, 2023 09:22
glozow and others added 4 commits November 1, 2023 17:21
This allows IsSorted() and IsConsistent() to be used by themselves.
IsSorted() with a precomputed set is used so that we don't create this
set multiple times.
-BEGIN VERIFY SCRIPT-
sed -i 's/CheckPackage(/IsWellFormedPackage(/g' $(git grep -l CheckPackage)
-END VERIFY SCRIPT-
…, signal BIP125

Support the creation of a transaction with multiple specified inputs or
outputs. Also accept a target feerate and return the fee paid.

Also, signal BIP125 by default - a subsequent commit needs to RBF
something.

Co-authored-by: Andrew Chow <achow101@gmail.com>
Avoid duplicate code. This will be used at the end of every
AcceptSubPackage and after PreChecks loop in AcceptPackage.
@glozow glozow force-pushed the 2023-10-26711-refactors branch from 80cd897 to b5a60ab Compare November 1, 2023 17:26
Copy link
Member Author

@glozow glozow left a comment

Choose a reason for hiding this comment

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

I started going down the path of making Package a class and these member functions, but it touched hundreds of loc and made it really awkward to try to use it within AncestorPackage when we're checking if subsets are sorted

@glozow glozow mentioned this pull request Nov 2, 2023
57 tasks
// This function checks consistency based on inputs, and we can't do that if there are
// no inputs. Duplicate empty transactions are also not consistent with one another.
// This doesn't create false negatives, as unconfirmed transactions are not allowed to
// have no inputs.
Copy link

Choose a reason for hiding this comment

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

“as unconfirmed transactions are not allowed to have no inputs at consensus validation (see CheckTransaction)"

Copy link
Member

@dergoegge dergoegge 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 b5a60ab

nit: the commit message in da9aceb still has the old names

Copy link
Member

@instagibbs instagibbs left a comment

Choose a reason for hiding this comment

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

ACK b5a60ab

@fanquake fanquake merged commit 5d9f450 into bitcoin:master Nov 3, 2023
@glozow glozow deleted the 2023-10-26711-refactors branch November 3, 2023 14:42
@bitcoin bitcoin locked and limited conversation to collaborators Nov 2, 2024
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.

8 participants