8000 validation: followups for de-duplication of packages by glozow · Pull Request #23804 · bitcoin/bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

validation: followups for de-duplication of packages #23804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 25, 2022

Conversation

glozow
Copy link
Member
@glozow glozow commented Dec 17, 2021

This addresses some comments from review on e12fafd from #22674.

  • Improve documentation about de-duplication: comment
  • Fix code looking up same-txid-different-witness transaction in mempool: comment
  • Improve the interface for when a same-txid-different-witness transaction is swapped: comment
  • Add a test for witness swapping: comment
  • Add a test for packages with a mix of duplicate/different witness/new parents: comment
  • Fix issue with not notifying CValidationInterface when there's a partial submission due to fail-fast: comment

Copy link
Contributor
@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

Tiny nit about the test, but LGTM.
ACK fcc2f91

@achow101
Copy link
Member

ACK fcc2f91

@fanquake fanquake requested a review from ariard December 18, 2021 02:26
Copy link
@ariard ariard left a comment

Choose a reason for hiding this comment

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

ACK fcc2f91

Thanks for taking the comments from #22674!

Copy link
Contributor
@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

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

I've left a few minor comments here, but there are a couple of more substantial comments in the original PR here: #22674 (review).

@glozow glozow force-pushed the 2021-12-dedup-packages branch from fcc2f91 to 0300cb1 Compare January 7, 2022 17:29
@glozow
Copy link
Member Author
glozow commented Jan 7, 2022

Addressed comments and added the fixups from @jnewbery's review on #22674 - most have no behavior changes so they're grouped in 1 commit. Another commit fixes the issue where we're not notifying MainSignals when there's a partial submission.

Copy link
Contributor
@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

ACK 0300cb1

The previous interface required callers to guess that the tx had been
swapped and look up the tx again by txid to find a `MEMPOOL_ENTRY`
result. This is a confusing interface.

Instead, explicitly tell the caller that this transaction was
`DIFFERENT_WITNESS` in the result linked to the mempool entry's wtxid.
This gives the caller all the information they need in 1 lookup, and
they can query the mempool for the other transaction if needed.
If/when witness replacement is implemented in the future, this test case
can be easily replaced with witness replacement tests.
No behavior changes, just clarifications.
Behavior change: don't quit right after LimitMempoolSize() when a
package is partially submitted. We should still send
TransactionAddedToMempool notifications for
transactions that were submitted.

Not behavior change: add a new package validation result for mempool logic errors.
@glozow glozow force-pushed the 2021-12-dedup-packages branch from 0300cb1 to fa5aafc Compare January 17, 2022 12:39
@glozow
Copy link
Member Author
glozow commented Jan 17, 2022

Added more tests for funsies, the rest of the diff is just changing comments.

@ariard @achow101 @jnewbery @instagibbs @t-bast if you have time to take another look? Would be nice to add these fixups with #22674 before v23

@achow101
Copy link
Member

ACK 3cd7f69

Copy link
Contributor
@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

LGTM, ACK 3cd7f69

@fanquake fanquake added this to the 23.0 milestone Jan 18, 2022
@fanquake fanquake requested a review from instagibbs January 18, 2022 04:53
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 3cd7f69

@fanquake fanquake requested a review from darosior January 20, 2022 04:01
@glozow glozow requested a review from ariard January 21, 2022 12:10
Copy link
@ariard ariard left a comment

Choose a reason for hiding this comment

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

ACK 3cd7f69

Substantial changes since my last ACK are new commits adding clarifications, improving the errors handling and extending the unit test.

@@ -1088,7 +1096,6 @@ bool MemPoolAccept::SubmitPackage(const ATMPArgs& args, std::vector<Workspace>&
LimitMempoolSize(m_pool, m_active_chainstate.CoinsTip(),
gArgs.GetIntArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000,
std::chrono::hours{gArgs.GetIntArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY)});
if (!all_submitted) return false;
Copy link

Choose a reason for hiding this comment

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

Well technically if this code change now trigger a TransactionAddedToMempool(), I think we're changing the views of our CMainSignals consumers and that would constitute a behavior change. That said, if I'm correct, I don't think it's worthy to invalidate ACKs just to update commit description.

@fanquake fanquake merged commit 417e750 into bitcoin:master Jan 25, 2022
@glozow glozow deleted the 2021-12-dedup-packages branch January 25, 2022 14:41
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 28, 2022
…ages

3cd7f69 [unit test] package parents are a mix (glozow)
de075a9 [validation] better handle errors in SubmitPackage (glozow)
9d88853 AcceptPackage fixups (glozow)
2db77cd [unit test] different witness in package submission (glozow)
9ad211c [doc] more detailed explanation for deduplication (glozow)
83d4fb7 [packages] return DIFFERENT_WITNESS for same-txid-different-witness tx (glozow)

Pull request description:

  This addresses some comments from review on e12fafd from bitcoin#22674.

  - Improve documentation about de-duplication: [comment](https://github.com/bitcoin/bitcoin/pull/22674/files#r770156708)
  - Fix code looking up same-txid-different-witness transaction in mempool: [comment](https://github.com/bitcoin/bitcoin/pull/22674/files#r770804029)
  - Improve the interface for when a same-txid-different-witness transaction is swapped: [comment](https://github.com/bitcoin/bitcoin/pull/22674/files#r770782822)
  - Add a test for witness swapping: [comment](https://github.com/bitcoin/bitcoin/pull/22674/files#r770804029)
  - Add a test for packages with a mix of duplicate/different witness/new parents: [comment](bitcoin#22674 (comment))
  - Fix issue with not notifying `CValidationInterface` when there's a partial submission due to fail-fast: [comment](bitcoin#22674 (comment))

ACKs for top commit:
  achow101:
    ACK 3cd7f69
  t-bast:
    LGTM, ACK bitcoin@3cd7f69
  instagibbs:
    ACK 3cd7f69
  ariard:
    ACK 3cd7f69

Tree-SHA512: a5d86ca86edab80a5a05fcbb828901c058b3f2fa2552912ea52f2871e29c3cf4cc34020e7aac2217959c9c3a01856f4bd3d631d844635b98144f212f76c2f3ef
@ClaraBara22
Copy link

Can I comment?

Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Dec 19, 2022
Summary:
This is a partial backport of [[bitcoin/bitcoin#23804 | core#23804]]
bitcoin/bitcoin@9ad211c

Test Plan: read comment

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D12911
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Dec 19, 2022
Summary:
No behavior changes, just clarifications.

This is a partial backport of [[bitcoin/bitcoin#23804 | core#23804]]
bitcoin/bitcoin@9d88853

Depends on D12911

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D12912
@bitcoin bitcoin locked and limited conversation to collaborators Mar 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging this pull request may close these issues.

9 participants
0