Commit graph

176 commits

Author SHA1 Message Date
Byron Hambly
8bc9cd62fb Merge be44332803 into merged_master (Bitcoin PR bitcoin/bitcoin#28191) 2025-07-03 15:53:03 +02:00
Byron Hambly
3e027c6bd4 Merge f4f1d6d230 into merged_master (Bitcoin PR bitcoin/bitcoin#27746) 2025-07-03 12:59:45 +02:00
Byron Hambly
61ecd1fa45 Merge e253568da8 into merged_master (Bitcoin PR bitcoin/bitcoin#28053) 2025-07-01 11:52:36 +02:00
Byron Hambly
f61ec91393 Merge ef29d5d7e2 into merged_master (Bitcoin PR bitcoin/bitcoin#27607) 2025-07-01 11:32:01 +02:00
Byron Hambly
a8a9ae2ae1 Merge 75135c673e into merged_master (Bitcoin PR bitcoin/bitcoin#27861) 2025-07-01 10:39:46 +02:00
Byron Hambly
e999ab6070 Merge caff95a023 into merged_master (Bitcoin PR bitcoin/bitcoin#27896) 2025-06-28 11:08:01 +02:00
Byron Hambly
38c95b75e9 Merge e4bbfb2d49 into merged_master (Bitcoin PR bitcoin/bitcoin#27632) 2025-06-27 15:10:29 +02:00
Byron Hambly
30814e6064 Merge c92fd63886 into merged_master (Bitcoin PR bitcoin/bitcoin#27708) 2025-06-27 14:01:27 +02:00
Byron Hambly
edc585d157 Merge 9564f98fee into merged_master (Bitcoin PR bitcoin/bitcoin#27636) 2025-06-25 11:40:46 +02:00
Byron Hambly
73663a4c89 Merge 4e8a7654f6 into merged_master (Bitcoin PR bitcoin/bitcoin#25193) 2025-06-20 16:01:14 +02:00
Byron Hambly
b1d470027d Merge c2f2abd0a4 into merged_master (Bitcoin PR bitcoin/bitcoin#27125) 2025-06-20 10:46:05 +02:00
Byron Hambly
e22e1b9509 Merge ccd4db7d62 into merged_master (Bitcoin PR bitcoin/bitcoin#27570) 2025-05-16 10:32:57 +02:00
Byron Hambly
16f1169009 Merge 8a373a5c7f into merged_master (Bitcoin PR bitcoin/bitcoin#27191) 2025-05-15 13:11:32 +02:00
Byron Hambly
5ac82e15a9 Merge 669af32632 into merged_master (Bitcoin PR bitcoin/bitcoin#27419) 2025-05-09 11:47:45 +02:00
Byron Hambly
e23e51f9ef Merge 369d4c03b7 into merged_master (Bitcoin PR bitcoin/bitcoin#27254) 2025-04-12 12:19:09 +02:00
Thomas Trevethan
9406f21187 Merge e695d8536e into merged_master (Bitcoin PR bitcoin/bitcoin#26177) 2025-04-11 12:02:49 +01:00
Byron Hambly
59a4dcb178 Merge cbfbf46e57 into merged_master (Bitcoin PR bitcoin/bitcoin#25781) 2025-04-10 09:10:09 +02:00
Byron Hambly
e24c402fac Merge b175bdb9b2 into merged_master (Bitcoin PR bitcoin/bitcoin#27238) 2025-04-10 08:26:17 +02:00
Byron Hambly
6ec7ce1641 Merge bb136aaf2c into merged_master (Bitcoin PR bitcoin/bitcoin#26533) 2025-04-09 12:28:27 +02:00
Tom Trevethan
669ddecaca Merge 0a1d372ad0 into merged_master (Bitcoin PR bitcoin/bitcoin#26649) 2025-04-04 15:50:36 +00:00
Byron Hambly
b4405ba453 Merge e9262ea32a into merged_master (Bitcoin PR bitcoin/bitcoin#26750) 2025-03-31 16:37:52 +02:00
Byron Hambly
ca0a68b350
Merge UP TO 551c8e9526 into merged_master (UP TO bitcoin/bitcoin#26349)
Includes FIXMEs for a few functional tests
2025-02-05 09:50:17 +02:00
Byron Hambly
8499b13762
lint: fix lint issues 2024-12-03 14:02:33 +02:00
Byron Hambly
b80b3aeff4 Merge 3a7e0a210c into merged_master (Bitcoin PR bitcoin/bitcoin#24513) 2024-11-26 14:42:49 +02:00
Byron Hambly
1006327a13 Merge 9eaef10801 into merged_master (Bitcoin PR bitcoin/bitcoin#25707) 2024-11-04 11:26:40 +02:00
Byron Hambly
52148abe10 Merge 5871b5b5ab into merged_master (Bitcoin PR bitcoin/bitcoin#25571) 2024-10-24 12:30:38 +02:00
Byron Hambly
28d35f619e Merge 510ac41eac into merged_master (Bitcoin PR bitcoin/bitcoin#25331) 2024-10-18 13:14:02 +02:00
Byron Hambly
076e809b74 Merge 821f5c824f into merged_master (Bitcoin PR bitcoin/bitcoin#25487) 2024-10-17 09:16:23 +02:00
James Dorfman
413a175b53 Fixes for Elements PR #1270 2024-09-23 21:22:11 +00:00
James Dorfman
61b0543ba7 Merge cdcc74bbcc into merged_master (Elements PR #1270) 2024-09-23 16:51:13 +00:00
James Dorfman
841caf1c0f Merge 45d8b1e94a into merged_master (Bitcoin PR bitcoin/bitcoin#25286) 2024-09-09 19:19:33 +00:00
James Dorfman
ae633bfd3b Merge 636991d0c0 into merged_master (Bitcoin PR bitcoin/bitcoin#25264) 2024-09-06 19:31:45 +00:00
James Dorfman
387cfbcfe8 Merge 194b414697 into merged_master (Bitcoin PR bitcoin/bitcoin#25016) 2024-08-08 17:30:27 +00:00
James Dorfman
628a1506e1 Merge b51e60f914 into merged_master (Bitcoin PR bitcoin/bitcoin#22564) 2024-08-06 19:02:09 +00:00
James Dorfman
01e944c8aa Merge 34ae04d775 into merged_master (Bitcoin PR bitcoin/bitcoin#21726)
This changed the node pruning logic and moved test/functional/feature_blockfilterindex_prune.py
to test/functional/feature_index_prune.py.

Please verify that:
1. I migrated the test correctly
2. The magic numbers in the test look fine

With respect to #2: I believe the magic numbers are wrong. I previously had to tweak them heavily
in commit 1278b31. I don't think I did it correctly then, and so I don't believe them to be correct now.

To summarize what this tweaking was: I changed the magic numbers in the test to work properly,
but I suspect that in changing them, I may have nullified what the test was testing.

It's very possible that the reason the test was failing was because of an underlying bug with the pruning
in elements which we have to fix, rather than just being an issue with the test itself.
2024-08-06 16:43:47 +00:00
James Dorfman
d4aa6eba2f Merge dbdc83ae01 into merged_master (Bitcoin PR bitcoin/bitcoin#24909) 2024-08-01 18:03:20 +00:00
Pablo Greco
5a409265ef Extreme trimming on startup 2024-05-21 05:34:30 +00:00
Pablo Greco
4259278ff5 Reload trimmed header from index instead of block, block may have been pruned 2024-05-21 05:34:30 +00:00
Byron Hambly
fa21dc5b5d Merge 601bfc417d into merged_master (Bitcoin PR bitcoin/bitcoin#24515) 2023-10-16 10:58:18 +00:00
Byron Hambly
b7ad3576f5 Merge 5e49b2a252 into merged_master (Bitcoin PR bitcoin/bitcoin#24050) 2023-10-13 12:02:55 +00:00
Byron Hambly
591749d9f1
build: fix issues from ASAN in CI 2023-09-01 17:17:44 +02:00
fanquake
be44332803
Merge bitcoin/bitcoin#28191: refactor: Remove unused MessageStartChars parameters from BlockManager methods
fa69e3a95c Remove unused MessageStartChars parameters from BlockManager methods (MarcoFalke)

Pull request description:

  Seems odd to expose these for mocking, when it is not needed.

  Fix this by removing the the unused parameters and use the already existing member field instead.

ACKs for top commit:
  Empact:
    utACK fa69e3a95c
  dergoegge:
    utACK fa69e3a95c

Tree-SHA512: 7814e9560abba8d9c0926bcffc70f92e502d22f543af43671248f6fcd1433f35238553c0f05123fde6d8e0f80261af0ab0500927548115153bd68d57fe2da746
2023-08-07 10:57:39 +02:00
MarcoFalke
fa69e3a95c
Remove unused MessageStartChars parameters from BlockManager methods 2023-07-31 14:32:57 +02:00
Suhas Daftuar
d0d40ea9a6 Move block-storage-related logic to ChainstateManager
Separate the notion of which blocks are stored on disk, and what data is in our
block index, from what tip a chainstate might be able to get to. We can use
chainstate-agnostic data to determine when to store a block on disk (primarily,
an anti-DoS set of criteria) and let the chainstates figure out for themselves
when a block is of interest for being a candidate tip.

Note: some of the invariants in CheckBlockIndex are modified, but more work is
needed (ie to move CheckBlockIndex to ChainstateManager, as most of what
CheckBlockIndex is doing is checking the consistency of the block index, which
is outside of Chainstate).
2023-07-21 10:09:44 -04:00
Suhas Daftuar
1cfc887d00 Remove CChain dependency in node/blockstorage 2023-07-14 14:54:57 -04:00
Suhas Daftuar
fe86a7cd48 Explicitly track maximum block height stored in undo files
When writing a new block to disk, if we have filled up the current block file,
then we flush and truncate that block file (to free allocated but unused
space) before advancing to the next one. When this happens, we have to
determine whether to also flush and truncate the corresponding undo file.

Undo data is only written when blocks are connected, not when blocks are
received. Thus it's possible that the corresponding undo file already has all
the data it will ever have, and we should flush/truncate it as we advance
files; or it's possible that there is more data we expect to write, and should
therefore defer flush/truncation until undo data is later written.

Prior to this commit, we made the determination of whether the undo file was
full of all requisite data by comparing against the chain tip. This patch
replaces that dependence on validation data structures by instead just tracking
the highest height of any block written in the undo file as we go.
2023-07-14 14:47:00 -04:00
TheCharlatan
462390c85f
refactor: Move stopafterblockimport handling out of blockstorage
This has the benefit of moving the StartShutdown call out of the
blockstorage file and thus out of the kernel's responsibility. The user
can now decide if he wants to start shutdown / interrupt after a block
import or not.
2023-07-11 12:00:57 +02:00
furszy
ca91c244ef
index: verify blocks data existence only once
At present, during init, we traverse the chain (once per index)
to confirm that all necessary blocks to sync each index up to
the current tip are present.

To make the process more efficient, we can fetch the oldest block
from the indexers and perform the chain data existence check from
that point only once.

This also moves the pruning violation check to the end of the
'loadinit' thread, which is where the reindex, block loading and
chain activation processes happen.

Making the node's startup process faster, allowing us to remove
the global g_indexes_ready_to_sync flag, and enabling the
execution of the pruning violation verification even when the
reindex or reindex-chainstate flags are enabled (which has being
skipped so far).
2023-07-10 10:50:50 -03:00
furszy
2ec89f1970
refactor: simplify pruning violation check
By generalizing 'GetFirstStoredBlock' and implementing
'CheckBlockDataAvailability' we can dedup code and
avoid repeating work when multiple indexes are enabled.
E.g. get the oldest block across all indexes and
perform the pruning violation check from that point
up to the tip only once (this feature is being introduced
in a follow-up commit).

This commit shouldn't change behavior in any way.

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2023-07-10 10:50:50 -03:00
furszy
c82ef91eae
make GetFirstStoredBlock assert that 'start_block' always has data
And transfer the responsibility of verifying whether 'start_block'
has data or not to the caller.

This is because the 'GetFirstStoredBlock' function responsibility
is to return the first block containing data. And the current
implementation can return 'start_block' when it has no data!. Which
is misleading at least.

Edge case behavior change:
Previously, if the block tip lacked data but all preceding blocks
contained data, there was no prune violation. And now, such
scenario will result in a prune violation.
2023-07-10 10:47:17 -03:00