Skip to content

[30.x] 30.3rc1 - #35452

Merged
sedited merged 8 commits into
bitcoin:30.xfrom
fanquake:30_3_rc1
Jun 23, 2026
Merged

sedited merged 8 commits into
bitcoin:30.xfrom
fanquake:30_3_rc1

Conversation

@fanquake fanquake added this to the 30.3 milestone Jun 3, 2026
@DrahtBot

DrahtBot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35452.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK sedited, marcofleon

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

@andrewtoth

andrewtoth commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Can we have something like this in the release notes. Also for 29 point release (and possibly 31 if we don't have an automatic compaction patch merged):

This fixes an issue where the chainstate database would repeatedly rewrite
large portions of itself, causing excessive disk reads and writes during
normal operation.

As a side effect, the chainstate will be around 4 GB larger after an initial
sync. To reclaim this space, restart the node with -forcecompactdb=1
after the initial sync has finished. It should be removed on subsequent
restarts. Leaving it set will cause significant disk reads and writes every
time the node is restarted.

This is no-longer a proper subtree, because of direct cherry-picks.
@fanquake

Copy link
Copy Markdown
Member Author

Can we have something like this in the release notes.

Pulled that into the release notes.

@andrewtoth andrewtoth mentioned this pull request Jun 17, 2026
Add `CDBWrapper::GetProperty()` and expose it through `CCoinsViewDB::GetDBProperty()` so coins tests can inspect LevelDB runtime properties through the coins view.
Use it in a coins DB flush baseline that records the LevelDB layout after flushing while keeping readback coverage for the flushed coin and best block.

Co-authored-by: Andrew Toth <[email protected]>

Github-Pull: bitcoin#35465
Rebased-From: b10889d
@fanquake
fanquake marked this pull request as ready for review June 22, 2026 10:16
@fanquake
fanquake force-pushed the 30_3_rc1 branch 3 times, most recently from bc63be0 to 5cb058a Compare June 22, 2026 10:59
@fanquake
fanquake force-pushed the 30_3_rc1 branch 2 times, most recently from ca25bb7 to 98852b9 Compare June 22, 2026 11:17
Comment thread src/validation.cpp Outdated
m_chainman.m_options.signals->ChainStateFlushed(this->GetRole(), GetLocator(m_chain.Tip()));
}

if (!m_chainman.m_interrupt && m_chainman.m_chainstates.size() == 1) { // Skip AssumeUTXO

@sedited sedited Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In commit cbdb11da241cd39cc2d1813369fa25e1987d98c5

I think you want m_chainman.GetAll().size() here instead of m_chainman.m_chainstates.size() (and probably in the 29 backport too to make the ancestor commit CI pass).

l0rinc and others added 6 commits June 22, 2026 14:00
Full chainstate flushes are convenient maintenance points for long-term LevelDB cleanup because the chainstate was just written.
Randomize the trigger so nodes that flush near the same height do not compact together.

Add blocking chainstate compaction through `CCoinsViewDB::CompactFull()` and give each post-IBD full flush on the normal chainstate a 1/320 chance to start compaction.
With hourly flushes this averages roughly every two weeks and makes a six-month miss about one in a million.
This keeps the schedule stateless and leaves last-compaction height or timestamp bookkeeping out of chainstate metadata.

Co-authored-by: Andrew Toth <[email protected]>

Github-Pull: bitcoin#35465
Rebased-From: aa021b2
Full chainstate compaction can take minutes on large databases.
Move `CCoinsViewDB::CompactFull()` to a named `utxocompact` one-shot background thread so validation only schedules the work.

When validation selects compaction after a full flush, the chainstate was just written and another write is less likely to be needed immediately.
The coins view destructor waits for completion, and a mutex prevents compaction from using `m_db` while `ResizeCache()` replaces it.

Co-authored-by: Andrew Toth <[email protected]>

Github-Pull: bitcoin#35465
Rebased-From: 394e473
These are unused and removing them avoids clang warnings like:

src/test/fuzz/deserialize.cpp:42:26: error: variable g_setup set but not used [-Werror,-Wunused-but-set-variable]

Github-Pull: bitcoin#34918
Rebased-From: fabbfec

@sedited sedited left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK d52747d

@fanquake
fanquake requested a review from marcofleon June 22, 2026 13:48

@marcofleon marcofleon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK d52747d

@sedited
sedited merged commit 7bc403c into bitcoin:30.x Jun 23, 2026
20 checks passed
@l0rinc

l0rinc commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

nit: we might want to mention that #35083 was also backported since 30.2

ACK d52747d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants