Commit graph

39678 commits

Author SHA1 Message Date
MarcoFalke
fae76a1f2a
scripted-diff: Use DataStream in most places
The remaining places are handled easier outside a scripted-diff.

-BEGIN VERIFY SCRIPT-
 sed --regexp-extended -i 's/CDataStream ([0-9a-zA-Z_]+)\(SER_[A-Z]+, [A-Z_]+_VERSION\);/DataStream \1{};/g' $( git grep -l CDataStream)
 sed -i 's/, CDataStream/, DataStream/g' src/wallet/walletdb.cpp
-END VERIFY SCRIPT-
2023-11-28 12:42:37 +01:00
MarcoFalke
fac39b56b7
refactor: SpanReader without nVersion
The field is unused, so remove it.

This is also required for future commits.
2023-11-28 12:42:07 +01:00
fanquake
c252a0fc0f
Merge bitcoin/bitcoin#28892: refactor: P2P transport without serialize version and type
fa79a881ce refactor: P2P transport without serialize version and type (MarcoFalke)
fa9b5f4fe3 refactor: NetMsg::Make() without nVersion (MarcoFalke)
66669da4a5 Remove unused Make() overload in netmessagemaker.h (MarcoFalke)
fa0ed07941 refactor: VectorWriter without nVersion (MarcoFalke)

Pull request description:

  Now that the serialize framework ignores the serialize version and serialize type, everything related to it can be removed from the code.

  This is the first step, removing dead code from the P2P stack. A different pull will remove it from the wallet and other parts.

ACKs for top commit:
  ajtowns:
    reACK fa79a881ce

Tree-SHA512: 785b413580d980f51f0d4f70ea5e0a99ce14cd12cb065393de2f5254891be94a14f4266110c8b87bd2dbc37467676655bce13bdb295ab139749fcd8b61bd5110
2023-11-28 11:24:09 +00:00
fanquake
dc369af3f5
Merge bitcoin/bitcoin#28936: Change petertodd seeds to petertodd.net
ecb46837e7 Change petertodd seeds to petertodd.net (Peter Todd)

Pull request description:

  I changed my DNS seeds to .net from .org to avoid issues with DNS blacklisting, that falsely thinks my domain name is pointing to IP addresses with malware and similar things. Right now there are CNAME records, so the .org addresses still work. But eventually, if needed, I'll remove those CNAME's.

ACKs for top commit:
  pablomartin4btc:
    tACK ecb46837e7
  fanquake:
    ACK ecb46837e7 - tested that usable addresses are being returned.

Tree-SHA512: 285f7101198ea8e2e20900c17b38aa86db812308c6985d762e5fa8b6f1bc5b0d2d278da841fe2e10cf32e3fe18d4c984bc8cf195bd8d40c86b092b545c62acfa
2023-11-28 10:53:27 +00:00
fanquake
c1b7332441
Merge bitcoin/bitcoin#28934: ci: Set MSVC toolset version explicitly
70100f8584 Revert "ci: Avoid toolset ambiguity that MSVC can't handle" (Hennadii Stepanov)
1a889f7ea0 ci: Set MSVC toolset version explicitly (Hennadii Stepanov)
4335e55359 ci: Run vcpkg with path prefix (Hennadii Stepanov)

Pull request description:

  This PR is an alternative to https://github.com/bitcoin/bitcoin/pull/28905 and reverts it.

  To avoid toolset version incompatibilities, which result in errors like this:
  ```
  LINK : fatal error C1900: Il mismatch between 'P1' version '20230904' and 'P2' version '20221215' [D:\a\bitcoin\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  LINK : fatal error LNK1257: code generation failed [D:\a\bitcoin\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  LINK : fatal error LNK1327: failure during running link.exe [D:\a\bitcoin\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  ```

  it is enough to set it explicitly in the vcpkg triplet file (see the second commit). The `VCToolsVersion` environment variable is set by the `ilammy/msvc-dev-cmd` action.

  Please note that the https://github.com/bitcoin/bitcoin/pull/28905 is not [optimal](https://github.com/bitcoin/bitcoin/pull/28905#issuecomment-1822571419):
  > I guess this is something we'll just have to maintain forever? That's a shame, because it also adds ~30% runtime to this CI job.

ACKs for top commit:
  sipsorcery:
    utACK 70100f8584.
  pablomartin4btc:
    ACK 70100f8584 since I've reviewed to be reverted #28905.

Tree-SHA512: 121a8e40c728060526f380b7946211b5d4eca8821bfe62e6451642ffdf95fe9ab7101e0cffa7f4a777bc9cf94278bb50c1b40b71768e1ac39801bb4831afeb90
2023-11-28 10:51:46 +00:00
MarcoFalke
fa825975b5
fuzz: Avoid timeout in process_messages 2023-11-28 09:58:10 +01:00
Sebastian Falbesoner
e67634ef19 fuzz: BIP324: damage ciphertext/aad in full byte range
Currently the damaging of input data for decryption (either ciphertext
or aad) only ever happens in the lower nibble within the byte at the
damage position, as the bit position for the `damage_val` byte was
calculated with `damage_bit & 3` (corresponding to `% 4`) rather than
`damage_bit & 7` (corresponding to the expected `% 8`).
2023-11-28 02:30:09 +01:00
fanquake
794f971607
Merge bitcoin/bitcoin#28933: fuzz: Faster wallet_notifications target
fa15861763 fuzz: Faster wallet_notifications target (MarcoFalke)
fa971c09f2 Export assert from util/check.h (MarcoFalke)

Pull request description:

  Avoid read/write from storage to speed the target up.

ACKs for top commit:
  dergoegge:
    reACK fa15861763
  brunoerg:
    reACK fa15861763

Tree-SHA512: 90aa856ae31db27a55ef0dfa2cb303d98e6c4d530d2937ad8d808c5f4048389b7ed3c78c27df92db8fe29531b5530aecbb06a0e8274dda424149f46cd6c19f98
2023-11-27 17:35:45 +00:00
MarcoFalke
fa15861763
fuzz: Faster wallet_notifications target 2023-11-27 12:06:06 +01:00
fanquake
5f9fd11680
Merge bitcoin/bitcoin#28931: fuzz: Limit fuzz buffer size in script_flags target
faf1fb207f Fix IWYU for the script_flags fuzz target (MarcoFalke)
fa71285b73 fuzz: Limit fuzz buffer size in script_flags target (MarcoFalke)
fa6b87b9ee fuzz: CDataStream -> DataStream in script_flags (MarcoFalke)

Pull request description:

  Most fuzz targets have an upper limit on the buffer size to avoid excessive runtime. Do the same for `script_flags` to avoid timeouts such as https://github.com/bitcoin/bitcoin/issues/28812#issuecomment-1824696971

  Also, fix iwyu. Also, remove legacy `CDataStream`.

ACKs for top commit:
  dergoegge:
    ACK faf1fb207f
  brunoerg:
    utACK faf1fb207f

Tree-SHA512: 9301917b353f7409e448b6fd3635de19330856e0742431db5ef04e62873501b5b4cd6cb78ad81ada2747fa2bdae033115b5951d10489dd5d0d320426c8b96bee
2023-11-26 12:22:50 +00:00
Hennadii Stepanov
6d05c4fd13
msvc: Specify boost-date-time package explicitly
Compilation now succeeds only by coincidence, as the `boost-date-time`
package is installed as a dependency of the `boost-process` one.
2023-11-25 18:27:50 +00:00
Hennadii Stepanov
1f97e51d73
msvc: Update vcpkg manifest baseline up to "2023.08.09 Release"
Dependency changes (2023.01.09 --> 2023.08.09):
- berkeleydb: 4.8.30#8 --> 4.8.30#9
- boost: 1.81.0 --> 1.82.0#2
- sqlite3: 3.40.0#1 --> 3.42.0#1
- zeromq: 4.3.4#6 --> 2023-06-20#1
2023-11-25 18:27:40 +00:00
Hennadii Stepanov
2d2ef2f14f
msvc: No need to specify the default feature for libevent package 2023-11-25 18:27:33 +00:00
Peter Todd
ecb46837e7
Change petertodd seeds to petertodd.net
I changed my DNS seeds to .net from .org to avoid issues with DNS blacklisting,
that falsely thinks my domain name is pointing to IP addresses with malware and
similar things. Right now there are CNAME records, so the .org addresses still
work. But eventually, if needed, I'll remove those CNAME's.
2023-11-25 13:59:41 +00:00
Hennadii Stepanov
70100f8584
Revert "ci: Avoid toolset ambiguity that MSVC can't handle"
This reverts commit 91d5bd8ac9.
2023-11-24 15:47:49 +00:00
Hennadii Stepanov
1a889f7ea0
ci: Set MSVC toolset version explicitly
This change avoids toolset incompatibilities that cause linker errors.
2023-11-24 15:47:28 +00:00
Hennadii Stepanov
4335e55359
ci: Run vcpkg with path prefix
The GHA VS installation includes its own vcpkg package manager, which is
available since VS 17.6. This change avoids any ambiguity about which
copy of vcpkg we run.
2023-11-24 15:40:46 +00:00
fanquake
b5a271334c
Merge bitcoin/bitcoin#28922: Use Txid in COutpoint
9e58c5bcd9 Use Txid in COutpoint (dergoegge)

Pull request description:

  This PR changes the type of the hash of a transaction outpoint from `uint256` to `Txid`.

ACKs for top commit:
  Sjors:
    ACK 9e58c5bcd9
  stickies-v:
    ACK 9e58c5bcd9. A sizeable diff, but very straightforward changes. Didn't see anything controversial. Left a few nits, but nothing blocking, only if you have to retouch.
  TheCharlatan:
    ACK 9e58c5bcd9

Tree-SHA512: 58f61ce1c58668f689513e62072a7775419c4d5af8f607669cd8cdc2e7be9645ba14af7f9e2d65da2670da3ec1ce7fc2a744037520caf799aba212fd1ac44b34
2023-11-24 14:41:58 +00:00
fanquake
c0196bec98
Merge bitcoin/bitcoin#28932: ci: remove python3-setuptools from macOS build deps
0ffcc5b680 ci: remove python3-setuptools from mac build deps (fanquake)

Pull request description:

  Remove no-longer used python-setuptools.
  Followup to #28432.
  Related to #28845.

ACKs for top commit:
  hebasto:
    ACK 0ffcc5b680, I have reviewed the code and it looks OK.
  TheCharlatan:
    ACK 0ffcc5b680

Tree-SHA512: c3ac441c85f6f203414e5e2ad0c453ee35fa4765c72c5ff79699aa622c0db767651890ac0c8507f5ed18e18e3b0e23f2952f677476424cfda4df93647a367c26
2023-11-24 13:38:52 +00:00
MarcoFalke
fa971c09f2
Export assert from util/check.h
This avoids having to include both headers when assert and Assert are
used at the same time.
2023-11-24 13:11:36 +01:00
fanquake
0ffcc5b680
ci: remove python3-setuptools from mac build deps 2023-11-23 17:52:38 +00:00
fanquake
930bcfd4cd
Merge bitcoin/bitcoin#18919: test: Add gettransaction test for "coin-join" tx
fa20f8919c test: Add gettransaction test for "coin-join" tx (MarcoFalke)

Pull request description:

ACKs for top commit:
  furszy:
    utACK fa20f8919c

Tree-SHA512: 6e92455ef478d6bf2c544910402be9046698ded66f1f68d5fe5b989aafc20ba0537d362331e0e653595bca553166f6197fe548bdd0bcf295743775b8afb663a1
2023-11-23 17:49:06 +00:00
fanquake
f4073c5395
Merge bitcoin/bitcoin#28578: fuzz: add target for DescriptorScriptPubKeyMan
47e5c9994c fuzz: add target for `DescriptorScriptPubKeyMan` (brunoerg)
641dddf018 fuzz: create ConsumeCoins (brunoerg)
2e1833ca13 fuzz: move `MockedDescriptorConverter` to `fuzz/util` (brunoerg)

Pull request description:

  This PR adds fuzz target for `DescriptorScriptPubKeyMan`. Also, moves `MockedDescriptorConverter` to `fuzz/util/descriptor` to be used here and in `descriptor` target.

ACKs for top commit:
  maflcko:
    lgtm ACK 47e5c9994c 🏓
  dergoegge:
    ACK 47e5c9994c

Tree-SHA512: 519acca6d7b7a3a0bfc031441b02d5980b12bfb97198bd1958a83cd815ceb9eb1499a48a3f0a7fe20e5d06d83b89335d987376fc0a014e2106b0bc0e9838dd02
2023-11-23 17:34:03 +00:00
MarcoFalke
faf1fb207f
Fix IWYU for the script_flags fuzz target
Also, export script_error.h from interpreter.h, because there should
rarely be a case where script_error.h is included without interpreter.h
2023-11-23 17:57:53 +01:00
MarcoFalke
fa71285b73
fuzz: Limit fuzz buffer size in script_flags target 2023-11-23 17:56:52 +01:00
MarcoFalke
fa6b87b9ee
fuzz: CDataStream -> DataStream in script_flags 2023-11-23 17:50:33 +01:00
MarcoFalke
fa20f8919c
test: Add gettransaction test for "coin-join" tx 2023-11-23 14:11:01 +01:00
MarcoFalke
fa79a881ce
refactor: P2P transport without serialize version and type 2023-11-23 13:43:39 +01:00
fanquake
ddc4b9850a
Merge bitcoin/bitcoin#28919: build: Fix regression in "ARMv8 CRC32 intrinsics" test
228d6a2969 build: Fix regression in "ARMv8 CRC32 intrinsics" test (Hennadii Stepanov)

Pull request description:

  In the master branch, the `aarch64` binaries lack support for CRC32 intrinsics.

  The `vmull_p64` is a part of the Crypto extensions from the ACLE. They are optional extensions, so they get enabled with a `+crypto` for architecture flags.

  The regression was introduced in https://github.com/bitcoin/bitcoin/pull/26183 (v25.0).

  The `./configure` script log excerpts:
  - the master branch @ d752349029:
  ```
  checking whether C++ compiler accepts -march=armv8-a+crc... yes
  checking whether C++ compiler accepts -march=armv8-a+crypto... yes
  checking for ARMv8 CRC32 intrinsics... no
  checking for ARMv8 SHA-NI intrinsics... yes
  ```
  - this PR:
  ```
  checking whether C++ compiler accepts -march=armv8-a+crc+crypto... yes
  checking whether C++ compiler accepts -march=armv8-a+crypto... yes
  checking for ARMv8 CRC32 intrinsics... yes
  checking for ARMv8 SHA-NI intrinsics... yes
  ```

  Guix build:
  ```
  x86_64
  2afd81f540c6d3b36ff305e88bafe935e4272cd3efef3130aa69d49a0522541b  guix-build-228d6a2969e4/output/aarch64-linux-gnu/SHA256SUMS.part
  6c704d6d30d495adb3fb86befdb500eb389a02c1167163f14ab5c3c3e630e6b3  guix-build-228d6a2969e4/output/aarch64-linux-gnu/bitcoin-228d6a2969e4-aarch64-linux-gnu-debug.tar.gz
  e4419963c9c0d99adc4e38538900b648f2c14f793b60c8ee2e6f5acc9d3fadd3  guix-build-228d6a2969e4/output/aarch64-linux-gnu/bitcoin-228d6a2969e4-aarch64-linux-gnu.tar.gz
  7d11052b6bd28cdf26d5f2a4987f02d32c93a061907bcd048fb6d161a0466ca9  guix-build-228d6a2969e4/output/dist-archive/bitcoin-228d6a2969e4.tar.gz
  ```

ACKs for top commit:
  TheCharlatan:
    ACK 228d6a2969

Tree-SHA512: 4c27ca8acb953bf56e972d907a282ee19e3f30f7a4bf8a9822395fe0e28977cd6233e8b65b4a25cc1d3d5ff6a796d7af07653e18531c44ee3efaff1563d96d32
2023-11-22 17:20:13 +00:00
fanquake
5d13b9586e
Merge bitcoin/bitcoin#28461: build: Windows SSP roundup
f95af98128 guix: default ssp for Windows GCC (fanquake)
95d55b96c2 guix: remove ssp workaround from Windows GCC (fanquake)
8f43302a0a build: remove explicit libssp linking from Windows build (fanquake)

Pull request description:

  I was expecting this to fail to compile somewhere, maybe in the CI, but that doesn't seem to be the case?
  Seems workable given the SSP related changes in the newer mingw-w64 headers (which are in Guix):
  > Implement some of the stack protector functions/variables so -lssp is now optional when _FORTIFY_SOURCE or -fstack-protector-strong is used.

  However I think this would still be broken in some older environments, so we might have to wait for a compiler bump, or similar. The optional -lssp also seems to work when using older headers, which doesn't make sense.

  Would fix #28104.

ACKs for top commit:
  hebasto:
    ACK f95af98128, I've verified binaries from `bitcoin-f95af98128f1-win64.zip` on Windows 11 Pro 23H2.
  TheCharlatan:
    ACK f95af98128

Tree-SHA512: 71169ec513cfe692dfa7741d2bf37b45da05627c0af1cbd50cf8c3c04cc21c4bf88f3284532bddc1e3e648391ec78dbaca5170987a13c21ac204a7bcaf27f349
2023-11-22 17:17:12 +00:00
fanquake
172cd92620
Merge bitcoin/bitcoin#28862: lint: Report all lint errors instead of early exit
fa01f884d3 ci: Add missing COPY for ./test/lint/test_runner (MarcoFalke)
faff3e3b46 lint: Report all lint errors instead of early exit (MarcoFalke)

Pull request description:

  `all-lint.py` currently collects all failures. However, the `06_script.sh` does not, since July this year (https://github.com/bitcoin/bitcoin/pull/28103#discussion_r1268115806).

  Fix this by printing all failures before exiting.

  Can be tested by modifying (for example) two subtrees in the same commit and then running the linters.

ACKs for top commit:
  kevkevinpal:
    ACK [fa01f88](fa01f884d3)
  TheCharlatan:
    lgtm ACK fa01f884d3

Tree-SHA512: c0f3110f2907d87e29c755e3b77a67dfae1f8a25833fe6ef8f2f2c58cfecf1aa46f1a20881576b62252b04930140a9e416c78b4edba0780d3c4fa7aaebabba81
2023-11-22 17:00:45 +00:00
fanquake
a238356823
Merge bitcoin/bitcoin#28907: depends: bump libmultiprocess to fix capnproto deprecation warnings
21bfee0720 depends: bump libmultiprocess to fix capnproto deprecation warnings (Ryan Ofsky)

Pull request description:

  This incorporates PR chaincodelabs/libmultiprocess#88 and reverts the NO_WERROR CI workaround added in #28735

  Upstream diff: 61d5a0e661...414542f81e

  ---

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/issues/28722).

ACKs for top commit:
  maflcko:
    lgtm ACK 21bfee0720
  hebasto:
    ACK 21bfee0720, I have reviewed the code and it looks OK. I've also skimmed through the related changes in the https://github.com/chaincodelabs/libmultiprocess repository.

Tree-SHA512: b5addb0deed694eeec62a0ae08b4715a811110201f39f3e6cadee8fc4e6231b0e66c844a98512072a1445bac122ab561dc1711e27fb4d7ac5c08ac46780a4acf
2023-11-22 11:48:09 +00:00
fanquake
4374a87879
Merge bitcoin/bitcoin#28895: p2p: do not make automatic outbound connections to addnode peers
5e7cc4144b test: add unit test for CConnman::AddedNodesContain() (Jon Atack)
cc62716920 p2p: do not make automatic outbound connections to addnode peers (Jon Atack)

Pull request description:

  to allocate our limited outbound slots correctly, and to ensure addnode
  connections benefit from their intended protections.

  Our addnode logic usually connects the addnode peers before the automatic
  outbound logic does, but not always, as a connection race can occur.  If an
  addnode peer disconnects us and if it was the only one from its network, there
  can be a race between reconnecting to it with the addnode thread, and it being
  picked as automatic network-specific outbound peer.  Or our internet connection
  or router or the addnode peer could be temporarily offline, and then return
  online during the automatic outbound thread.  Or we could add a new manual peer
  using the addnode RPC at that time.

  The race can be more apparent when our node doesn't know many peers, or with
  networks like cjdns that currently have few bitcoin peers.

  When an addnode peer is connected as an automatic outbound peer and is the only
  connection we have to a network, it can be protected by our new outbound
  eviction logic and persist in the "wrong role".

  Finally, there does not seem to be a reason to make block-relay or short-lived
  feeler connections to addnode peers, as the addnode logic will ensure we connect
  to them if they are up, within the addnode connection limit.

  Fix these issues by checking if the address is an addnode peer in our automatic
  outbound connection logic.

ACKs for top commit:
  mzumsande:
    Tested ACK 5e7cc4144b
  brunoerg:
    utACK 5e7cc4144b
  vasild:
    ACK 5e7cc4144b
  guggero:
    utACK 5e7cc4144b

Tree-SHA512: 2438c3ec92e98aebca2a0da960534e4655a9c6e1192a24a085fc01326d95cdb1b67d8c44e4ee706bc1d8af8564126d446a21b5579dcbec61bdea5fce2f0115ee
2023-11-22 11:47:18 +00:00
fanquake
ca041fc4ab
Merge bitcoin/bitcoin#28904: Drop CAutoFile
4eb2a9ea4b streams: Drop unused CAutoFile (Anthony Towns)
cde9a4b137 refactor: switch from CAutoFile to AutoFile (Anthony Towns)
bbd4646a2e blockstorage: switch from CAutoFile to AutoFile (Anthony Towns)
c72ddf04db streams: Remove unused CAutoFile::GetVersion (Anthony Towns)
e63f643079 streams: Base BufferedFile on AutoFile instead of CAutoFile (Anthony Towns)

Pull request description:

  Continuing the move away from `GetVersion()`, replace uses of `CAutoFile` with `AutoFile`.

ACKs for top commit:
  maflcko:
    re-ACK 4eb2a9ea4b 🖼
  TheCharlatan:
    ACK 4eb2a9ea4b
  stickies-v:
    ACK 4eb2a9ea4b

Tree-SHA512: 1a68c42fdb725ca4bf573e22794fe7809fea764a5f97ecb33435add3c609d40f336038fb22ab1ea72567530efd39678278c9016f92ed04891afdb310631b4e82
2023-11-22 11:24:39 +00:00
fanquake
3dca308bd7
Merge bitcoin/bitcoin#28891: test: fix AddNode unit test failure on OpenBSD
007d6f0e85 test: fix `AddNode` unit test failure on OpenBSD (Sebastian Falbesoner)

Pull request description:

  On OpenBSD 7.4, the following check of the unit test `test_addnode_getaddednodeinfo_and_connection_detection` currently fails:
  ```
  BOOST_CHECK(!connman->AddNode({/*m_added_node=*/"127.1", /*m_use_v2transport=*/true}));
  ```
  The reason for that is that this OS seemingly doesn't support the IPv4 shorthand notation with omitted zero-bytes:

  ```
  $ ping 127.1
  ping: no address associated with name
  ```

  As a simple fix, this PR skips the check for this with a pre-processor #if. On NetBSD and FreeBSD, `127.1` is resolved correctly to localhost and hence the test passes (thanks to vasild for verifying on the latter!).

ACKs for top commit:
  vasild:
    ACK 007d6f0e85

Tree-SHA512: 8ab8393c490e1ecc140e8ff74f6fa4d26d0dd77e6a77a241cd198314b8c5afee7422f95351ca05f4c1742433dab77016a8ccb8d28062f8edd4b703a918a2bbda
2023-11-22 11:18:24 +00:00
fanquake
e9beaa749c
Merge bitcoin/bitcoin#28913: coins: make sure PoolAllocator uses the correct alignment
d5b4c0b69e pool: change memusage_test to use int64_t, add allocation check (Martin Leitner-Ankerl)
ce881bf9fc pool: make sure PoolAllocator uses the correct alignment (Martin Leitner-Ankerl)

Pull request description:

  The class `CTxOut` has a member `CAmount` which is an int64_t, and on ARM 32bit int64_t are 8 byte aligned, which is larger than the pointer alignment of 4 bytes.

  So for `CCoinsMap` to be able to use the pool, we need to use the alignment of the member instead of just `alignof(void*)`.

  This fixes #28906 (first noted in https://github.com/bitcoin/bitcoin/issues/28718#issuecomment-1807197107) and #28440.

ACKs for top commit:
  pinheadmz:
    ACK d5b4c0b69e
  hebasto:
    re-ACK d5b4c0b69e, the only change since my recent [review](https://github.com/bitcoin/bitcoin/pull/28913#pullrequestreview-1739334189) is an updated test.
  theStack:
    Tested ACK d5b4c0b69e

Tree-SHA512: 4446793fad6d56f0fe22e09ac9ade051e86de11ac039cd61c0f6b7f79874242878a6a46a2c76ac3b8f1d53464872620d39139f54b1471daccad26d6bb1ae8ca1
2023-11-22 11:15:27 +00:00
ismaelsadeeq
91504cbe0d rpc: SyncWithValidationInterfaceQueue on fee estimation RPC's
This ensures that the most recent fee estimation data is used for the
fee estimation with `estimateSmartfee` and `estimaterawfee` RPC's.
2023-11-22 11:48:21 +01:00
ismaelsadeeq
714523918b tx fees, policy: CBlockPolicyEstimator update from CValidationInterface notifications
`CBlockPolicyEstimator` will implement `CValidationInterface` and
subscribe to its notification to process transactions added and removed
from the mempool.

Re-delegate calculation of `validForFeeEstimation` from validation to fee estimator.

Also clean up the validForFeeEstimation arg thats no longer needed in `CTxMempool`.

Co-authored-by: Matt Corallo <git@bluematt.me>
2023-11-22 11:48:21 +01:00
ismaelsadeeq
dff5ad3b99 CValidationInterface: modify the parameter of TransactionAddedToMempool
Create a new struct `NewMempoolTransactionInfo` that will be used as the new parameter of
`TransactionAddedToMempool` callback.
2023-11-22 11:48:21 +01:00
ismaelsadeeq
91532bd382 tx fees, policy: update CBlockPolicyEstimator::processBlock parameter
Update `processBlock` parameter to reference to a vector of `RemovedMempoolTransactionInfo`.
2023-11-22 11:48:21 +01:00
ismaelsadeeq
bfcd401368 CValidationInterface, mempool: add new callback to CValidationInterface
This commit adds a new callback `MempoolTransactionsRemovedForBlock` which notify
its listeners of the transactions that are removed from the mempool because a new
block is connected, along with the block height the transactions were removed.
The transactions are in `RemovedMempoolTransactionInfo` format.

`CTransactionRef`, base fee, virtual size, and height which the transaction was added
to the mempool are all members of the struct called `RemovedMempoolTransactionInfo`.

A struct `NewMempoolTransactionInfo`, which has fields similar to `RemovedMempoolTransactionInfo`,
will be added in a later commit, create a struct `TransactionInfo` with all similar fields.
They can both have a member with type `TransactionInfo`.
2023-11-22 11:48:21 +01:00
ismaelsadeeq
0889e07987 tx fees, policy: cast with static_cast instead of C-Style cast 2023-11-22 11:48:21 +01:00
ismaelsadeeq
a0e3eb7549 tx fees, policy: bugfix: move removeTx into reason != BLOCK condition
If the removal reason of a transaction is BLOCK, then the `removeTx`
boolean argument should be true.

Before this PR, `CBlockPolicyEstimator` have to complete updating the fee stats
before the mempool clears that's why having removeTx call outside reason!= `BLOCK`
in `addUnchecked` was not a bug.

But in a case where the `CBlockPolicyEstimator` update is asynchronous, the mempool might
clear before we update the `CBlockPolicyEstimator` fee stats.
Transactions that are removed for `BLOCK` reasons will also be incorrectly removed from
`CBlockPolicyEstimator` stats as failures.
2023-11-22 11:48:21 +01:00
Hennadii Stepanov
640b450530
Merge bitcoin/bitcoin#28925: ci: Update apt cache
710da28c72 ci: Switch from `apt` to `apt-get` (Hennadii Stepanov)
a6cc059ea5 ci: Update apt cache (Hennadii Stepanov)

Pull request description:

  This PR aims to fix the recent errors in the "test each commit" CI job.

ACKs for top commit:
  maflcko:
    lgtm ACK 710da28c72
  ismaelsadeeq:
    utACK 710da28c72

Tree-SHA512: b42340aea00e80f791000e19791629f27df2da98adefb839cb4389d81b5eee094089ea5092a2d7b56b3990683a72e4d2fa986fc86c823c7245649af37873b790
2023-11-22 10:43:18 +00:00
Hennadii Stepanov
710da28c72
ci: Switch from apt to apt-get 2023-11-22 10:02:08 +00:00
Hennadii Stepanov
a6cc059ea5
ci: Update apt cache 2023-11-22 10:01:19 +00:00
Sjors Provoost
f053024273
wallet: batch external signer descriptor import
Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
2023-11-21 23:07:00 -03:00
furszy
1f65241b73
wallet: descriptors setup, batch db operations
Instead of doing one db transaction per descriptor setup,
batch all descriptors' setup writes in a single db txn.

Speeding up the process and preventing the wallet from entering
an inconsistent state if any of the intermediate transactions
fail.
2023-11-21 23:01:42 -03:00
furszy
3eb769f150
wallet: batch legacy spkm TopUp
Instead of performing multiple atomic write
operations per legacy spkm setup call, batch
them all within a single atomic db txn.
2023-11-21 23:01:30 -03:00
furszy
075aa44ceb
wallet: batch descriptor spkm TopUp
Instead of performing multiple atomic write
operations per descriptor setup call, batch
them all within a single atomic db txn.
2023-11-21 23:01:30 -03:00