Skip to content
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

backport: merge bitcoin#19940, #19498, #19339, #19753, #20581, #20834, #21062, #21783, #21121, #22084, partial bitcoin#19668, #20833 (mempool backports) #5834

Merged
merged 12 commits into from
Feb 3, 2024

Conversation

kwvg
Copy link
Collaborator

@kwvg kwvg commented Jan 18, 2024

@kwvg kwvg force-pushed the atmp_pkg branch 2 times, most recently from b7c5c98 to 7fc608f Compare January 18, 2024 20:26
@kwvg kwvg force-pushed the atmp_pkg branch 2 times, most recently from c7894f6 to 110e975 Compare January 25, 2024 07:21
@kwvg kwvg changed the title backport: merge bitcoin#19940, #19339, #20581, #20834, #21062, #21783, #21121, #22084, partial bitcoin#19668, #20833 (mempool backports) backport: merge bitcoin#19940, #19498, #19339, #19753, #20581, #20834, #21062, #21783, #21121, #22084, partial bitcoin#19668, #20833 (mempool backports) Jan 25, 2024
@@ -1072,6 +1072,11 @@ static UniValue testmempoolaccept(const JSONRPCRequest& request)
{
{RPCResult::Type::STR_HEX, "txid", "The transaction hash in hex"},
{RPCResult::Type::BOOL, "allowed", "If the mempool allows this tx to be inserted"},
{RPCResult::Type::NUM, "vsize", "Virtual transaction size as defined in BIP 141"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we just drop vsize from output because that's equal to regular size of tx in 100% cases?
That has meaning only for case of segregated tx when 'real' and 'virtual' size of tx are different

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've dropped the "as defined in BIP 141" portion of the description but have retained vsize as getrawmempool already prints out vsize and a bunch of functional tests already refer to it like mempool_updatefromblock and mining_prioritisetransaction.

It's practically just an alias to size at this point but as long as somewhere something tries to fetch vsize, it's better there than not. Though on the other hand some RPCs might have already purged vsize since I don't see them outside of the examples I've mentioned so maybe there's merit to removing them.

Regardless, it'd have to be done in a distinct commit since we'd have to regularize other vsize usage.

Copy link

This pull request has conflicts, please rebase.

@kwvg kwvg marked this pull request as ready for review January 29, 2024 18:52
test/functional/test_framework/messages.py Outdated Show resolved Hide resolved
src/validation.h Show resolved Hide resolved
src/net_processing.cpp Show resolved Hide resolved
@@ -35,7 +35,8 @@ struct MinerTestingSetup : public TestingSetup {
void TestPackageSelection(const CChainParams& chainparams, const CScript& scriptPubKey, const std::vector<CTransactionRef>& txFirst) EXCLUSIVE_LOCKS_REQUIRED(::cs_main, m_node.mempool->cs);
bool TestSequenceLocks(const CTransaction& tx, int flags) EXCLUSIVE_LOCKS_REQUIRED(::cs_main, m_node.mempool->cs)
{
return CheckSequenceLocks(::ChainstateActive(), *m_node.mempool, tx, flags);
CCoinsViewMemPool viewMempool(&m_node.chainman->ActiveChainstate().CoinsTip(), *m_node.mempool);
Copy link
Collaborator

Choose a reason for hiding this comment

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

20833 - missing changes in src/test/fuzz/tx_pool.cpp

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

bitcoin#20833 has been listed as a partial and the commit description explicitly states the exclusion of c9e1a26, which would be completed in dash#5835 after the PR that introduces tx_pool (bitcoin#21142, backported as 6823ba3) has been backported. The completed bitcoin#20833 can be seen in 12c534e as part of dash#5835.

UdjinM6
UdjinM6 previously approved these changes Jan 30, 2024
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

LGTM, utACK

src/coinjoin/coinjoin.cpp Outdated Show resolved Hide resolved
@@ -306,6 +306,25 @@ bool CCoinJoinBaseSession::IsValidInOuts(const CTxMemPool& mempool, const std::v
return true;
}

// Responsibility for checking fee sanity is moved from the mempool to the client (BroadcastTransaction)
// but CoinJoin still requires ATMP with fee sanity checks so we need to implement them separately
Copy link
Collaborator

Choose a reason for hiding this comment

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

why we can't drop it?

Copy link
Collaborator Author

@kwvg kwvg Feb 1, 2024

Choose a reason for hiding this comment

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

CoinJoin code expects that ATMP will check fee sanity because unlike every other non-RPC/non-GUI AcceptToMemoryPool call which uses an nAbsurdFee value of 0 (to skip absurd fee checking), CoinJoin code in a few places uses DEFAULT_MAX_RAW_TX_FEE (not to be confused with DEFAULT_MAX_RAW_TX_FEE_RATE, which has the same value, except as CFeeRate as opposed to CAmount) as nAbsurdFee, triggering the fee check.

Perhaps it could be refactored to be removed entirely but that's outside the scope of the PR and the backport attempts to preserve functionality as-is on the CoinJoin front.

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

re-utACK

Copy link
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

utACK

@UdjinM6 UdjinM6 added this to the 20.1 milestone Feb 1, 2024
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK for merging via merge commit

@PastaPastaPasta PastaPastaPasta merged commit 544b003 into dashpay:develop Feb 3, 2024
4 of 5 checks passed
PastaPastaPasta pushed a commit that referenced this pull request Feb 9, 2024
…hify help text, undashify code comments (#5852)

## Issue being fixed or feature implemented
This pull request is a follow-up to
[some](#5834 (comment))
[feedback](#5834 (comment))
received on [dash#5834](#5834) as
the patterns highlighted were present in different parts of the codebase
and hence not corrected within the PR itself but addressed separately.

This is that separate PR 🙂 (with some additional cleanup of my own)

## What was done?
* This pull request will remain a draft until
[dash#5834](#5834) as it will
introduce more changes that will need to be corrected in this PR.
* Code introduced that is unique to Dash Core (CoinJoin, InstantSend,
etc.) has been excluded from un-Dashification as the purpose of it is to
reduce backport conflicts, which don't apply in those cases.
* `CWallet::CreateTransaction` and the `CreateTransactionTest` fixture
have been excluded as the former originates from
[dash#3668](#3668) and the latter
from [dash#3667](#3667) and are
distinct enough to be unique to Dash Core.
* There are certain Dashifications and SegWit-removals that prove
frustrating as it would break compatibility with programs that rely on
the naming of certain keys
* `getrawmempool`, `getmempoolancestors`, `getmempooldescendants` and
`getmempoolentry` return `vsize` which is currently an alias of `size`.
I have been advised to retain `vsize` in lieu of potential future
developments. (this was originally remedied in
219a1d0 but has since been dropped)
* `getaddressmempool`, `getaddressutxos` and `getaddressdeltas` all
return a value with the key `satoshis`. This is frustrating to rename to
`duffs` for compatibility reasons.
* `decodepsbt` returns (if applicable) `non_witness_utxo` which is
frustrating to rename simply to `utxo` for the same reason.
* `analyzepsbt` returns (if applicable) `estimated_vsize` which
frustrating to rename to `estimated_size` for the same reason.

## How Has This Been Tested?

## Breaking Changes
None

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
@thephez thephez added the RPC Some notable changes to RPC params/behaviour/descriptions label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RPC Some notable changes to RPC params/behaviour/descriptions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants