You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge bitcoin/bitcoin#26646: validation, bugfix: provide more info in *MempoolAcceptResult
264f9ef [validation] return MempoolAcceptResult for every tx on PCKG_TX failure (glozow)
dae81e0 [refactor] rename variables in AcceptPackage for clarity (glozow)
da484bc [doc] release note effective-feerate and effective-includes RPC results (glozow)
5eab397 [validation] remove PackageMempoolAcceptResult::m_package_feerate (glozow)
601bac8 [rpc] return effective-includes in testmempoolaccept and submitpackage (glozow)
1691eaa [rpc] return effective-feerate in testmempoolaccept and submitpackage (glozow)
d6c7b78 [validation] return wtxids of other transactions whose fees were used (glozow)
1605886 [validation] return effective feerate from mempool validation (glozow)
5d35b4a [test] package validation quits early due to non-policy, non-missing-inputs failure (glozow)
be2e4d9 [validation] when quitting early in AcceptPackage, set package_state and tx result (glozow)
Pull request description:
This PR fixes a bug and improves the mempool accept interface to return information more predictably.
Bug: In package validation, we first try the transactions individually (see doc/policy/packages.md for more explanation) and, if they all failed for missing inputs and policy-related (i.e. fee) reasons, we'll try package validation. Otherwise, we'll just "quit early" since, for example, if a transaction had an invalid signature, adding a child will not help make it valid. Currently, when we quit early, we're not setting the `package_state` to be invalid, so the caller might think it succeeded. Also, we're returning no results - it makes more sense to return the individual transaction failure. Thanks instagibbs for catching bitcoin/bitcoin#25038 (comment)!
Also, make the package results interface generally more useful/predictable:
- Always return the feerate at which a transaction was considered for `CheckFeeRate` in `MempoolAcceptResult::m_effective_feerate` when it was successful. This can replace the current `PackageMempoolAcceptResult::m_package_feerate`, which only sometimes exists.
- Always provide an entry for every transaction in `PackageMempoolAcceptResult::m_tx_results` when the error is `PCKG_TX`.
ACKs for top commit:
instagibbs:
reACK bitcoin/bitcoin@264f9ef
achow101:
ACK 264f9ef
naumenkogs:
reACK 264f9ef
Tree-SHA512: ce7fd9927a80030317cc6157822596e85a540feff5dbf5eea7c62da2eb50c917cdddc9da1e2ff62cc18b98b27d360151811546bd9d498859679a04bbee090837
{RPCResult::Type::OBJ, "fees", /*optional=*/true, "Transaction fees (only present if 'allowed' is true)",
127
127
{
128
128
{RPCResult::Type::STR_AMOUNT, "base", "transaction fee in " + CURRENCY_UNIT},
129
+
{RPCResult::Type::STR_AMOUNT, "effective-feerate", /*optional=*/false, "the effective feerate in " + CURRENCY_UNIT + " per KvB. May differ from the base feerate if, for example, there are modified fees from prioritisetransaction or a package feerate was used."},
130
+
{RPCResult::Type::ARR, "effective-includes", /*optional=*/false, "transactions whose fees and vsizes are included in effective-feerate.",
131
+
{RPCResult{RPCResult::Type::STR_HEX, "", "transaction wtxid in hex"},
132
+
}},
129
133
}},
130
134
{RPCResult::Type::STR, "reject-reason", /*optional=*/true, "Rejection string (only present when 'allowed' is false)"},
{RPCResult::Type::STR_AMOUNT, "base", "transaction fee in " + CURRENCY_UNIT},
781
+
{RPCResult::Type::STR_AMOUNT, "effective-feerate", /*optional=*/true, "if the transaction was not already in the mempool, the effective feerate in " + CURRENCY_UNIT + " per KvB. For example, the package feerate and/or feerate with modified fees from prioritisetransaction."},
782
+
{RPCResult::Type::ARR, "effective-includes", /*optional=*/true, "if effective-feerate is provided, the wtxids of the transactions whose fees and vsizes are included in effective-feerate.",
783
+
{{RPCResult::Type::STR_HEX, "", "transaction wtxid in hex"},
784
+
}},
771
785
}},
772
786
}}
773
787
}},
774
-
{RPCResult::Type::STR_AMOUNT, "package-feerate", /*optional=*/true, "package feerate used for feerate checks in " + CURRENCY_UNIT + " per KvB. Excludes transactions which were deduplicated or accepted individually."},
775
788
{RPCResult::Type::ARR, "replaced-transactions", /*optional=*/true, "List of txids of replaced transactions",
776
789
{
777
790
{RPCResult::Type::STR_HEX, "", "The transaction id"},
0 commit comments