validation: return more helpful results for reconsiderable fee failures and skipped transactions
Summary:
- Add 2 new TxValidationResults - TX_RECONSIDERABLE helps us encode transactions who have failed fee checks that can be bypassed using package validation. This is distinguished from TX_MEMPOOL_POLICY so that we re-validate a transaction if and only if it is eligible for package CPFP. In the future, we will have a separate cache for reconsiderable rejects so these transactions don't go in m_recent_rejects. - TX_UNKNOWN helps us communicate that we aborted package validation and didn't finish looking at this transaction: it's not valid but it's also not invalid (i.e. don't cache it as a rejected tx) - Return effective feerate and the wtxids of transactions used to calculate that effective feerate when the error is TX_SINGLE_FAILURE. Previously, we would only provide this information if the transaction passed. Now that we have package validation, it's much more helpful to the caller to know how the failing feerate was calculated. This can also be used to improve our submitpackage RPC result (which is currently a bit unhelpful when things fail). - Use the newly added CheckPackageMempoolAcceptResult for existing package validation tests. This increases test coverage and helps test the changes made in this PR.
Backport of core#28785, core#28764 and core#28788 (last too are only the test function).
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, roqqit
Reviewed By: roqqit
Differential Revision: https://reviews.bitcoinabc.org/D16439