Speeding up SipHash - This Week in Bitcoin Core #52
This week Siphash is hashing faster...
Hello 👋 folks, I’m Kevkevin. I’m an open-source developer and reporter for Insider Edition. Last week, I reviewed several pull requests from the Bitcoin Core repo.
Merged PR’s
Every week, several changes are officially added to Bitcoin Core. This week, multiple changes were merged. Here are some I found interesting this week.
fuzz: add p2p_private_broadcast harness by frankomosh
More fuzz coverage landed this week. Frank Ochieng had his PR merged that adds a dedicated harness for ConnectionType::PRIVATE_BROADCAST, the privacy-preserving tx relay path that barely got exercised before.
The existing process_message fuzz target could create private broadcast peers, but it never seeded m_tx_for_private_broadcast, so the interesting send path basically never ran. This harness builds those peers on purpose, seeds the tx first, and only feeds in the message types private broadcast actually allows.
As always, more fuzzing is welcome, and who knows, maybe this one finds something interesting down the line.
coins: use SipHash-1-3-UJ for CCoinsMap keys by l0rinc
This week L0rinc had a performance PR merged that speeds up hashing for the in-memory UTXO cache. The coins map was using SipHash-2-4 forCOutPointkeys, and that path was doing more work than it needed to for a fixed 32-byte txid plus a small output index.The fix switches that hasher over to SipHash-1-3-UJ, a reduced-round variant with jumbo-block handling that Pieter helped design. It stays local to the coins cache and related temp sets, so nothing gets persisted or sent over the network. Benchmarks show the outpoint hash path about 2x faster, and a full reindex run was roughly 5% quicker.
There are always changes being updated and reviewed in real-time. Here are some notable PR’s that are still up and looking for reviews.
refactor: Add util::Result failure types and ability to merge result values by ryanofsky
Add `util::Result` support for returning more error information and make use of it in [LoadChainstate method](https://github.com/bitcoin/bitcoin/pull/25665/commits/753b8678ac98c8753f9db17cc92d56d4d58d9e7e) as an initial application. Followup PRs [#25722](https://github.com/bitcoin/bitcoin/pull/25722) and [#29700](https://github.com/bitcoin/bitcoin/pull/29700) use it more broadly to return errors and warnings from wallet and kernel functions as well. This change adds two major features to the result class: - For better error handling, adds the ability to return a value on failure, not just a value on success. This is a key missing feature that makes the result class not useful for functions like `LoadChainstate()` which produce different errors that need to be handled differently [^1]. - For better error reporting, adds the ability to return warning messages and multiple errors, not just a single error string. This provides a way for functions to report errors and warnings in a standard way, and simplifies interfaces
IRC meeting notes
Every week on Thursday, there is an IRC meeting. Here are some short notes from that meeting.
--- Topic 1 ---
stickies-v: #topic Fuzzing WG Update (dergoegge, marcofleon)
marcofleon: hi
marcofleon: no update
hodlinator: hi
--- Topic 2 ---
stickies-v: #topic Kernel WG Update (sedited)
sedited: i've got nothing this week. maybe someone else?
yancy: hi
stickies-v: purpleKarrot made some more progress on his stateless validation work
stickies-v: but i think more to share on that later
--- Topic 3 ---
stickies-v: #topic Benchmarking WG Update (l0rinc, andrewtoth)
l0rinc: #35215 was merged - another 5% validation speedup \:D/
l0rinc: so now we can use it in #35531
l0rinc: I'm running reindex-chainstate benchmarks to compare master with 29/30/31 to see how they stack up.
stickies-v: as in 5% faster IBD/reindex?
l0rinc: yup
stickies-v: juicy
l0rinc: in addition to the parallel prevout fetcher
l0rinc: thanks, that's it from me
dergoegge: lfg
Murch[m]: v32 should be quite the speedupz
l0rinc: especially if we can get the txindex changes in
l0rinc: Andrew is at a conference
--- Topic 4 ---
stickies-v: #topic QML GUI WG Update (johnny9dev)
johnny9dev: Our preview release is now published to bitcoincore.app. Already got a lot of good feedback on it to work through.
johnny9dev: I dropped down the glibc the preview builds against for increased compatibility
johnny9dev: One thing I realized too while testing is that the linux depends build doesnt have opengl and the macos depends uses metal apis so there are performance differences across platforms and it is noticeable. So with that I've been focused on optimizing all of the rendering so any page not visible isn't continuing to draw. I think i got most of the main ones and it will be working much better on linux once the PRs are merged.
johnny9dev: Then finally I removed gMock from our codebase and will make sure that doesn't get included in our staging branch.
johnny9dev: that is all
stickies-v: wdym with dropped down the glibc?
johnny9dev: built against ubuntu 22.04 instead of 24.04 toolchain
stickies-v: ooh version downgrade you mean
johnny9dev: at least one person testing couldnt run the built binary on their version of debian
johnny9dev: yeah
--- Topic 5 ---
stickies-v: #topic QA WG Update (brunoerg)
brunoerg: hi, no update this week
stickies-v: Anything else to discuss?
stickies-v: alright, let's get back to building, thanks for the updates everyoneRead here for the full meeting
Releases
Thank you for reading. Be sure to tune in again next week for your updates on Bitcoin Core!
If there are any comments, suggestions, or errors, do not hesitate to reach out or comment



