<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://bitcoincore.reviews/feed.xml" rel="self" type="application/atom+xml" /><link href="https://bitcoincore.reviews/" rel="alternate" type="text/html" /><updated>2026-04-09T22:16:34+00:00</updated><id>https://bitcoincore.reviews/feed.xml</id><title type="html">Bitcoin Core PR Review Club</title><subtitle>A monthly review club for Bitcoin Core PRs</subtitle><author><name>Bitcoin Core PR Review Club contributors</name></author><entry><title type="html">Testing Bitcoin Core 31.0 Release Candidates</title><link href="https://bitcoincore.reviews/v31-rc-testing" rel="alternate" type="text/html" title="Testing Bitcoin Core 31.0 Release Candidates" /><published>2026-04-08T00:00:00+00:00</published><updated>2026-04-08T00:00:00+00:00</updated><id>https://bitcoincore.reviews/v31-rc-testing</id><content type="html" xml:base="https://bitcoincore.reviews/v31-rc-testing"><![CDATA[<h2 id="notes">Notes</h2>

<ul>
  <li>
    <p>Major versions of Bitcoin Core are released every 6-8 months. See the <a href="https://bitcoincore.org/en/lifecycle/">Life
Cycle documentation</a> for full details.</p>
  </li>
  <li>
    <p>When all of the PRs for a release have been merged, <em>Release Candidate 1</em>
(rc1) is tagged. The rc is then tested. If any issues are found, fixes are
merged into the branch and a new rc is tagged. This continues until no major
issues are found in an rc, and that rc is then considered to be the final
release version.</p>
  </li>
  <li>
    <p>To ensure that users don’t experience issues with the new software, it’s
essential that the rcs are thoroughly tested. This special review club
meeting is for people who want to help with that vital review process.</p>
  </li>
  <li>
    <p>This <a href="https://github.com/bitcoin-core/bitcoin-devwiki/wiki/31.0-Release-Candidate-Testing-Guide">Bitcoin Core Release Candidate Testing
Guide</a> provides guidance for testing the release candidate.</p>
  </li>
  <li>
    <p>The guide is just to get you started on testing, so feel free to read the <a href="https://github.com/bitcoin-core/bitcoin-devwiki/wiki/31.0-Release-Notes-Draft">Release Notes</a>
and bring ideas of other things you’d like to test!</p>
  </li>
</ul>

<h2 id="meeting-log">Meeting Log</h2>

<table class="log-line" id="l-1"><tr class="log-row"><td class="log-lineno"><a href="#l-1">&nbsp;&nbsp;1</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> #startmeeting</span></td></tr></table>
<table class="log-line" id="l-2"><tr class="log-row"><td class="log-lineno"><a href="#l-2">&nbsp;&nbsp;2</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:seagreen">&lt;corebot`&gt;</span><span class="log-msg"> svanstaa: Meeting started at 2026-04-08T17:00+0000</span></td></tr></table>
<table class="log-line" id="l-3"><tr class="log-row"><td class="log-lineno"><a href="#l-3">&nbsp;&nbsp;3</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:seagreen">&lt;corebot`&gt;</span><span class="log-msg"> svanstaa: Current chairs: svanstaa</span></td></tr></table>
<table class="log-line" id="l-4"><tr class="log-row"><td class="log-lineno"><a href="#l-4">&nbsp;&nbsp;4</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:seagreen">&lt;corebot`&gt;</span><span class="log-msg"> svanstaa: Useful commands: #action #info #idea #link #topic #motion #vote #close #endmeeting</span></td></tr></table>
<table class="log-line" id="l-5"><tr class="log-row"><td class="log-lineno"><a href="#l-5">&nbsp;&nbsp;5</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:seagreen">&lt;corebot`&gt;</span><span class="log-msg"> svanstaa: See also: <a href="https://hcoop-meetbot.readthedocs.io/en/stable/" target="blank">https://hcoop-meetbot.readthedocs.io/en/stable/</a></span></td></tr></table>
<table class="log-line" id="l-6"><tr class="log-row"><td class="log-lineno"><a href="#l-6">&nbsp;&nbsp;6</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:seagreen">&lt;corebot`&gt;</span><span class="log-msg"> svanstaa: Participants should now identify themselves with &#39;#here&#39; or with an alias like &#39;#here FirstLast&#39;</span></td></tr></table>
<table class="log-line" id="l-7"><tr class="log-row"><td class="log-lineno"><a href="#l-7">&nbsp;&nbsp;7</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-8"><tr class="log-row"><td class="log-lineno"><a href="#l-8">&nbsp;&nbsp;8</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Hi everyone, and welcome to the Bitcoin Core Review Club, today about the 31.0 Release Testing Guide!</span></td></tr></table>
<table class="log-line" id="l-9"><tr class="log-row"><td class="log-lineno"><a href="#l-9">&nbsp;&nbsp;9</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Thanks you for joining. Even if you are here for the first time, feel free to say hi!</span></td></tr></table>
<table class="log-line" id="l-10"><tr class="log-row"><td class="log-lineno"><a href="#l-10">&nbsp;10</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orange">&lt;itamar30&gt;</span><span class="log-msg"> Hi, first time ever...</span></td></tr></table>
<table class="log-line" id="l-11"><tr class="log-row"><td class="log-lineno"><a href="#l-11">&nbsp;11</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:slateblue">&lt;janb84&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-12"><tr class="log-row"><td class="log-lineno"><a href="#l-12">&nbsp;12</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> woo!</span></td></tr></table>
<table class="log-line" id="l-13"><tr class="log-row"><td class="log-lineno"><a href="#l-13">&nbsp;13</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> Hi, first time :)</span></td></tr></table>
<table class="log-line" id="l-14"><tr class="log-row"><td class="log-lineno"><a href="#l-14">&nbsp;14</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:salmon">&lt;carloantinarella&gt;</span><span class="log-msg"> Hello everyone!</span></td></tr></table>
<table class="log-line" id="l-15"><tr class="log-row"><td class="log-lineno"><a href="#l-15">&nbsp;15</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Great!</span></td></tr></table>
<table class="log-line" id="l-16"><tr class="log-row"><td class="log-lineno"><a href="#l-16">&nbsp;16</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Also, do not ask for permission to speak, just speak up :)</span></td></tr></table>
<table class="log-line" id="l-17"><tr class="log-row"><td class="log-lineno"><a href="#l-17">&nbsp;17</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Here&#39;s the link to the testing guide: <a href="https://github.com/bitcoin-core/bitcoin-devwiki/wiki/31.0-Release-Candidate-Testing-Guide" target="blank">https://github.com/bitcoin-core/bitcoin-devwiki/wiki/31.0-Release-Candidate-Testing-Guide</a></span></td></tr></table>
<table class="log-line" id="l-18"><tr class="log-row"><td class="log-lineno"><a href="#l-18">&nbsp;18</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> I&#39;ve done the steps described in the testing guide, and created an asciinema recording <a href="https://asciinema.org/a/906191" target="blank">https://asciinema.org/a/906191</a></span></td></tr></table>
<table class="log-line" id="l-19"><tr class="log-row"><td class="log-lineno"><a href="#l-19">&nbsp;19</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @sdmg15 that is an innovative way to  go about it</span></td></tr></table>
<table class="log-line" id="l-20"><tr class="log-row"><td class="log-lineno"><a href="#l-20">&nbsp;20</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Lets go through this chapter by chapter</span></td></tr></table>
<table class="log-line" id="l-21"><tr class="log-row"><td class="log-lineno"><a href="#l-21">&nbsp;21</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> First preparations:   <a href="https://github.com/bitcoin-core/bitcoin-devwiki/wiki/31.0-Release-Candidate-Testing-Guide#preparation" target="blank">https://github.com/bitcoin-core/bitcoin-devwiki/wiki/31.0-Release-Candidate-Testing-Guide#preparation</a></span></td></tr></table>
<table class="log-line" id="l-22"><tr class="log-row"><td class="log-lineno"><a href="#l-22">&nbsp;22</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Who had issus or comments on building the client, and setting up the test environment?</span></td></tr></table>
<table class="log-line" id="l-23"><tr class="log-row"><td class="log-lineno"><a href="#l-23">&nbsp;23</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> *issues</span></td></tr></table>
<table class="log-line" id="l-24"><tr class="log-row"><td class="log-lineno"><a href="#l-24">&nbsp;24</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> The steps were laid out clearly for me, nicely done svanstaa</span></td></tr></table>
<table class="log-line" id="l-25"><tr class="log-row"><td class="log-lineno"><a href="#l-25">&nbsp;25</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:salmon">&lt;carloantinarella&gt;</span><span class="log-msg"> I only tried compiling from source, no issues whatsoever</span></td></tr></table>
<table class="log-line" id="l-26"><tr class="log-row"><td class="log-lineno"><a href="#l-26">&nbsp;26</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Great! Ok, lets look at 1. Mempool</span></td></tr></table>
<table class="log-line" id="l-27"><tr class="log-row"><td class="log-lineno"><a href="#l-27">&nbsp;27</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Who did the test? Any issues or peculiar observations?</span></td></tr></table>
<table class="log-line" id="l-28"><tr class="log-row"><td class="log-lineno"><a href="#l-28">&nbsp;28</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> I think the 1.3 Cluster mempool: Cluster Limits Enforcement is the one I struggled testing</span></td></tr></table>
<table class="log-line" id="l-29"><tr class="log-row"><td class="log-lineno"><a href="#l-29">&nbsp;29</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Why did we set up the child txn with a higher fee than the parent?</span></td></tr></table>
<table class="log-line" id="l-30"><tr class="log-row"><td class="log-lineno"><a href="#l-30">&nbsp;30</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @sdmg15. where did you get stuck?</span></td></tr></table>
<table class="log-line" id="l-31"><tr class="log-row"><td class="log-lineno"><a href="#l-31">&nbsp;31</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> (this was the tricky one, I admit)</span></td></tr></table>
<table class="log-line" id="l-32"><tr class="log-row"><td class="log-lineno"><a href="#l-32">&nbsp;32</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> The issue was just that I created a script.sh and then had to export the aliase commands :)</span></td></tr></table>
<table class="log-line" id="l-33"><tr class="log-row"><td class="log-lineno"><a href="#l-33">&nbsp;33</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:slateblue">&lt;janb84&gt;</span><span class="log-msg"> sdmg15: didn&#39;t a simple copy and paste didn&#39;t work ?</span></td></tr></table>
<table class="log-line" id="l-34"><tr class="log-row"><td class="log-lineno"><a href="#l-34">&nbsp;34</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> Haven&#39;t tried copy-pasting, since the script was long I just thought I should put it in a file</span></td></tr></table>
<table class="log-line" id="l-35"><tr class="log-row"><td class="log-lineno"><a href="#l-35">&nbsp;35</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Did it show expected behaviour then?</span></td></tr></table>
<table class="log-line" id="l-36"><tr class="log-row"><td class="log-lineno"><a href="#l-36">&nbsp;36</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> Yes I saw the expected behavior, in my recording too. thanks for the instructions.</span></td></tr></table>
<table class="log-line" id="l-37"><tr class="log-row"><td class="log-lineno"><a href="#l-37">&nbsp;37</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:salmon">&lt;carloantinarella&gt;</span><span class="log-msg"> I also had similar issue with aliases. Aliases are lost if you execute as a separate script. I sourced it instead and it worked fine</span></td></tr></table>
<table class="log-line" id="l-38"><tr class="log-row"><td class="log-lineno"><a href="#l-38">&nbsp;38</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:orange">&lt;itamar30&gt;</span><span class="log-msg"> I first tried copy and paste, but the program stopped and my terminal closed</span></td></tr></table>
<table class="log-line" id="l-39"><tr class="log-row"><td class="log-lineno"><a href="#l-39">&nbsp;39</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:slateblue">&lt;janb84&gt;</span><span class="log-msg"> ok lessens learned for the next guide :) tnx all</span></td></tr></table>
<table class="log-line" id="l-40"><tr class="log-row"><td class="log-lineno"><a href="#l-40">&nbsp;40</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> :)</span></td></tr></table>
<table class="log-line" id="l-41"><tr class="log-row"><td class="log-lineno"><a href="#l-41">&nbsp;41</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> Child txn had a higher fee than the parent to ensure they were merged as a single chunk</span></td></tr></table>
<table class="log-line" id="l-42"><tr class="log-row"><td class="log-lineno"><a href="#l-42">&nbsp;42</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @marcofleon correct!</span></td></tr></table>
<table class="log-line" id="l-43"><tr class="log-row"><td class="log-lineno"><a href="#l-43">&nbsp;43</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> Hoping my terminology is correct...</span></td></tr></table>
<table class="log-line" id="l-44"><tr class="log-row"><td class="log-lineno"><a href="#l-44">&nbsp;44</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @janb84 yes we will keep the test cases simpler next time</span></td></tr></table>
<table class="log-line" id="l-45"><tr class="log-row"><td class="log-lineno"><a href="#l-45">&nbsp;45</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> on to the next one: 2. private broadcast</span></td></tr></table>
<table class="log-line" id="l-46"><tr class="log-row"><td class="log-lineno"><a href="#l-46">&nbsp;46</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> What was this about?</span></td></tr></table>
<table class="log-line" id="l-47"><tr class="log-row"><td class="log-lineno"><a href="#l-47">&nbsp;47</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Quick summary, and observed behaviour?</span></td></tr></table>
<table class="log-line" id="l-48"><tr class="log-row"><td class="log-lineno"><a href="#l-48">&nbsp;48</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> From my understanding it&#39;s help people  broadcast transaction over secured networks like Tor and I2P</span></td></tr></table>
<table class="log-line" id="l-49"><tr class="log-row"><td class="log-lineno"><a href="#l-49">&nbsp;49</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> And you could enforce that to your client by enabling the option</span></td></tr></table>
<table class="log-line" id="l-50"><tr class="log-row"><td class="log-lineno"><a href="#l-50">&nbsp;50</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Correct. How did we test this? It was not the straightforward way</span></td></tr></table>
<table class="log-line" id="l-51"><tr class="log-row"><td class="log-lineno"><a href="#l-51">&nbsp;51</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> That would have been to install and sent out a private transaction on testnet, but we deemed that out of scope for this tutorial</span></td></tr></table>
<table class="log-line" id="l-52"><tr class="log-row"><td class="log-lineno"><a href="#l-52">&nbsp;52</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Cheap solution: just test that the client refuses to sent out any transaction when TOR/I2P is not present while -privatebroadcast is set :)</span></td></tr></table>
<table class="log-line" id="l-53"><tr class="log-row"><td class="log-lineno"><a href="#l-53">&nbsp;53</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Next topic Updated RPCs</span></td></tr></table>
<table class="log-line" id="l-54"><tr class="log-row"><td class="log-lineno"><a href="#l-54">&nbsp;54</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> Good call for the private broadcast test</span></td></tr></table>
<table class="log-line" id="l-55"><tr class="log-row"><td class="log-lineno"><a href="#l-55">&nbsp;55</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> Is it even a thing to connect over tor for regtest? Not sure if i&#39;ve ever tried that</span></td></tr></table>
<table class="log-line" id="l-56"><tr class="log-row"><td class="log-lineno"><a href="#l-56">&nbsp;56</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> Just a local chain, so wouldn&#39;t really make sense</span></td></tr></table>
<table class="log-line" id="l-57"><tr class="log-row"><td class="log-lineno"><a href="#l-57">&nbsp;57</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @marcofleon yes, it would have needed running testnet as well</span></td></tr></table>
<table class="log-line" id="l-58"><tr class="log-row"><td class="log-lineno"><a href="#l-58">&nbsp;58</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> AFAIK, that wouldnt work on regtest</span></td></tr></table>
<table class="log-line" id="l-59"><tr class="log-row"><td class="log-lineno"><a href="#l-59">&nbsp;59</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> that&#39;s why we left that out</span></td></tr></table>
<table class="log-line" id="l-60"><tr class="log-row"><td class="log-lineno"><a href="#l-60">&nbsp;60</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> who ran the test of the updated getblock RPC?</span></td></tr></table>
<table class="log-line" id="l-61"><tr class="log-row"><td class="log-lineno"><a href="#l-61">&nbsp;61</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> I did</span></td></tr></table>
<table class="log-line" id="l-62"><tr class="log-row"><td class="log-lineno"><a href="#l-62">&nbsp;62</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> I&#39;ve given it a try on mainnet</span></td></tr></table>
<table class="log-line" id="l-63"><tr class="log-row"><td class="log-lineno"><a href="#l-63">&nbsp;63</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Nice. Bonus question: why was output of the coinbase_tx object added at logging verbosity level 1?</span></td></tr></table>
<table class="log-line" id="l-64"><tr class="log-row"><td class="log-lineno"><a href="#l-64">&nbsp;64</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:slateblue">&lt;janb84&gt;</span><span class="log-msg"> Miners ?</span></td></tr></table>
<table class="log-line" id="l-65"><tr class="log-row"><td class="log-lineno"><a href="#l-65">&nbsp;65</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> I don&#39;t know what BIP54 is all about, but from the PR it helps making the scan faster?</span></td></tr></table>
<table class="log-line" id="l-66"><tr class="log-row"><td class="log-lineno"><a href="#l-66">&nbsp;66</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> at higher verbosities you would just see the full coinbase tx right?</span></td></tr></table>
<table class="log-line" id="l-67"><tr class="log-row"><td class="log-lineno"><a href="#l-67">&nbsp;67</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> so it made sense to add at level 1 I think</span></td></tr></table>
<table class="log-line" id="l-68"><tr class="log-row"><td class="log-lineno"><a href="#l-68">&nbsp;68</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> It said so in the linked PR#34512: making it easier to check for BIP54 compliance, without an overhead of logging messages</span></td></tr></table>
<table class="log-line" id="l-69"><tr class="log-row"><td class="log-lineno"><a href="#l-69">&nbsp;69</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:seagreen">&lt;corebot`&gt;</span><span class="log-msg"> svanstaa: Error: That URL raised &lt;HTTP Error 404: Not Found&gt;</span></td></tr></table>
<table class="log-line" id="l-70"><tr class="log-row"><td class="log-lineno"><a href="#l-70">&nbsp;70</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> ah nice</span></td></tr></table>
<table class="log-line" id="l-71"><tr class="log-row"><td class="log-lineno"><a href="#l-71">&nbsp;71</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> #34512</span></td></tr></table>
<table class="log-line" id="l-72"><tr class="log-row"><td class="log-lineno"><a href="#l-72">&nbsp;72</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:seagreen">&lt;corebot`&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/issues/34512" target="blank">https://github.com/bitcoin/bitcoin/issues/34512</a> | rpc: add coinbase_tx field to getblock by Sjors · Pull Request #34512 · bitcoin/bitcoin · GitHub</span></td></tr></table>
<table class="log-line" id="l-73"><tr class="log-row"><td class="log-lineno"><a href="#l-73">&nbsp;73</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @marcofleon yes correct, at level 2 too much output of stuff you don&#39;T need for that use case</span></td></tr></table>
<table class="log-line" id="l-74"><tr class="log-row"><td class="log-lineno"><a href="#l-74">&nbsp;74</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @sdmg15 BIP54 is also known as The Great consensus Cleanup. It is a soft fork that solves 4 known bugs</span></td></tr></table>
<table class="log-line" id="l-75"><tr class="log-row"><td class="log-lineno"><a href="#l-75">&nbsp;75</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Looking at the coinbase transaction can identify if the block is BIP54 compliant</span></td></tr></table>
<table class="log-line" id="l-76"><tr class="log-row"><td class="log-lineno"><a href="#l-76">&nbsp;76</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Next chapter 4. txospenderindex</span></td></tr></table>
<table class="log-line" id="l-77"><tr class="log-row"><td class="log-lineno"><a href="#l-77">&nbsp;77</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> Last I heard it&#39;s just Consensus Cleanup these days. But still great to me at least</span></td></tr></table>
<table class="log-line" id="l-78"><tr class="log-row"><td class="log-lineno"><a href="#l-78">&nbsp;78</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @marcofleon haha, was it renamed? Didnt notice. I thinnk Consensus cleanup works just as well :)</span></td></tr></table>
<table class="log-line" id="l-79"><tr class="log-row"><td class="log-lineno"><a href="#l-79">&nbsp;79</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Who tried activating -txospenderindex? What is it good for?</span></td></tr></table>
<table class="log-line" id="l-80"><tr class="log-row"><td class="log-lineno"><a href="#l-80">&nbsp;80</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:salmon">&lt;carloantinarella&gt;</span><span class="log-msg"> -txospenderindex should be good for second layer protocols. Also in this case motivation is clearly explained in the PR introducing it</span></td></tr></table>
<table class="log-line" id="l-81"><tr class="log-row"><td class="log-lineno"><a href="#l-81">&nbsp;81</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> The PR is from 2022 wow</span></td></tr></table>
<table class="log-line" id="l-82"><tr class="log-row"><td class="log-lineno"><a href="#l-82">&nbsp;82</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @carloantir . yes, correct. As it should be in any good PR :)</span></td></tr></table>
<table class="log-line" id="l-83"><tr class="log-row"><td class="log-lineno"><a href="#l-83">&nbsp;83</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> only took four years 😅</span></td></tr></table>
<table class="log-line" id="l-84"><tr class="log-row"><td class="log-lineno"><a href="#l-84">&nbsp;84</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> move slow and don&#39;t break things :)</span></td></tr></table>
<table class="log-line" id="l-85"><tr class="log-row"><td class="log-lineno"><a href="#l-85">&nbsp;85</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> The index keeps track of which txs spent which outpoints  yes?</span></td></tr></table>
<table class="log-line" id="l-86"><tr class="log-row"><td class="log-lineno"><a href="#l-86">&nbsp;86</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> yes, correct</span></td></tr></table>
<table class="log-line" id="l-87"><tr class="log-row"><td class="log-lineno"><a href="#l-87">&nbsp;87</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> I&#39;ve been syncing it for the last couple hours on my node :)</span></td></tr></table>
<table class="log-line" id="l-88"><tr class="log-row"><td class="log-lineno"><a href="#l-88">&nbsp;88</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> only 300k blocks to go</span></td></tr></table>
<table class="log-line" id="l-89"><tr class="log-row"><td class="log-lineno"><a href="#l-89">&nbsp;89</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Nice, it can take a few hours</span></td></tr></table>
<table class="log-line" id="l-90"><tr class="log-row"><td class="log-lineno"><a href="#l-90">&nbsp;90</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> who  has it synced completely already?</span></td></tr></table>
<table class="log-line" id="l-91"><tr class="log-row"><td class="log-lineno"><a href="#l-91">&nbsp;91</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:salmon">&lt;carloantinarella&gt;</span><span class="log-msg"> Is it independent from -txindex?</span></td></tr></table>
<table class="log-line" id="l-92"><tr class="log-row"><td class="log-lineno"><a href="#l-92">&nbsp;92</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @carloantir yes, that is a different index.  You can both on and off independently from each other</span></td></tr></table>
<table class="log-line" id="l-93"><tr class="log-row"><td class="log-lineno"><a href="#l-93">&nbsp;93</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> *turn both</span></td></tr></table>
<table class="log-line" id="l-94"><tr class="log-row"><td class="log-lineno"><a href="#l-94">&nbsp;94</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> (ok, this was a trick question, as syncing the txospenderindex is a prerequisite for running the tests)</span></td></tr></table>
<table class="log-line" id="l-95"><tr class="log-row"><td class="log-lineno"><a href="#l-95">&nbsp;95</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> should have warned earlier that this is best run overnight :)</span></td></tr></table>
<table class="log-line" id="l-96"><tr class="log-row"><td class="log-lineno"><a href="#l-96">&nbsp;96</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> ok, on to  section 5: Settings</span></td></tr></table>
<table class="log-line" id="l-97"><tr class="log-row"><td class="log-lineno"><a href="#l-97">&nbsp;97</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> who fiddled with the dbcache settings? What is it for anyway?</span></td></tr></table>
<table class="log-line" id="l-98"><tr class="log-row"><td class="log-lineno"><a href="#l-98">&nbsp;98</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:salmon">&lt;carloantinarella&gt;</span><span class="log-msg"> I think this is an update due to the fact that more than 4096 MiB of RAM is now very common</span></td></tr></table>
<table class="log-line" id="l-99"><tr class="log-row"><td class="log-lineno"><a href="#l-99">&nbsp;99</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:slateblue">&lt;janb84&gt;</span><span class="log-msg"> carloantinarella: that has been quite a debate, if having more ram is common ;)</span></td></tr></table>
<table class="log-line" id="l-100"><tr class="log-row"><td class="log-lineno"><a href="#l-100">100</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @carloantir Yes, correct. The 450MB size has been around for many years, hardware has advanced</span></td></tr></table>
<table class="log-line" id="l-101"><tr class="log-row"><td class="log-lineno"><a href="#l-101">101</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:salmon">&lt;carloantinarella&gt;</span><span class="log-msg"> I love debates, but I lost this one &#39;=D</span></td></tr></table>
<table class="log-line" id="l-102"><tr class="log-row"><td class="log-lineno"><a href="#l-102">102</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> Any unusual or unexpected behaviour observed here?</span></td></tr></table>
<table class="log-line" id="l-103"><tr class="log-row"><td class="log-lineno"><a href="#l-103">103</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> the new default is 1024?</span></td></tr></table>
<table class="log-line" id="l-104"><tr class="log-row"><td class="log-lineno"><a href="#l-104">104</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> yes, correct</span></td></tr></table>
<table class="log-line" id="l-105"><tr class="log-row"><td class="log-lineno"><a href="#l-105">105</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> on to <a href="https://github.com/bitcoin-core/bitcoin-devwiki/wiki/31.0-Release-Candidate-Testing-Guide#52-embedded-asmap--asmap-now-loads-bundled-data" target="blank">https://github.com/bitcoin-core/bitcoin-devwiki/wiki/31.0-Release-Candidate-Testing-Guide#52-embedded-asmap--asmap-now-loads-bundled-data</a></span></td></tr></table>
<table class="log-line" id="l-106"><tr class="log-row"><td class="log-lineno"><a href="#l-106">106</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:sienna">&lt;marcofleon&gt;</span><span class="log-msg"> I&#39;m not sure what&#39;s optimal, but I&#39;ll usually set dbcache to half my ram for ibd, and then set it to 1024 (even before this update)</span></td></tr></table>
<table class="log-line" id="l-107"><tr class="log-row"><td class="log-lineno"><a href="#l-107">107</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:seagreen">&lt;corebot`&gt;</span><span class="log-msg"> svanstaa: Error: That URL raised &lt;HTTP Error 404: Not Found&gt;</span></td></tr></table>
<table class="log-line" id="l-108"><tr class="log-row"><td class="log-lineno"><a href="#l-108">108</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @marcofleon those look like sensible values</span></td></tr></table>
<table class="log-line" id="l-109"><tr class="log-row"><td class="log-lineno"><a href="#l-109">109</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> who tried the -asmap option in 5.2? What does it change?</span></td></tr></table>
<table class="log-line" id="l-110"><tr class="log-row"><td class="log-lineno"><a href="#l-110">110</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> I struggle understanding what are asmaps useful for but yeah I did run the tests</span></td></tr></table>
<table class="log-line" id="l-111"><tr class="log-row"><td class="log-lineno"><a href="#l-111">111</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> The main reason in too make eclipse attacks more difficult</span></td></tr></table>
<table class="log-line" id="l-112"><tr class="log-row"><td class="log-lineno"><a href="#l-112">112</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> If you chose your peers wisely (from all different corner of the web), it will become impossible for an attacker to eclipse you by spinning up hundreds of malicious nodes on e.g. AWS</span></td></tr></table>
<table class="log-line" id="l-113"><tr class="log-row"><td class="log-lineno"><a href="#l-113">113</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> Oh I see interesting</span></td></tr></table>
<table class="log-line" id="l-114"><tr class="log-row"><td class="log-lineno"><a href="#l-114">114</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:teal">&lt;sipa&gt;</span><span class="log-msg"> sdmg15: it&#39;s basically a &quot;map of the internet&quot;, with information about what organizations (ISPs, hosting providers, companies, ...) control which ranges of IP addresses. By being aware of this information, Bitcoin Core can bias its connection making in a way such that the connections are to diverse sets of organizations, making it harder for a single one or a small number from dominating all</span></td></tr></table>
<table class="log-line" id="l-115"><tr class="log-row"><td class="log-lineno"><a href="#l-115">115</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:teal">&lt;sipa&gt;</span><span class="log-msg"> information you see</span></td></tr></table>
<table class="log-line" id="l-116"><tr class="log-row"><td class="log-lineno"><a href="#l-116">116</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> It has now become a more permanent feature, with the ASMAP data collected for that release baked into the binaries</span></td></tr></table>
<table class="log-line" id="l-117"><tr class="log-row"><td class="log-lineno"><a href="#l-117">117</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:peru">&lt;sdmg15&gt;</span><span class="log-msg"> It&#39;s clear now thanks.</span></td></tr></table>
<table class="log-line" id="l-118"><tr class="log-row"><td class="log-lineno"><a href="#l-118">118</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:salmon">&lt;carloantinarella&gt;</span><span class="log-msg"> Does it also speed up txs propagation over the network because of geographical diversity?</span></td></tr></table>
<table class="log-line" id="l-119"><tr class="log-row"><td class="log-lineno"><a href="#l-119">119</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @carloantir that also seems possible, but not completely sure</span></td></tr></table>
<table class="log-line" id="l-120"><tr class="log-row"><td class="log-lineno"><a href="#l-120">120</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> maybe @fjahr can chime in  later</span></td></tr></table>
<table class="log-line" id="l-121"><tr class="log-row"><td class="log-lineno"><a href="#l-121">121</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:teal">&lt;sipa&gt;</span><span class="log-msg"> carloantinarella: unlikely, i think; propagation speed is dominated by the few fastest connections you have</span></td></tr></table>
<table class="log-line" id="l-122"><tr class="log-row"><td class="log-lineno"><a href="#l-122">122</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> @sipa thanks for clarification!</span></td></tr></table>
<table class="log-line" id="l-123"><tr class="log-row"><td class="log-lineno"><a href="#l-123">123</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:teal">&lt;sipa&gt;</span><span class="log-msg"> and in general, eclipse resistance is in conflict with propagation speed - for fast propagation you ideally want few connections to the fastest nodes possible, rather than many diverse ones</span></td></tr></table>
<table class="log-line" id="l-124"><tr class="log-row"><td class="log-lineno"><a href="#l-124">124</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> That&#39;s it for today. Thaks you all for joining. Of course you can continue to discuss here, I will come back later to check for open questions</span></td></tr></table>
<table class="log-line" id="l-125"><tr class="log-row"><td class="log-lineno"><a href="#l-125">125</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:red">&lt;svanstaa&gt;</span><span class="log-msg"> #endmeeting</span></td></tr></table>]]></content><author><name>svanstaa</name></author><summary type="html"><![CDATA[Notes]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bitcoincore.reviews/assets/img/twitter_card.png" /><media:content medium="image" url="https://bitcoincore.reviews/assets/img/twitter_card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Compact block harness</title><link href="https://bitcoincore.reviews/33300" rel="alternate" type="text/html" title="Compact block harness" /><published>2025-10-08T00:00:00+00:00</published><updated>2025-10-08T00:00:00+00:00</updated><id>https://bitcoincore.reviews/#33300</id><content type="html" xml:base="https://bitcoincore.reviews/33300"><![CDATA[<h2 id="notes">Notes</h2>

<ul>
  <li>
    <p>This PR adds a <a href="#fuzz-testing">fuzz harness</a> for testing <a href="#compact-blocks-protocol-overview">compact block relay</a>, along with a few test infrastructure changes to improve speed and stability. Earlier review clubs on fuzzing include: <a href="./17860">#17860</a>, <a href="./18521">#18521</a>, <a href="./21142">#21142</a>, <a href="./30605">#30605</a>.</p>
  </li>
  <li>
    <p>The harness simulates P2P network behavior by having three peers send various messages (CMPCTBLOCK, BLOCKTXN, HEADERS, SENDCMPCT, TX) to the test node, triggering its compact block logic.</p>
  </li>
  <li>
    <p>The goal is to find bugs and ensure assertions hold. See <a href="https://github.com/bitcoin/bitcoin/pull/33296">#33296</a> for an example of a bug found by this very fuzz test. Nice!</p>
  </li>
</ul>

<h3 id="compact-blocks-protocol-overview">Compact Blocks Protocol Overview</h3>

<ul>
  <li>
    <p><a href="https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki">BIP 152</a> introduced the <a href="https://bitcoinops.org/en/topics/compact-block-relay/">compact block relay protocol</a>, which reduces bandwidth and latency when propagating blocks by sending an encoded version of a block under the assumption that most of the transactions are already in our peer’s mempool.</p>
  </li>
  <li>Compact blocks consist of:
    <ul>
      <li>A header</li>
      <li>Short transaction identifiers (6 bytes instead of 32 bytes)</li>
      <li>Prefilled transactions
        <ul>
          <li>A vector where each entry is a differentially-encoded <code class="language-plaintext highlighter-rouge">uint16_t</code> index and the complete serialized transaction.</li>
          <li>The current code only prefills the coinbase. However, the protocol allows for the inclusion of other transactions that we might expect our peer is missing. See this <a href="https://github.com/bitcoin/bitcoin/blob/1ed00a0d39d5190d8ad88a0dd705a09b56d987aa/src/blockencodings.cpp#L24"><code class="language-plaintext highlighter-rouge">TODO</code></a>.</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>
    <p>The receiving node reconstructs the block using transactions from its mempool. If any transactions are missing, it requests them via a <code class="language-plaintext highlighter-rouge">GETBLOCKTXN</code> message.</p>
  </li>
  <li>There are two modes:
    <ul>
      <li>low-bandwidth: block sent only after peer requests it via <code class="language-plaintext highlighter-rouge">INV</code>/<code class="language-plaintext highlighter-rouge">GETDATA</code></li>
      <li>high-bandwidth: block sent to peers without request as soon as it is received, even before full validation is completed</li>
    </ul>
  </li>
</ul>

<h3 id="fuzz-testing">Fuzz Testing</h3>

<ul>
  <li>
    <p>Fuzzing is a testing technique that provides quasi-random inputs to code to discover bugs and unexpected behavior. Fuzzers use feedback like code coverage as a guide for mutation of those inputs, allowing them to explore deeper paths within the target code.</p>
  </li>
  <li>
    <p>See our <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md">fuzzing docs</a> to start fuzzing with libFuzzer and AFL++.</p>
  </li>
  <li>
    <p>Check out this PR’s <a href="https://marcofleon.github.io/coverage/cmpctblock/">test coverage</a> (<code class="language-plaintext highlighter-rouge">blockencodings.cpp</code> and <code class="language-plaintext highlighter-rouge">net_processing.cpp</code> are probably most useful to look at). Walking through a coverage report to see which branches are hit or not hit is a good way to start evaluating a fuzz harness.</p>
  </li>
  <li>
    <p>An effective fuzz test should be deterministic, to make bugs reproducible. If you’re able to get the AFL++ fuzzer running, you will see a stability metric. The goal is to get to 100%, perfect determinism! After gathering some inputs, you can also run the <a href="https://github.com/bitcoin/bitcoin/blob/master/contrib/devtools/deterministic-fuzz-coverage/src/main.rs">fuzz determinism script</a> over the corpus to check for potential sources of instability.</p>
  </li>
  <li>
    <p>The faster (more iterations per second) a fuzz harness is, the more quickly it will discover new code paths and potential bugs. You’ll see this metric as exec/s when fuzzing. Any operation that significantly slows down an iteration (like reading from and writing to disk) should be optimized or avoided if possible.</p>
  </li>
</ul>

<h2 id="fun-exercise">Fun Exercise</h2>

<ul>
  <li>
    <p>If you get the <code class="language-plaintext highlighter-rouge">cmpctblock</code> harness running, revert PR <a href="https://github.com/bitcoin/bitcoin/pull/33296">#33296</a> and see if you can reproduce the crash on this <a href="https://github.com/bitcoin/bitcoin/blob/689a32197638e92995dd8eb071425715f5fdc3a4/src/net_processing.cpp#L3333"><code class="language-plaintext highlighter-rouge">Assume</code></a> statement.</p>
  </li>
  <li>
    <p>Yeah I know, fuzzing is cool.</p>
  </li>
</ul>

<h2 id="questions">Questions</h2>

<ol>
  <li>
    <p>Did you review the PR? Concept ACK, approach ACK, tested ACK, or NACK? What was your review approach? Were you able to get the fuzz test running?</p>
  </li>
  <li>
    <p>Where in the codebase are the main compact block helpers and processing logic? Name some of the relevant classes and functions. (Hint: nothing like a little search for <code class="language-plaintext highlighter-rouge">NetMsgType::CMPCTBLOCK</code> to get you started)</p>
  </li>
  <li>
    <p>The fuzz test sends <code class="language-plaintext highlighter-rouge">SENDCMPCT</code> messages with <code class="language-plaintext highlighter-rouge">high_bandwidth</code> randomly set. How many high bandwidth peers are allowed and does the fuzz harness test this limit? More generally, why would a peer choose to be high or low bandwidth?</p>
  </li>
  <li>
    <p>Compare <code class="language-plaintext highlighter-rouge">-testdatadir</code> and the new <code class="language-plaintext highlighter-rouge">-fuzzcopydatadir</code>. Why is the latter useful for performance, and why isn’t a fresh <code class="language-plaintext highlighter-rouge">TestingSetup</code> that mines blocks on each iteration acceptable here?</p>
  </li>
  <li>
    <p>Look at <code class="language-plaintext highlighter-rouge">create_block</code> in the harness. How many transactions do the generated blocks contain, and where do they come from? What compact block scenarios might be missed with only a few transactions in a block?</p>
  </li>
  <li>
    <p>In commit <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/254e13cd442a7a0fbb32ed6d9d20202d7eacfff9">254e13c</a> <code class="language-plaintext highlighter-rouge">FinalizeHeader</code> is moved to <code class="language-plaintext highlighter-rouge">util.h</code> so it can be used by any fuzz test. What is the purpose of this function and why doesn’t it slow down the fuzzer?</p>
  </li>
  <li>
    <p>Commit <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/ed813c48f826d083becf93c741b483774c850c86">ed813c4</a> sorts <code class="language-plaintext highlighter-rouge">m_dirty_blockindex</code> by block hash instead of pointer address. What non-determinism does this fix?  The author <a href="https://github.com/bitcoin/bitcoin/pull/33300#issuecomment-3308381089">notes</a> this slows production code for no production benefit. Why can’t <a href="https://github.com/bitcoin/bitcoin/blob/acc7f2a433b131597124ba0fbbe9952c4d36a872/src/util/check.h#L34"><code class="language-plaintext highlighter-rouge">EnableFuzzDeterminism()</code></a> be used here? How do you think this non-determinism should be best handled (if not the way the PR currently does)?</p>
  </li>
  <li>
    <p>The harness adds prefilled transactions to a compact block beyond the coinbase. Walk through the index calculations for prefilling transactions at indices 1 and 3 in a 4-transaction block. Do you think this code could be simplified or cleaned up, and if so, what do you suggest?</p>
  </li>
</ol>

<h2 id="meeting-log">Meeting Log</h2>

<table class="log-line" id="l-1"><tr class="log-row"><td class="log-lineno"><a href="#l-1">&nbsp;&nbsp;1</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> #startmeeting</span></td></tr></table>
<table class="log-line" id="l-2"><tr class="log-row"><td class="log-lineno"><a href="#l-2">&nbsp;&nbsp;2</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:chocolate">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Meeting started at 2025-10-08T17:00+0000</span></td></tr></table>
<table class="log-line" id="l-3"><tr class="log-row"><td class="log-lineno"><a href="#l-3">&nbsp;&nbsp;3</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:chocolate">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Current chairs: marcofleon</span></td></tr></table>
<table class="log-line" id="l-4"><tr class="log-row"><td class="log-lineno"><a href="#l-4">&nbsp;&nbsp;4</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:chocolate">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Useful commands: #action #info #idea #link #topic #motion #vote #close #endmeeting</span></td></tr></table>
<table class="log-line" id="l-5"><tr class="log-row"><td class="log-lineno"><a href="#l-5">&nbsp;&nbsp;5</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:chocolate">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: See also: <a href="https://hcoop-meetbot.readthedocs.io/en/stable/" target="blank">https://hcoop-meetbot.readthedocs.io/en/stable/</a></span></td></tr></table>
<table class="log-line" id="l-6"><tr class="log-row"><td class="log-lineno"><a href="#l-6">&nbsp;&nbsp;6</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:chocolate">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Participants should now identify themselves with &#39;#here&#39; or with an alias like &#39;#here FirstLast&#39;</span></td></tr></table>
<table class="log-line" id="l-7"><tr class="log-row"><td class="log-lineno"><a href="#l-7">&nbsp;&nbsp;7</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> hey everyone!</span></td></tr></table>
<table class="log-line" id="l-8"><tr class="log-row"><td class="log-lineno"><a href="#l-8">&nbsp;&nbsp;8</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> hi!</span></td></tr></table>
<table class="log-line" id="l-9"><tr class="log-row"><td class="log-lineno"><a href="#l-9">&nbsp;&nbsp;9</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> Hi!</span></td></tr></table>
<table class="log-line" id="l-10"><tr class="log-row"><td class="log-lineno"><a href="#l-10">&nbsp;10</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:crimson">&lt;kevkevin&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-11"><tr class="log-row"><td class="log-lineno"><a href="#l-11">&nbsp;11</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-12"><tr class="log-row"><td class="log-lineno"><a href="#l-12">&nbsp;12</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> hello!</span></td></tr></table>
<table class="log-line" id="l-13"><tr class="log-row"><td class="log-lineno"><a href="#l-13">&nbsp;13</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:firebrick">&lt;danielabrozzoni&gt;</span><span class="log-msg"> hi :)</span></td></tr></table>
<table class="log-line" id="l-14"><tr class="log-row"><td class="log-lineno"><a href="#l-14">&nbsp;14</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> we&#39;re reviewing #33300 today</span></td></tr></table>
<table class="log-line" id="l-15"><tr class="log-row"><td class="log-lineno"><a href="#l-15">&nbsp;15</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:chocolate">&lt;corebot`&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/issues/33300" target="blank">https://github.com/bitcoin/bitcoin/issues/33300</a> | fuzz: compact block harness by Crypt-iQ · Pull Request #33300 · bitcoin/bitcoin · GitHub</span></td></tr></table>
<table class="log-line" id="l-16"><tr class="log-row"><td class="log-lineno"><a href="#l-16">&nbsp;16</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> feel free to jump in whenever as we go through the questions, or circle back to previous ones, etc</span></td></tr></table>
<table class="log-line" id="l-17"><tr class="log-row"><td class="log-lineno"><a href="#l-17">&nbsp;17</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> okay first one</span></td></tr></table>
<table class="log-line" id="l-18"><tr class="log-row"><td class="log-lineno"><a href="#l-18">&nbsp;18</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:blue">&lt;yuvicc&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-19"><tr class="log-row"><td class="log-lineno"><a href="#l-19">&nbsp;19</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Did you review the PR? Concept ACK, approach ACK, tested ACK, or NACK? What was your review approach? Were you able to get the fuzz test running?</span></td></tr></table>
<table class="log-line" id="l-20"><tr class="log-row"><td class="log-lineno"><a href="#l-20">&nbsp;20</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> if anyone&#39;s new the review club today, feel free to say hi - even if you&#39;re just lurking!</span></td></tr></table>
<table class="log-line" id="l-21"><tr class="log-row"><td class="log-lineno"><a href="#l-21">&nbsp;21</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> oh yeah^</span></td></tr></table>
<table class="log-line" id="l-22"><tr class="log-row"><td class="log-lineno"><a href="#l-22">&nbsp;22</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:crimson">&lt;kevkevin&gt;</span><span class="log-msg"> I did not read the PR but I am lurking today!</span></td></tr></table>
<table class="log-line" id="l-23"><tr class="log-row"><td class="log-lineno"><a href="#l-23">&nbsp;23</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> lurkers are welcome</span></td></tr></table>
<table class="log-line" id="l-24"><tr class="log-row"><td class="log-lineno"><a href="#l-24">&nbsp;24</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:blue">&lt;yuvicc&gt;</span><span class="log-msg"> same here</span></td></tr></table>
<table class="log-line" id="l-25"><tr class="log-row"><td class="log-lineno"><a href="#l-25">&nbsp;25</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> while trying to get the fuzz test running on mac, i ran into a couple of compile-time and runtime issues. small write-up for the compile fix here: <a href="https://stringintech.github.io/blog/p/fuzzing-bitcoin-core-using-afl-on-apple-silicon" target="blank">https://stringintech.github.io/blog/p/fuzzing-bitcoin-core-using-afl-on-apple-silicon</a> . i will try to enhance/extend it once i wrap my head around the runtime issues (reported one on the PR page).</span></td></tr></table>
<table class="log-line" id="l-26"><tr class="log-row"><td class="log-lineno"><a href="#l-26">&nbsp;26</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> and a very light review. mostly to see how random input bytes turn into meaningful data for this fuzz test.</span></td></tr></table>
<table class="log-line" id="l-27"><tr class="log-row"><td class="log-lineno"><a href="#l-27">&nbsp;27</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:firebrick">&lt;danielabrozzoni&gt;</span><span class="log-msg"> Concept ACK, I am still finishing my review :) I looked at commits one by one, trying to understand why each change was needed. I was able to run the fuzz tests.</span></td></tr></table>
<table class="log-line" id="l-28"><tr class="log-row"><td class="log-lineno"><a href="#l-28">&nbsp;28</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> Concept ACK, I lightly read `strc/test/fuzz/cmpctblock.cpp` and got the fuzz test running</span></td></tr></table>
<table class="log-line" id="l-29"><tr class="log-row"><td class="log-lineno"><a href="#l-29">&nbsp;29</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> i was able to review a bit run the fuzz test. generally ack but have sociwmae fuzz related conceptual questions.</span></td></tr></table>
<table class="log-line" id="l-30"><tr class="log-row"><td class="log-lineno"><a href="#l-30">&nbsp;30</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> a couple*</span></td></tr></table>
<table class="log-line" id="l-31"><tr class="log-row"><td class="log-lineno"><a href="#l-31">&nbsp;31</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> also get in my usual cycle of not fuzzing for long enough and then no longer being able to get it to compile on macos arm</span></td></tr></table>
<table class="log-line" id="l-32"><tr class="log-row"><td class="log-lineno"><a href="#l-32">&nbsp;32</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> stringintech: nice, yeah I saw your comments. I still need to look into it more to understand but I do wonder why that wasn&#39;t showing up on linux</span></td></tr></table>
<table class="log-line" id="l-33"><tr class="log-row"><td class="log-lineno"><a href="#l-33">&nbsp;33</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> cool so we got people fuzzing!</span></td></tr></table>
<table class="log-line" id="l-34"><tr class="log-row"><td class="log-lineno"><a href="#l-34">&nbsp;34</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> marcofleon: yeah, that was also confusing for me...</span></td></tr></table>
<table class="log-line" id="l-35"><tr class="log-row"><td class="log-lineno"><a href="#l-35">&nbsp;35</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Did anybody get to trying the exercise?</span></td></tr></table>
<table class="log-line" id="l-36"><tr class="log-row"><td class="log-lineno"><a href="#l-36">&nbsp;36</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> I just think it&#39;s fun to see a crash, that&#39;s why I ask</span></td></tr></table>
<table class="log-line" id="l-37"><tr class="log-row"><td class="log-lineno"><a href="#l-37">&nbsp;37</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> concept ACK, spent too much time thinking about the (not very elegant, but maybe necessary) new startup option to copy datadirs</span></td></tr></table>
<table class="log-line" id="l-38"><tr class="log-row"><td class="log-lineno"><a href="#l-38">&nbsp;38</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> monlovesmango: feel free to ask fuzz related questions whenever, I can try my best to answer</span></td></tr></table>
<table class="log-line" id="l-39"><tr class="log-row"><td class="log-lineno"><a href="#l-39">&nbsp;39</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> stickies-v:  yeah agreed that part was a bit confusing to me too. We&#39;ll get into it</span></td></tr></table>
<table class="log-line" id="l-40"><tr class="log-row"><td class="log-lineno"><a href="#l-40">&nbsp;40</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> okay second q</span></td></tr></table>
<table class="log-line" id="l-41"><tr class="log-row"><td class="log-lineno"><a href="#l-41">&nbsp;41</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Where in the codebase are the main compact block helpers and processing logic? Name some of the relevant classes and functions. (Hint: nothing like a little search for NetMsgType::CMPCTBLOCK to get you started)</span></td></tr></table>
<table class="log-line" id="l-42"><tr class="log-row"><td class="log-lineno"><a href="#l-42">&nbsp;42</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:firebrick">&lt;danielabrozzoni&gt;</span><span class="log-msg"> I tried to see it crash, but couldn&#39;t reproduce! It might be that I haven&#39;t run the fuzzer for long enough, and my exec/sec are quite low</span></td></tr></table>
<table class="log-line" id="l-43"><tr class="log-row"><td class="log-lineno"><a href="#l-43">&nbsp;43</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> well I don&#39;t want to derail anything but usually with fuzz tests you see asserts everywhere, but here I didn&#39;t see any. so my question is where/how are we asserting that results are expected?</span></td></tr></table>
<table class="log-line" id="l-44"><tr class="log-row"><td class="log-lineno"><a href="#l-44">&nbsp;44</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> marcofleon: i could not unfortunately. blocked by the runtime issues. but had a question on this... how much the initial input we start with matters?</span></td></tr></table>
<table class="log-line" id="l-45"><tr class="log-row"><td class="log-lineno"><a href="#l-45">&nbsp;45</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> danielabrozzoni: I had that thought after the notes went up unfortunately... &quot;oh maybe it needs to run too long to actually reproduce&quot;</span></td></tr></table>
<table class="log-line" id="l-46"><tr class="log-row"><td class="log-lineno"><a href="#l-46">&nbsp;46</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Okay in terms of the asserts, I think this harness is meant to be catching assumes/asserts we have in production code</span></td></tr></table>
<table class="log-line" id="l-47"><tr class="log-row"><td class="log-lineno"><a href="#l-47">&nbsp;47</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> just generally testing compact block logic. But that&#39;s good that you&#39;re thinking about that monlovesmango because yeah in general you want good oracles for fuzz tests</span></td></tr></table>
<table class="log-line" id="l-48"><tr class="log-row"><td class="log-lineno"><a href="#l-48">&nbsp;48</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> marcofleon: `PeerManagerImpl::NewPoWValidBlock` creates a `NetMsgType::CMPCTBLOCK` message and through `m_connman.ForEachNode` sends it to our high-bandwidth peers</span></td></tr></table>
<table class="log-line" id="l-49"><tr class="log-row"><td class="log-lineno"><a href="#l-49">&nbsp;49</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> The `PartiallyDownloadedBlock` class for all of the compact block construction object stuff, and a lot of the logic is inside of the `ProcessMessage` NetMsgType::CMPCTBLOCK case</span></td></tr></table>
<table class="log-line" id="l-50"><tr class="log-row"><td class="log-lineno"><a href="#l-50">&nbsp;50</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> and then stickies, initial input doesn&#39;t matter, the fuzzer will find its way</span></td></tr></table>
<table class="log-line" id="l-51"><tr class="log-row"><td class="log-lineno"><a href="#l-51">&nbsp;51</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> it seemed like class CBlockHeaderAndShortTxIDs in blockencodings.h was putting together the compact block message. is that the question?</span></td></tr></table>
<table class="log-line" id="l-52"><tr class="log-row"><td class="log-lineno"><a href="#l-52">&nbsp;52</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:firebrick">&lt;danielabrozzoni&gt;</span><span class="log-msg"> marcofleon: Ah, got it! I&#39;ll try to run it for longer, just for fun. Maybe I could also modify the harness so that it will get to the crash quicker, as an exercise </span></td></tr></table>
<table class="log-line" id="l-53"><tr class="log-row"><td class="log-lineno"><a href="#l-53">&nbsp;53</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> unless you need very specific strings for serialization or network things etc... so I guess it can matter. but not too often afaik</span></td></tr></table>
<table class="log-line" id="l-54"><tr class="log-row"><td class="log-lineno"><a href="#l-54">&nbsp;54</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> marcofleon: aahhh that makes a lot of sense thanks!</span></td></tr></table>
<table class="log-line" id="l-55"><tr class="log-row"><td class="log-lineno"><a href="#l-55">&nbsp;55</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> thanks!</span></td></tr></table>
<table class="log-line" id="l-56"><tr class="log-row"><td class="log-lineno"><a href="#l-56">&nbsp;56</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> for question 2: this might be way too simplified but seems we can divide main parts into 3 categories:</span></td></tr></table>
<table class="log-line" id="l-57"><tr class="log-row"><td class="log-lineno"><a href="#l-57">&nbsp;57</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> 1) SEND a peer a cmpct block in HIGH bandwidth mode: in `PeerManagerImpl::NewPoWValidBlock()` callback (triggered by `ChainstateManager::AcceptBlock()`) and in `PeerManagerImpl::SendMessages()` (in case not already sent the cmpct block in `PeerManagerImpl::NewPoWValidBlock()` to this peer)</span></td></tr></table>
<table class="log-line" id="l-58"><tr class="log-row"><td class="log-lineno"><a href="#l-58">&nbsp;58</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> 2) SEND a peer a cmpct block in LOW bandwidth mode: process peer cmpct block request in `PeerManagerImpl::ProcessGetBlockData()` and potentially read the block from disk and construct the cmpct block - if not already done - and send it; constructing the cmpct block happens through `CBlockHeaderAndShortTxIDs` constructor in blockencodings.cpp</span></td></tr></table>
<table class="log-line" id="l-59"><tr class="log-row"><td class="log-lineno"><a href="#l-59">&nbsp;59</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> 3) RECEIVE a cmpct block from a peer: in `PeerManagerImpl::ProcessMessage()` processing `NetMsgType::CMPCTBLOCK` msg type, we process the cmpct block sent to us and try to construct the full block using txns in our mempool (using `PartiallyDownloadedBlock::InitData()` in blockencodings.cpp) and potentially send a `NetMsgType::GETBLOCKTXN` msg to</span></td></tr></table>
<table class="log-line" id="l-60"><tr class="log-row"><td class="log-lineno"><a href="#l-60">&nbsp;60</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> the same peer for the txns we did not have where we can later process the response in `PeerManagerImpl::ProcessCompactBlockTxns()` and finally call `PartiallyDownloadedBlock::FillBlock()` to see if we have the full block now.</span></td></tr></table>
<table class="log-line" id="l-61"><tr class="log-row"><td class="log-lineno"><a href="#l-61">&nbsp;61</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Yeah that question was just to get people going through the compact block code</span></td></tr></table>
<table class="log-line" id="l-62"><tr class="log-row"><td class="log-lineno"><a href="#l-62">&nbsp;62</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> in (1) and (2) peer may respond with a `NetMsgType::GETBLOCKTXN` msg where we potentially send the requested txns of the block in `PeerManagerImpl::SendBlockTransactions()`</span></td></tr></table>
<table class="log-line" id="l-63"><tr class="log-row"><td class="log-lineno"><a href="#l-63">&nbsp;63</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> seems like you all got it</span></td></tr></table>
<table class="log-line" id="l-64"><tr class="log-row"><td class="log-lineno"><a href="#l-64">&nbsp;64</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:firebrick">&lt;danielabrozzoni&gt;</span><span class="log-msg"> Also `MaybeSetPeerAsAnnouncingHeaderAndIDs` takes care of switching a peer to high bandwidth mode, and if we have too many high bandwidth peers, downgrading a differernt one to low bandwidth</span></td></tr></table>
<table class="log-line" id="l-65"><tr class="log-row"><td class="log-lineno"><a href="#l-65">&nbsp;65</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Nice yes. Should we move on, I don&#39;t think I see any errors in the answers?</span></td></tr></table>
<table class="log-line" id="l-66"><tr class="log-row"><td class="log-lineno"><a href="#l-66">&nbsp;66</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> The fuzz test sends SENDCMPCT messages with high_bandwidth randomly set. How many high bandwidth peers are allowed and does the fuzz harness test this limit? More generally, why would a peer choose to be high or low bandwidth?</span></td></tr></table>
<table class="log-line" id="l-67"><tr class="log-row"><td class="log-lineno"><a href="#l-67">&nbsp;67</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> there is no limit to how many peers select us as a HB peer, right?</span></td></tr></table>
<table class="log-line" id="l-68"><tr class="log-row"><td class="log-lineno"><a href="#l-68">&nbsp;68</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> i found a limit on the other side: how many peers WE can select as HB which is “3” and it is enforced when PeerManagerImpl::BlockChecked() calls`PeerManagerImpl::MaybeSetPeerAsAnnouncingHeaderAndIDs()` (maintains 3 fastest peers as HB).</span></td></tr></table>
<table class="log-line" id="l-69"><tr class="log-row"><td class="log-lineno"><a href="#l-69">&nbsp;69</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> stringintech: yeah &quot;high bandwidth peers&quot; is a bit ambiguous i think</span></td></tr></table>
<table class="log-line" id="l-70"><tr class="log-row"><td class="log-lineno"><a href="#l-70">&nbsp;70</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> hmm good point. Because it&#39;s a two way street in terms of selection</span></td></tr></table>
<table class="log-line" id="l-71"><tr class="log-row"><td class="log-lineno"><a href="#l-71">&nbsp;71</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> I think you would prefer to be high bandwidth to remove latency?</span></td></tr></table>
<table class="log-line" id="l-72"><tr class="log-row"><td class="log-lineno"><a href="#l-72">&nbsp;72</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> A peer doesn&#39;t choose to be high or low bandwidth, we will ask all of our peers to be low bandwidth compact block peers initially, and then in MaybeSetPeerAsAnnouncing* we&#39;ll select high bandwidth peers and send them a SENDCMPCT asking them to be a high bandwidth peers</span></td></tr></table>
<table class="log-line" id="l-73"><tr class="log-row"><td class="log-lineno"><a href="#l-73">&nbsp;73</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Yeah so we can have 3 max. And then I guess we could be a hb peer to all of our peers... although I&#39;d have to confirm</span></td></tr></table>
<table class="log-line" id="l-74"><tr class="log-row"><td class="log-lineno"><a href="#l-74">&nbsp;74</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> dzxzg: nice got it</span></td></tr></table>
<table class="log-line" id="l-75"><tr class="log-row"><td class="log-lineno"><a href="#l-75">&nbsp;75</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> If someone has asked you to be their high-bandwidth peer, you&#39;ll send them a CMPCTBLOCK message in `NewPoWValidBlock()` before you have even completetd block validation</span></td></tr></table>
<table class="log-line" id="l-76"><tr class="log-row"><td class="log-lineno"><a href="#l-76">&nbsp;76</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> yeah the sending the block even before validation was new to me before stickies let me know</span></td></tr></table>
<table class="log-line" id="l-77"><tr class="log-row"><td class="log-lineno"><a href="#l-77">&nbsp;77</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> monlovesmango: yes that sounds about right</span></td></tr></table>
<table class="log-line" id="l-78"><tr class="log-row"><td class="log-lineno"><a href="#l-78">&nbsp;78</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> the block gets sent right away so latency is very low</span></td></tr></table>
<table class="log-line" id="l-79"><tr class="log-row"><td class="log-lineno"><a href="#l-79">&nbsp;79</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> dzxzg: that actually makes a lot of sense</span></td></tr></table>
<table class="log-line" id="l-80"><tr class="log-row"><td class="log-lineno"><a href="#l-80">&nbsp;80</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> (about choosing to be high/low bandwidth)</span></td></tr></table>
<table class="log-line" id="l-81"><tr class="log-row"><td class="log-lineno"><a href="#l-81">&nbsp;81</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Does the fuzz harness test the 3 peer limit in MaybeSetPeerAsAnnouncingHeaderAndIDs?</span></td></tr></table>
<table class="log-line" id="l-82"><tr class="log-row"><td class="log-lineno"><a href="#l-82">&nbsp;82</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> we are setting up only 3 peers; so no?</span></td></tr></table>
<table class="log-line" id="l-83"><tr class="log-row"><td class="log-lineno"><a href="#l-83">&nbsp;83</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> correct</span></td></tr></table>
<table class="log-line" id="l-84"><tr class="log-row"><td class="log-lineno"><a href="#l-84">&nbsp;84</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Would need to be more than 3 to cover that logic</span></td></tr></table>
<table class="log-line" id="l-85"><tr class="log-row"><td class="log-lineno"><a href="#l-85">&nbsp;85</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Compare -testdatadir and the new -fuzzcopydatadir. Why is the latter useful for performance, and why isn’t a fresh TestingSetup that mines blocks on each iteration acceptable here?</span></td></tr></table>
<table class="log-line" id="l-86"><tr class="log-row"><td class="log-lineno"><a href="#l-86">&nbsp;86</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> stickies-v: Go off</span></td></tr></table>
<table class="log-line" id="l-87"><tr class="log-row"><td class="log-lineno"><a href="#l-87">&nbsp;87</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> lOL</span></td></tr></table>
<table class="log-line" id="l-88"><tr class="log-row"><td class="log-lineno"><a href="#l-88">&nbsp;88</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> Wait is that an intentional choice? The choice to connect to 3 peers seemed unrelated to the number of high bandwidth peers?</span></td></tr></table>
<table class="log-line" id="l-89"><tr class="log-row"><td class="log-lineno"><a href="#l-89">&nbsp;89</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> No Eugene told me it wasn&#39;t intentional</span></td></tr></table>
<table class="log-line" id="l-90"><tr class="log-row"><td class="log-lineno"><a href="#l-90">&nbsp;90</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> it&#39;s from the processmessage fuzz test I think</span></td></tr></table>
<table class="log-line" id="l-91"><tr class="log-row"><td class="log-lineno"><a href="#l-91">&nbsp;91</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> okay makes sense</span></td></tr></table>
<table class="log-line" id="l-92"><tr class="log-row"><td class="log-lineno"><a href="#l-92">&nbsp;92</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> But in the coverage report you can see some of the lines not hit in MaybeSet</span></td></tr></table>
<table class="log-line" id="l-93"><tr class="log-row"><td class="log-lineno"><a href="#l-93">&nbsp;93</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> so making that more than 3 should hit it eventually</span></td></tr></table>
<table class="log-line" id="l-94"><tr class="log-row"><td class="log-lineno"><a href="#l-94">&nbsp;94</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> yeah but then we&#39;d probably have to add assertions that our hb accounting invariants hold</span></td></tr></table>
<table class="log-line" id="l-95"><tr class="log-row"><td class="log-lineno"><a href="#l-95">&nbsp;95</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> yeah, it would be fine to increase it past 3, we actually don&#39;t even enforce anything related to high bandwidth on the receiving side</span></td></tr></table>
<table class="log-line" id="l-96"><tr class="log-row"><td class="log-lineno"><a href="#l-96">&nbsp;96</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> fresh TestingSetup would take too much time for each fuzz iteration?</span></td></tr></table>
<table class="log-line" id="l-97"><tr class="log-row"><td class="log-lineno"><a href="#l-97">&nbsp;97</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> (<a href="https://github.com/bitcoin/bitcoin/pull/32606" target="blank">https://github.com/bitcoin/bitcoin/pull/32606</a>)</span></td></tr></table>
<table class="log-line" id="l-98"><tr class="log-row"><td class="log-lineno"><a href="#l-98">&nbsp;98</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> is this performance related (considering that mining should not take so long when in fuzzing mode) or that we want all runs to have the same initial state?</span></td></tr></table>
<table class="log-line" id="l-99"><tr class="log-row"><td class="log-lineno"><a href="#l-99">&nbsp;99</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> monlovesmango: exactly. Having to mine a new 200 block chain every iteration is just too slow</span></td></tr></table>
<table class="log-line" id="l-100"><tr class="log-row"><td class="log-lineno"><a href="#l-100">100</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> stringintech: good question, I think it&#39;s mainly for performance</span></td></tr></table>
<table class="log-line" id="l-101"><tr class="log-row"><td class="log-lineno"><a href="#l-101">101</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> the determinism is there too with using the same chain. But this whole commit was mainly done to significantly speed up the test</span></td></tr></table>
<table class="log-line" id="l-102"><tr class="log-row"><td class="log-lineno"><a href="#l-102">102</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> but isn&#39;t the point of `FuzzTargetOptions::init` to do that kind of expensive initialization as a one-off?</span></td></tr></table>
<table class="log-line" id="l-103"><tr class="log-row"><td class="log-lineno"><a href="#l-103">103</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> dzxzg: I&#39;ll have to check that PR out</span></td></tr></table>
<table class="log-line" id="l-104"><tr class="log-row"><td class="log-lineno"><a href="#l-104">104</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> stickies-v: i think that&#39;s what we are doing know. mining blocks and store in a static dir in init() and then copy that static dir in each run.</span></td></tr></table>
<table class="log-line" id="l-105"><tr class="log-row"><td class="log-lineno"><a href="#l-105">105</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> stickies do you mean `initialize_cmpctblock` in the harness?</span></td></tr></table>
<table class="log-line" id="l-106"><tr class="log-row"><td class="log-lineno"><a href="#l-106">106</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> doing now*</span></td></tr></table>
<table class="log-line" id="l-107"><tr class="log-row"><td class="log-lineno"><a href="#l-107">107</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> well so usually test suites have &quot;fixtures&quot; to do expensive one-off initialization that can be shared across tests, e.g. we have the same in our unit tests using boost</span></td></tr></table>
<table class="log-line" id="l-108"><tr class="log-row"><td class="log-lineno"><a href="#l-108">108</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> it appeared to me that the `FuzzTargetOptions::init` option serves a similar purpose (but i don&#39;t know the fuzzing code well enough)</span></td></tr></table>
<table class="log-line" id="l-109"><tr class="log-row"><td class="log-lineno"><a href="#l-109">109</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> if we just want to avoid mining a 200 chain for every iteration, why isn&#39;t the `.init` option enough for that?</span></td></tr></table>
<table class="log-line" id="l-110"><tr class="log-row"><td class="log-lineno"><a href="#l-110">110</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Wait is this in fuzz.cpp? why can&#39;t I find this</span></td></tr></table>
<table class="log-line" id="l-111"><tr class="log-row"><td class="log-lineno"><a href="#l-111">111</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> the fuzztargetoptions::init </span></td></tr></table>
<table class="log-line" id="l-112"><tr class="log-row"><td class="log-lineno"><a href="#l-112">112</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> oh I see nvm</span></td></tr></table>
<table class="log-line" id="l-113"><tr class="log-row"><td class="log-lineno"><a href="#l-113">113</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> yes, it&#39;s in fuzz/fuzz.cpp, and it&#39;s what `.init=initialize_cmpctblock` gets passed to</span></td></tr></table>
<table class="log-line" id="l-114"><tr class="log-row"><td class="log-lineno"><a href="#l-114">114</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Yeah so that&#39;s what allows us to have the one time initialize functions in fuzz targets</span></td></tr></table>
<table class="log-line" id="l-115"><tr class="log-row"><td class="log-lineno"><a href="#l-115">115</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> runs once before the iteration</span></td></tr></table>
<table class="log-line" id="l-116"><tr class="log-row"><td class="log-lineno"><a href="#l-116">116</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> but what&#39;s your question?</span></td></tr></table>
<table class="log-line" id="l-117"><tr class="log-row"><td class="log-lineno"><a href="#l-117">117</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> why don&#39;t we just generate the 200 blocks in the .init function and avoid copying datadirs?</span></td></tr></table>
<table class="log-line" id="l-118"><tr class="log-row"><td class="log-lineno"><a href="#l-118">118</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> also don&#39;t mean to derail the review club with my lack of fuzzing knowledge so we can move on from this anytime</span></td></tr></table>
<table class="log-line" id="l-119"><tr class="log-row"><td class="log-lineno"><a href="#l-119">119</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> I think beacuse the test is stateful</span></td></tr></table>
<table class="log-line" id="l-120"><tr class="log-row"><td class="log-lineno"><a href="#l-120">120</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:green">&lt;stringintech89&gt;</span><span class="log-msg"> does each run alter its data dir?</span></td></tr></table>
<table class="log-line" id="l-121"><tr class="log-row"><td class="log-lineno"><a href="#l-121">121</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> the testingsetup is modified in the iteration</span></td></tr></table>
<table class="log-line" id="l-122"><tr class="log-row"><td class="log-lineno"><a href="#l-122">122</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Yeah I think so, usually the testing setup stuff would be done in the init as a one off. But for this test specifically, its done in the iteration which is unusual</span></td></tr></table>
<table class="log-line" id="l-123"><tr class="log-row"><td class="log-lineno"><a href="#l-123">123</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;stickies-v&gt;</span><span class="log-msg"> aha, okay, that&#39;s unfortunate</span></td></tr></table>
<table class="log-line" id="l-124"><tr class="log-row"><td class="log-lineno"><a href="#l-124">124</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> Is the problem that blocks are being mined and then announced?</span></td></tr></table>
<table class="log-line" id="l-125"><tr class="log-row"><td class="log-lineno"><a href="#l-125">125</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> Maybe there is an obvious reason why this is dumb, but it really seems like there should be a way to have a memory-only chainstate object, and then we could just reset to that at the end of each fuzz epoch(not sure if epoch is the right word)</span></td></tr></table>
<table class="log-line" id="l-126"><tr class="log-row"><td class="log-lineno"><a href="#l-126">126</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> That would also make this fuzz test faster by avoiding hitting the disk at all.</span></td></tr></table>
<table class="log-line" id="l-127"><tr class="log-row"><td class="log-lineno"><a href="#l-127">127</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> Or maybe it&#39;s not a bad idea, just easier said than done to implement that</span></td></tr></table>
<table class="log-line" id="l-128"><tr class="log-row"><td class="log-lineno"><a href="#l-128">128</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> My first question when I saw this test was why can&#39;t we do this in memory. And Niklas was saying its just the validation code doesn&#39;t allow it. We need to do some refactoring</span></td></tr></table>
<table class="log-line" id="l-129"><tr class="log-row"><td class="log-lineno"><a href="#l-129">129</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:green">&lt;stringintech89&gt;</span><span class="log-msg"> just asking out of curiosity: wouldn&#39;t testing memory only, reduce coverage?</span></td></tr></table>
<table class="log-line" id="l-130"><tr class="log-row"><td class="log-lineno"><a href="#l-130">130</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> marcofleon: Figures 😿</span></td></tr></table>
<table class="log-line" id="l-131"><tr class="log-row"><td class="log-lineno"><a href="#l-131">131</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> This datadir commit is something I need to think about more too. For now let&#39;s move on. I think the approach might be okay though</span></td></tr></table>
<table class="log-line" id="l-132"><tr class="log-row"><td class="log-lineno"><a href="#l-132">132</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Look at create_block in the harness. How many transactions do the generated blocks contain, and where do they come from? What compact block scenarios might be missed with only a few transactions in a block?</span></td></tr></table>
<table class="log-line" id="l-133"><tr class="log-row"><td class="log-lineno"><a href="#l-133">133</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> stringintech89: yeah it would, by quite a bit I believe</span></td></tr></table>
<table class="log-line" id="l-134"><tr class="log-row"><td class="log-lineno"><a href="#l-134">134</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:green">&lt;stringintech89&gt;</span><span class="log-msg"> thanks</span></td></tr></table>
<table class="log-line" id="l-135"><tr class="log-row"><td class="log-lineno"><a href="#l-135">135</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> stringintech89: It would reduce coverage of this particular fuzz test, but that coverage is redundant I think this test should just fuzz compact block logic which doesn&#39;t do anything special with the disk, I think existing validation fuzzers should cover that stuff</span></td></tr></table>
<table class="log-line" id="l-136"><tr class="log-row"><td class="log-lineno"><a href="#l-136">136</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> (IMO)</span></td></tr></table>
<table class="log-line" id="l-137"><tr class="log-row"><td class="log-lineno"><a href="#l-137">137</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:green">&lt;stringintech89&gt;</span><span class="log-msg"> ah makes sense! thanks</span></td></tr></table>
<table class="log-line" id="l-138"><tr class="log-row"><td class="log-lineno"><a href="#l-138">138</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:green">&lt;stringintech89&gt;</span><span class="log-msg"> for the next question: max 3 txns: coinbase, at most one from mempool, at most one not in mempool. was wondering if including more than one from mempool (or more than one not in mempool) would cover different code paths and lead to more coverage.</span></td></tr></table>
<table class="log-line" id="l-139"><tr class="log-row"><td class="log-lineno"><a href="#l-139">139</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> it seems like create_block only includes 2 txs max? one from mempool and other adhoc created</span></td></tr></table>
<table class="log-line" id="l-140"><tr class="log-row"><td class="log-lineno"><a href="#l-140">140</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> oh duh, forgot coinbase :)</span></td></tr></table>
<table class="log-line" id="l-141"><tr class="log-row"><td class="log-lineno"><a href="#l-141">141</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> haha yes coinbase too. 1-3 txs</span></td></tr></table>
<table class="log-line" id="l-142"><tr class="log-row"><td class="log-lineno"><a href="#l-142">142</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> Why not more?</span></td></tr></table>
<table class="log-line" id="l-143"><tr class="log-row"><td class="log-lineno"><a href="#l-143">143</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> I think crypt-iQ was saying he might change that part of the test a bit</span></td></tr></table>
<table class="log-line" id="l-144"><tr class="log-row"><td class="log-lineno"><a href="#l-144">144</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Or just generally improve it, I don&#39;t see why there couldn&#39;t be some more</span></td></tr></table>
<table class="log-line" id="l-145"><tr class="log-row"><td class="log-lineno"><a href="#l-145">145</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> marcofleon: Makes sense, thanks</span></td></tr></table>
<table class="log-line" id="l-146"><tr class="log-row"><td class="log-lineno"><a href="#l-146">146</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> I&#39;m gonna switch question 6 and 7 for now in the interest of time if that&#39;s okay. Becauase i like 7 better :)</span></td></tr></table>
<table class="log-line" id="l-147"><tr class="log-row"><td class="log-lineno"><a href="#l-147">147</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Commit ed813c4 sorts m_dirty_blockindex by block hash instead of pointer address. What non-determinism does this fix? The author notes this slows production code for no production benefit. Why can’t EnableFuzzDeterminism() be used here? How do you think this non-determinism should be best handled (if not the way the PR currently does)?</span></td></tr></table>
<table class="log-line" id="l-148"><tr class="log-row"><td class="log-lineno"><a href="#l-148">148</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> what compact block scenarios might be missed with this low tx count?</span></td></tr></table>
<table class="log-line" id="l-149"><tr class="log-row"><td class="log-lineno"><a href="#l-149">149</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> the second half of question 5, this doesn&#39;t exercise some of the prefill index stuff, where prefills have an index counting from the last prefill</span></td></tr></table>
<table class="log-line" id="l-150"><tr class="log-row"><td class="log-lineno"><a href="#l-150">150</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> for example</span></td></tr></table>
<table class="log-line" id="l-151"><tr class="log-row"><td class="log-lineno"><a href="#l-151">151</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> oh yes! My bad</span></td></tr></table>
<table class="log-line" id="l-152"><tr class="log-row"><td class="log-lineno"><a href="#l-152">152</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> I was also thinking of shortid collisions</span></td></tr></table>
<table class="log-line" id="l-153"><tr class="log-row"><td class="log-lineno"><a href="#l-153">153</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> oh yeah that too</span></td></tr></table>
<table class="log-line" id="l-154"><tr class="log-row"><td class="log-lineno"><a href="#l-154">154</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> dzxzg: marcofleon: great answers thanks :)</span></td></tr></table>
<table class="log-line" id="l-155"><tr class="log-row"><td class="log-lineno"><a href="#l-155">155</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> We definitely want to have coverage of shortid collisions!</span></td></tr></table>
<table class="log-line" id="l-156"><tr class="log-row"><td class="log-lineno"><a href="#l-156">156</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:green">&lt;stringintech89&gt;</span><span class="log-msg"> for question 7: it tries to make the order we write changes to block index db deterministic</span></td></tr></table>
<table class="log-line" id="l-157"><tr class="log-row"><td class="log-lineno"><a href="#l-157">157</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:green">&lt;stringintech89&gt;</span><span class="log-msg"> and if we want to include the new sort in the set type itself, EnableFuzzDeterminism() does not work and we would need macros perhaps.</span></td></tr></table>
<table class="log-line" id="l-158"><tr class="log-row"><td class="log-lineno"><a href="#l-158">158</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> why does block index db need to be deterministic?</span></td></tr></table>
<table class="log-line" id="l-159"><tr class="log-row"><td class="log-lineno"><a href="#l-159">159</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> or why do the writes need to deterministic?</span></td></tr></table>
<table class="log-line" id="l-160"><tr class="log-row"><td class="log-lineno"><a href="#l-160">160</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Yeah basically the iteration order won&#39;t be deterministic with just a normal std::set which orders based on memory address. so it&#39;s changed to block hash to make it the same order every time</span></td></tr></table>
<table class="log-line" id="l-161"><tr class="log-row"><td class="log-lineno"><a href="#l-161">161</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:green">&lt;stringintech89&gt;</span><span class="log-msg"> but as marcofleon mentioned on the PR page, maybe we can include a runtime sorting logic just when fuzzing; then EnableFuzzDeterminism() can be used perhaps</span></td></tr></table>
<table class="log-line" id="l-162"><tr class="log-row"><td class="log-lineno"><a href="#l-162">162</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:grey">&lt;eugenesiegel&gt;</span><span class="log-msg"> hi, sorry I thought this review club was at a different time. runtime sorting doesn&#39;t work because the std::sort call itself will be non-deterministic</span></td></tr></table>
<table class="log-line" id="l-163"><tr class="log-row"><td class="log-lineno"><a href="#l-163">163</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:grey">&lt;eugenesiegel&gt;</span><span class="log-msg"> different executions will have different memory addresses so the compare function will be called a different amount of times</span></td></tr></table>
<table class="log-line" id="l-164"><tr class="log-row"><td class="log-lineno"><a href="#l-164">164</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> Oh that makes sense. so it doesn&#39;t actually solve the non-determinism</span></td></tr></table>
<table class="log-line" id="l-165"><tr class="log-row"><td class="log-lineno"><a href="#l-165">165</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> Just drawing it out a bit more to make sure I understand why we care if it&#39;s in the same order every run, we write from the set of dirty block indexes in the order of the set, and if we don&#39;t write blockindexes in the same order every time, we would have different behavior running the same seed two times?</span></td></tr></table>
<table class="log-line" id="l-166"><tr class="log-row"><td class="log-lineno"><a href="#l-166">166</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> also monlovesmango: I think it&#39;s just for general stability</span></td></tr></table>
<table class="log-line" id="l-167"><tr class="log-row"><td class="log-lineno"><a href="#l-167">167</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> in gneral fuzz tests should be as deterministic as possible. But not sure if it&#39;s worth it in this case, because this non-determinism might not super impactful?</span></td></tr></table>
<table class="log-line" id="l-168"><tr class="log-row"><td class="log-lineno"><a href="#l-168">168</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> ok. so just for my understanding is there anything explicity comparing this between executions?</span></td></tr></table>
<table class="log-line" id="l-169"><tr class="log-row"><td class="log-lineno"><a href="#l-169">169</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> ohhh ok so when there is a failure it can be preproduced, got it</span></td></tr></table>
<table class="log-line" id="l-170"><tr class="log-row"><td class="log-lineno"><a href="#l-170">170</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:grey">&lt;eugenesiegel&gt;</span><span class="log-msg"> dzxzg: we won&#39;t technically have different behavior since iirc the db is a key-value store. The issue is that the fuzzer will think it&#39;s gaining (or losing) coverage when nothing has actually happened</span></td></tr></table>
<table class="log-line" id="l-171"><tr class="log-row"><td class="log-lineno"><a href="#l-171">171</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> reproduced*</span></td></tr></table>
<table class="log-line" id="l-172"><tr class="log-row"><td class="log-lineno"><a href="#l-172">172</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> But I could be wrong there, it could be for reproducing a potential crash, this would get in the way of reproducing it</span></td></tr></table>
<table class="log-line" id="l-173"><tr class="log-row"><td class="log-lineno"><a href="#l-173">173</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> I wonder what the perf cost is to normal node running of adding the pointer accesses</span></td></tr></table>
<table class="log-line" id="l-174"><tr class="log-row"><td class="log-lineno"><a href="#l-174">174</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> okay we&#39;ve reached the end, thank you for coming! we can of course continue discussing</span></td></tr></table>
<table class="log-line" id="l-175"><tr class="log-row"><td class="log-lineno"><a href="#l-175">175</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> #endmeeting</span></td></tr></table>
<table class="log-line" id="l-176"><tr class="log-row"><td class="log-lineno"><a href="#l-176">176</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:chocolate">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Meeting ended at 2025-10-08T18:01+0000</span></td></tr></table>
<table class="log-line" id="l-177"><tr class="log-row"><td class="log-lineno"><a href="#l-177">177</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:chocolate">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Raw log: <a href="https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-10-08_17_00.log.json" target="blank">https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-10-08_17_00.log.json</a></span></td></tr></table>
<table class="log-line" id="l-178"><tr class="log-row"><td class="log-lineno"><a href="#l-178">178</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:chocolate">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Formatted log: <a href="https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-10-08_17_00.log.html" target="blank">https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-10-08_17_00.log.html</a></span></td></tr></table>
<table class="log-line" id="l-179"><tr class="log-row"><td class="log-lineno"><a href="#l-179">179</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:chocolate">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Minutes: <a href="https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-10-08_17_00.html" target="blank">https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-10-08_17_00.html</a></span></td></tr></table>
<table class="log-line" id="l-180"><tr class="log-row"><td class="log-lineno"><a href="#l-180">180</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> eugenesiegel: Makes sense, thanks</span></td></tr></table>
<table class="log-line" id="l-181"><tr class="log-row"><td class="log-lineno"><a href="#l-181">181</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> thanks marcofleon and all!</span></td></tr></table>
<table class="log-line" id="l-182"><tr class="log-row"><td class="log-lineno"><a href="#l-182">182</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> Thanks marcofleon!</span></td></tr></table>
<table class="log-line" id="l-183"><tr class="log-row"><td class="log-lineno"><a href="#l-183">183</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> I did have another question if anyone has time to answer</span></td></tr></table>
<table class="log-line" id="l-184"><tr class="log-row"><td class="log-lineno"><a href="#l-184">184</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:grey">&lt;eugenesiegel&gt;</span><span class="log-msg"> monlovesmango: I&#39;m still around to answer any questions</span></td></tr></table>
<table class="log-line" id="l-185"><tr class="log-row"><td class="log-lineno"><a href="#l-185">185</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> for this code chunk <a href="https://github.com/Crypt-iQ/bitcoin/blob/ed813c48f826d083becf93c741b483774c850c86/src/test/fuzz/cmpctblock.cpp#L308C16-L320C18" target="blank">https://github.com/Crypt-iQ/bitcoin/blob/ed813c48f826d083becf93c741b483774c850c86/src/test/fuzz/cmpctblock.cpp#L308C16-L320C18</a></span></td></tr></table>
<table class="log-line" id="l-186"><tr class="log-row"><td class="log-lineno"><a href="#l-186">186</a></td><td class="log-time">18:03 </td><td><span class="log-nick" style="color:green">&lt;stringintech89&gt;</span><span class="log-msg"> Thank you marcofleon</span></td></tr></table>
<table class="log-line" id="l-187"><tr class="log-row"><td class="log-lineno"><a href="#l-187">187</a></td><td class="log-time">18:03 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> why is the loop not to i&lt;=num_txs?</span></td></tr></table>
<table class="log-line" id="l-188"><tr class="log-row"><td class="log-lineno"><a href="#l-188">188</a></td><td class="log-time">18:04 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> that would go one past the end of the block</span></td></tr></table>
<table class="log-line" id="l-189"><tr class="log-row"><td class="log-lineno"><a href="#l-189">189</a></td><td class="log-time">18:04 </td><td><span class="log-nick" style="color:forestgreen">&lt;dzxzg&gt;</span><span class="log-msg"> the reason it starts at i = 1 is to skip the coinbase</span></td></tr></table>
<table class="log-line" id="l-190"><tr class="log-row"><td class="log-lineno"><a href="#l-190">190</a></td><td class="log-time">18:04 </td><td><span class="log-nick" style="color:grey">&lt;eugenesiegel&gt;</span><span class="log-msg"> yup, what dzxzg said</span></td></tr></table>
<table class="log-line" id="l-191"><tr class="log-row"><td class="log-lineno"><a href="#l-191">191</a></td><td class="log-time">18:04 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> dzxzg: thanks that makes sense </span></td></tr></table>
<table class="log-line" id="l-192"><tr class="log-row"><td class="log-lineno"><a href="#l-192">192</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:darkblue">&lt;monlovesmango&gt;</span><span class="log-msg"> easy question :)</span></td></tr></table>
<table class="log-line" id="l-193"><tr class="log-row"><td class="log-lineno"><a href="#l-193">193</a></td><td class="log-time">18:07 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> wait so I can understand the `m_dirty_blockindex` determinism more</span></td></tr></table>
<table class="log-line" id="l-194"><tr class="log-row"><td class="log-lineno"><a href="#l-194">194</a></td><td class="log-time">18:07 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> It&#39;s not about the order it&#39;s written to leveldb then? </span></td></tr></table>
<table class="log-line" id="l-195"><tr class="log-row"><td class="log-lineno"><a href="#l-195">195</a></td><td class="log-time">18:08 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> wait nvm I think I just reread your message, you&#39;re saying std::sort itself is non deterministic</span></td></tr></table>
<table class="log-line" id="l-196"><tr class="log-row"><td class="log-lineno"><a href="#l-196">196</a></td><td class="log-time">18:08 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> I thought it said std::set for a second</span></td></tr></table>
<table class="log-line" id="l-197"><tr class="log-row"><td class="log-lineno"><a href="#l-197">197</a></td><td class="log-time">18:11 </td><td><span class="log-nick" style="color:grey">&lt;eugenesiegel&gt;</span><span class="log-msg"> sorry, I think my answer was confusing. if there is a different order written to leveldb, the internal MemTable is non-deterministic, but since these are key-value pairs it shouldn&#39;t? matter on-disk</span></td></tr></table>
<table class="log-line" id="l-198"><tr class="log-row"><td class="log-lineno"><a href="#l-198">198</a></td><td class="log-time">18:14 </td><td><span class="log-nick" style="color:grey">&lt;eugenesiegel&gt;</span><span class="log-msg"> If we insert into `m_dirty_blockindex` without sorting on insert, then `m_dirty_blockindex` is in random order. this means the sort function will call whatever std::less function a variable number of times each run for the same input. I&#39;m completely ok with removing the commit</span></td></tr></table>
<table class="log-line" id="l-199"><tr class="log-row"><td class="log-lineno"><a href="#l-199">199</a></td><td class="log-time">18:16 </td><td><span class="log-nick" style="color:green">&lt;stringintech89&gt;</span><span class="log-msg"> eugenesiegel: can you please elaborate a bit on this &quot;the issue is that the fuzzer will think it&#39;s gaining (or losing) coverage when nothing has actually happened&quot;</span></td></tr></table>
<table class="log-line" id="l-200"><tr class="log-row"><td class="log-lineno"><a href="#l-200">200</a></td><td class="log-time">18:19 </td><td><span class="log-nick" style="color:cadetblue">&lt;marcofleon&gt;</span><span class="log-msg"> eugenesiegel: thanks I got it, that makes more sense. I&#39;m gonna play around with the determinism script a bit and see what comes up</span></td></tr></table>
<table class="log-line" id="l-201"><tr class="log-row"><td class="log-lineno"><a href="#l-201">201</a></td><td class="log-time">18:20 </td><td><span class="log-nick" style="color:grey">&lt;eugenesiegel&gt;</span><span class="log-msg"> stringintech89: let&#39;s say we removed the `m_dirty_blockindex` commit, meaning the harness is now non-deterministic. if the fuzzer is given an input that calls WriteBatchSync and modifies one bit of the input that&#39;s uninteresting (doesn&#39;t gain or lose coverage), then because the harness is non-deterministic, the fuzzer may actually see an increase</span></td></tr></table>
<table class="log-line" id="l-202"><tr class="log-row"><td class="log-lineno"><a href="#l-202">202</a></td><td class="log-time">18:20 </td><td><span class="log-nick" style="color:grey">&lt;eugenesiegel&gt;</span><span class="log-msg"> in the coverage counters and think it&#39;s due to this one bit that was modified</span></td></tr></table>
<table class="log-line" id="l-203"><tr class="log-row"><td class="log-lineno"><a href="#l-203">203</a></td><td class="log-time">18:25 </td><td><span class="log-nick" style="color:coral">&lt;stringintech&gt;</span><span class="log-msg"> eugenesiegel: ahh thank you! i think i got it (though not so clear how fuzzer calculates the coverage). will read more on it and ask more questions if still not clear.</span></td></tr></table>
<table class="log-line" id="l-204"><tr class="log-row"><td class="log-lineno"><a href="#l-204">204</a></td><td class="log-time">18:26 </td><td><span class="log-nick" style="color:hotpink">&lt;sipa&gt;</span><span class="log-msg"> stringintech: when you compile with fuzzing, the compiler inserts instrumentation for tracking branch and other coverage</span></td></tr></table>
<table class="log-line" id="l-205"><tr class="log-row"><td class="log-lineno"><a href="#l-205">205</a></td><td class="log-time">18:26 </td><td><span class="log-nick" style="color:hotpink">&lt;sipa&gt;</span><span class="log-msg"> which the fuzzer library then uses to guide the mutations it makes, and the corpus it keeps</span></td></tr></table>
<table class="log-line" id="l-206"><tr class="log-row"><td class="log-lineno"><a href="#l-206">206</a></td><td class="log-time">18:31 </td><td><span class="log-nick" style="color:grey">&lt;eugenesiegel&gt;</span><span class="log-msg"> stringintech: This might be a bit out-dated, but I found this AFL writeup very helpful when learning how coverage feedback with fuzzing worked: <a href="https://lcamtuf.coredump.cx/afl/technical_details.txt" target="blank">https://lcamtuf.coredump.cx/afl/technical_details.txt</a></span></td></tr></table>
<table class="log-line" id="l-207"><tr class="log-row"><td class="log-lineno"><a href="#l-207">207</a></td><td class="log-time">18:37 </td><td><span class="log-nick" style="color:indianred">&lt;stringintech66&gt;</span><span class="log-msg"> thanks a lot sipa!</span></td></tr></table>
<table class="log-line" id="l-208"><tr class="log-row"><td class="log-lineno"><a href="#l-208">208</a></td><td class="log-time">18:37 </td><td><span class="log-nick" style="color:indianred">&lt;stringintech66&gt;</span><span class="log-msg"> so in the example eugenesiegel explained, for the two given inputs that have the same coverage of the code paths we are interested in, fuzzer might see different coverage score since different amount of sorting might happen...</span></td></tr></table>
<table class="log-line" id="l-209"><tr class="log-row"><td class="log-lineno"><a href="#l-209">209</a></td><td class="log-time">18:39 </td><td><span class="log-nick" style="color:indianred">&lt;stringintech66&gt;</span><span class="log-msg"> thanks a lot for the link eugenesiegel! i will definitely check it out</span></td></tr></table>]]></content><author><name>Crypt-iQ</name></author><summary type="html"><![CDATA[Notes]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bitcoincore.reviews/assets/img/twitter_card.png" /><media:content medium="image" url="https://bitcoincore.reviews/assets/img/twitter_card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">wallet: Add exportwatchonlywallet RPC</title><link href="https://bitcoincore.reviews/32489" rel="alternate" type="text/html" title="wallet: Add exportwatchonlywallet RPC" /><published>2025-08-06T00:00:00+00:00</published><updated>2025-08-06T00:00:00+00:00</updated><id>https://bitcoincore.reviews/#32489</id><content type="html" xml:base="https://bitcoincore.reviews/32489"><![CDATA[<h2 id="notes">Notes</h2>

<h3 id="motivation--user-story">Motivation &amp; user story</h3>
<ul>
  <li>Air-gapped (“signing”) machines hold the private keys; an online (“watch-only”) node tracks balances, generates receive addresses, and prepares PSBTs.
Today users must <strong>manually</strong> recreate that watch-only wallet by typing or scripting <code class="language-plaintext highlighter-rouge">importdescriptors</code>, copying address labels, etc.</li>
  <li><code class="language-plaintext highlighter-rouge">exportwatchonlywallet</code> provides a <strong>single-step</strong> RPC that produces a wallet file containing:
    <ul>
      <li>All <em>public</em> descriptors (&amp; caches when needed)</li>
      <li>Address book entries, receive-request metadata, and “avoid-reuse” markers</li>
      <li>All wallet TXs (so rescans are unnecessary)</li>
      <li>Persisted locked-coin state and wallet flags</li>
      <li><strong>No private keys</strong> (wallet is created with <code class="language-plaintext highlighter-rouge">WALLET_FLAG_DISABLE_PRIVATE_KEYS</code>)</li>
    </ul>
  </li>
</ul>

<p>The result can be moved to any node and loaded with the existing <code class="language-plaintext highlighter-rouge">restorewallet</code> RPC.</p>

<hr />

<h3 id="new-building-blocks-introduced-in-this-pr">New building blocks introduced in this PR</h3>

<table>
  <thead>
    <tr>
      <th>Area</th>
      <th>New API / behaviour</th>
      <th>Why it is needed</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Descriptors</strong></td>
      <td><code class="language-plaintext highlighter-rouge">Descriptor::CanSelfExpand()</code> plus plumbing in every <code class="language-plaintext highlighter-rouge">DescriptorImpl</code> and <code class="language-plaintext highlighter-rouge">PubkeyProvider</code></td>
      <td>Lets the wallet know whether a descriptor can generate new scriptPubKeys <em>without</em> a cache <strong>and</strong> without private keys. Hardened paths (e.g. <code class="language-plaintext highlighter-rouge">/0h/*</code>) return <em>false</em>.</td>
    </tr>
    <tr>
      <td><strong>Wallet internals</strong></td>
      <td><code class="language-plaintext highlighter-rouge">CWallet::ExportDescriptors(bool export_private)</code></td>
      <td>Moves descriptor enumeration logic out of <code class="language-plaintext highlighter-rouge">listdescriptors</code> RPC so it can be reused by the exporter.</td>
    </tr>
    <tr>
      <td> </td>
      <td><code class="language-plaintext highlighter-rouge">CWallet::ExportWatchOnlyWallet(const fs::path&amp; dst, WalletContext&amp;)</code></td>
      <td>Creates a <em>temporary</em> watch-only wallet DB, populates it, backs it up to <code class="language-plaintext highlighter-rouge">dst</code>, then deletes the temp directory. This keeps the exported file self-contained and avoids leaving stray wallet dirs around.</td>
    </tr>
    <tr>
      <td><strong>RPC</strong></td>
      <td><code class="language-plaintext highlighter-rouge">exportwatchonlywallet &lt;destination&gt;</code></td>
      <td>Thin wrapper around the method above.</td>
    </tr>
    <tr>
      <td><strong>Tests</strong></td>
      <td><code class="language-plaintext highlighter-rouge">wallet_exported_watchonly.py</code> functional test</td>
      <td>Exercises basic export, address-book copy, tx / lock copy, imported descriptors, avoid-reuse flag, encrypted source wallets.</td>
    </tr>
  </tbody>
</table>

<hr />

<h3 id="walk-through-of-the-export-algorithm-very-high-level">Walk-through of the export algorithm (very high level)</h3>

<ol>
  <li><strong>Pre-flight checks</strong> – ensure destination path does not exist; grab a canonical path; hold <code class="language-plaintext highlighter-rouge">cs_wallet</code>.</li>
  <li><strong>Gather descriptor data</strong> using <code class="language-plaintext highlighter-rouge">ExportDescriptors(false)</code>.</li>
  <li><strong>Instantiate</strong> a <em>new</em> wallet DB with the <em>same</em> flags ∪ <code class="language-plaintext highlighter-rouge">WALLET_FLAG_DISABLE_PRIVATE_KEYS</code>.</li>
  <li><strong>Populate</strong> the new wallet inside a single batch TX:
    <ul>
      <li>Add each descriptor as a <code class="language-plaintext highlighter-rouge">DescriptorScriptPubKeyMan</code>.
        <ul>
          <li>If <code class="language-plaintext highlighter-rouge">!desc-&gt;CanSelfExpand()</code>, copy the source descriptor <strong>cache</strong> first, so address generation works.</li>
        </ul>
      </li>
      <li>Copy active SPKMs / internal flags so it knows which pools to use.</li>
      <li>Copy persistent locked coins, address-book rows, receive-requests, “previously-spent” markers, <code class="language-plaintext highlighter-rouge">nOrderPosNext</code>, and best-block locator (to avoid rescan).</li>
      <li>Copy every <code class="language-plaintext highlighter-rouge">CWalletTx</code> so balances are immediately correct.</li>
    </ul>
  </li>
  <li><strong>Backup</strong> the new wallet to the requested <code class="language-plaintext highlighter-rouge">destination</code> and then delete the temp directory.</li>
  <li>Return the fully-qualified path in the RPC result.</li>
</ol>

<hr />

<h3 id="behavioural-quirks--edge-cases-worth-reviewing">Behavioural quirks &amp; edge-cases worth reviewing</h3>

<ul>
  <li><strong>Hardened xpub paths</strong> – these cannot self-expand; exporter copies the cache so watch-only wallet can derive addresses up to the last used index but cannot extend indefinitely.</li>
  <li><strong>Encrypted source wallets</strong> – exporter runs while the wallet is locked because it never reads private keys.</li>
  <li><strong>Avoid-reuse &amp; address-book flags</strong> – exporter must preserve <em>both</em> the wallet flag and the special “previously spent” metadata to keep behaviour identical.</li>
  <li><strong>Tx ordering &amp; <code class="language-plaintext highlighter-rouge">nOrderPosNext</code></strong> – ensures recreated wallet doesn’t reshuffle history.</li>
  <li><strong>Concurrency</strong> – every path that reads mutable wallet state is executed under <code class="language-plaintext highlighter-rouge">cs_wallet</code>; temp wallet is manipulated under its own lock <em>and</em> inside a batch DB TX.</li>
</ul>

<hr />

<h2 id="questions">Questions</h2>

<ol>
  <li><strong>Review approach</strong> Did you test, concept ACK, approach ACK, or NACK the PR?  What aspects did you focus on during review?</li>
  <li><strong>Descriptor API</strong> Why can’t the existing <code class="language-plaintext highlighter-rouge">IsRange()</code>/<code class="language-plaintext highlighter-rouge">IsSingleType()</code> information tell us whether a descriptor can be expanded on the watch-only side?  Explain the logic behind <code class="language-plaintext highlighter-rouge">CanSelfExpand()</code> for
a) a hardened <code class="language-plaintext highlighter-rouge">wpkh(xpub/0h/*)</code> path and
b) a <code class="language-plaintext highlighter-rouge">pkh(pubkey)</code> descriptor.</li>
  <li><strong>Cache copying</strong> <code class="language-plaintext highlighter-rouge">ExportWatchOnlyWallet</code> only copies the descriptor cache <em>if</em> <code class="language-plaintext highlighter-rouge">!desc-&gt;CanSelfExpand()</code>.
<em>What exactly is stored in that cache?</em> How could an incomplete cache affect address derivation on the watch-only wallet?</li>
  <li><strong>Wallet flags</strong> The exporter sets <code class="language-plaintext highlighter-rouge">create_flags = GetWalletFlags() | WALLET_FLAG_DISABLE_PRIVATE_KEYS</code>.
Why is it important to preserve the original flags (e.g. <code class="language-plaintext highlighter-rouge">AVOID_REUSE</code>) instead of clearing everything and starting fresh?</li>
  <li><strong>Best-block locator</strong> Why does the exporter read the locator from the <em>source</em> wallet and write it verbatim into the new wallet instead of letting the new wallet start from block 0?</li>
  <li><strong>Security / privacy</strong> Consider a multisig descriptor <code class="language-plaintext highlighter-rouge">wsh(multi(2,xpub1,xpub2))</code>.
If one cosigner exports a watch-only wallet and shares it with a third party, what <em>new</em> information does that third party learn compared to just giving them the descriptor strings?</li>
  <li><strong>Functional test</strong> In <code class="language-plaintext highlighter-rouge">wallet_exported_watchonly.py</code>, why does the test call <code class="language-plaintext highlighter-rouge">wallet.keypoolrefill(100)</code> before checking spendability across the online/offline pair?</li>
  <li><strong>Alternatives</strong> Prior to this PR, users could achieve a watch-only setup via <code class="language-plaintext highlighter-rouge">dumpwallet</code> → <code class="language-plaintext highlighter-rouge">importwallet</code> or <code class="language-plaintext highlighter-rouge">importdescriptors</code>.
 Compare those approaches with <code class="language-plaintext highlighter-rouge">exportwatchonlywallet</code> in terms of UX, completeness, and long-term maintainability.</li>
</ol>

<h2 id="meeting-log">Meeting Log</h2>

<table class="log-line" id="l-1"><tr class="log-row"><td class="log-lineno"><a href="#l-1">&nbsp;&nbsp;1</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> #startmeeting </span></td></tr></table>
<table class="log-line" id="l-2"><tr class="log-row"><td class="log-lineno"><a href="#l-2">&nbsp;&nbsp;2</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orchid">&lt;corebot&gt;</span><span class="log-msg"> ryanofsky: Meeting started at 2025-08-06T17:00+0000</span></td></tr></table>
<table class="log-line" id="l-3"><tr class="log-row"><td class="log-lineno"><a href="#l-3">&nbsp;&nbsp;3</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orchid">&lt;corebot&gt;</span><span class="log-msg"> ryanofsky: Current chairs: ryanofsky</span></td></tr></table>
<table class="log-line" id="l-4"><tr class="log-row"><td class="log-lineno"><a href="#l-4">&nbsp;&nbsp;4</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orchid">&lt;corebot&gt;</span><span class="log-msg"> ryanofsky: Useful commands: #action #info #idea #link #topic #motion #vote #close #endmeeting</span></td></tr></table>
<table class="log-line" id="l-5"><tr class="log-row"><td class="log-lineno"><a href="#l-5">&nbsp;&nbsp;5</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orchid">&lt;corebot&gt;</span><span class="log-msg"> ryanofsky: See also: <a href="https://hcoop-meetbot.readthedocs.io/en/stable/" target="blank">https://hcoop-meetbot.readthedocs.io/en/stable/</a></span></td></tr></table>
<table class="log-line" id="l-6"><tr class="log-row"><td class="log-lineno"><a href="#l-6">&nbsp;&nbsp;6</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orchid">&lt;corebot&gt;</span><span class="log-msg"> ryanofsky: Participants should now identify themselves with &#39;#here&#39; or with an alias like &#39;#here FirstLast&#39;</span></td></tr></table>
<table class="log-line" id="l-7"><tr class="log-row"><td class="log-lineno"><a href="#l-7">&nbsp;&nbsp;7</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-8"><tr class="log-row"><td class="log-lineno"><a href="#l-8">&nbsp;&nbsp;8</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Welcome to the bitcoin review club! Today we&#39;ll discuss <a href="https://bitcoincore.reviews/32489" target="blank">https://bitcoincore.reviews/32489</a> #32489</span></td></tr></table>
<table class="log-line" id="l-9"><tr class="log-row"><td class="log-lineno"><a href="#l-9">&nbsp;&nbsp;9</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orchid">&lt;corebot&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/issues/32489" target="blank">https://github.com/bitcoin/bitcoin/issues/32489</a> | wallet: Add `exportwatchonlywallet` RPC to export a watchonly version of a wallet by achow101 · Pull Request #32489 · bitcoin/bitcoin · GitHub</span></td></tr></table>
<table class="log-line" id="l-10"><tr class="log-row"><td class="log-lineno"><a href="#l-10">&nbsp;10</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:purple">&lt;glozow&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-11"><tr class="log-row"><td class="log-lineno"><a href="#l-11">&nbsp;11</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> Hi</span></td></tr></table>
<table class="log-line" id="l-12"><tr class="log-row"><td class="log-lineno"><a href="#l-12">&nbsp;12</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:seagreen">&lt;stickies-v&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-13"><tr class="log-row"><td class="log-lineno"><a href="#l-13">&nbsp;13</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:sienna">&lt;pablomartin4btc&gt;</span><span class="log-msg"> hello</span></td></tr></table>
<table class="log-line" id="l-14"><tr class="log-row"><td class="log-lineno"><a href="#l-14">&nbsp;14</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:orange">&lt;colinc&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-15"><tr class="log-row"><td class="log-lineno"><a href="#l-15">&nbsp;15</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:slateblue">&lt;kevkevin&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-16"><tr class="log-row"><td class="log-lineno"><a href="#l-16">&nbsp;16</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> First question to get started 1. Did you test, concept ACK, approach ACK, or NACK the PR? What aspects did you focus on during review?</span></td></tr></table>
<table class="log-line" id="l-17"><tr class="log-row"><td class="log-lineno"><a href="#l-17">&nbsp;17</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:peru">&lt;emzy&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-18"><tr class="log-row"><td class="log-lineno"><a href="#l-18">&nbsp;18</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> heyy</span></td></tr></table>
<table class="log-line" id="l-19"><tr class="log-row"><td class="log-lineno"><a href="#l-19">&nbsp;19</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> I was not familiar with this part of the codebase so mainly spent time on getting a basic understanding of the components touched by this PR and then did a light review on the changes. Concept ACK.</span></td></tr></table>
<table class="log-line" id="l-20"><tr class="log-row"><td class="log-lineno"><a href="#l-20">&nbsp;20</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> concept ACK but mostly here just to lurk and learn</span></td></tr></table>
<table class="log-line" id="l-21"><tr class="log-row"><td class="log-lineno"><a href="#l-21">&nbsp;21</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:sienna">&lt;pablomartin4btc&gt;</span><span class="log-msg"> light code review ACK</span></td></tr></table>
<table class="log-line" id="l-22"><tr class="log-row"><td class="log-lineno"><a href="#l-22">&nbsp;22</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:teal">&lt;effexzi&gt;</span><span class="log-msg"> Hi every1</span></td></tr></table>
<table class="log-line" id="l-23"><tr class="log-row"><td class="log-lineno"><a href="#l-23">&nbsp;23</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Yeah I feel like the harder part of this PR if you aren&#39;t familiar with wallet is probably the concepts</span></td></tr></table>
<table class="log-line" id="l-24"><tr class="log-row"><td class="log-lineno"><a href="#l-24">&nbsp;24</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> yes definitely haha</span></td></tr></table>
<table class="log-line" id="l-25"><tr class="log-row"><td class="log-lineno"><a href="#l-25">&nbsp;25</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> The code is more straightfoward than other prs, because it&#39;s new and not interacting with legacy stuff like a lot of wallet prs</span></td></tr></table>
<table class="log-line" id="l-26"><tr class="log-row"><td class="log-lineno"><a href="#l-26">&nbsp;26</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Feel free to ask if a particular concept is unclear</span></td></tr></table>
<table class="log-line" id="l-27"><tr class="log-row"><td class="log-lineno"><a href="#l-27">&nbsp;27</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Next up is 2. Why can’t the existing IsRange()/IsSingleType() information tell us whether a descriptor can be expanded on the watch-only side? Explain the logic behind CanSelfExpand() for a) a hardened wpkh(xpub/0h/*) path and b) a pkh(pubkey) descriptor.</span></td></tr></table>
<table class="log-line" id="l-28"><tr class="log-row"><td class="log-lineno"><a href="#l-28">&nbsp;28</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> is it possible that a range can be hardened but also could not be hardened?</span></td></tr></table>
<table class="log-line" id="l-29"><tr class="log-row"><td class="log-lineno"><a href="#l-29">&nbsp;29</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> About the first part of the question, CanSelfExpand() tells whether we need private keys or cache to get new addresses for a descriptor. A single type range descriptor may contain hardened paths or may not. The latter can self expand but not the former. So only those two methods are not enough.</span></td></tr></table>
<table class="log-line" id="l-30"><tr class="log-row"><td class="log-lineno"><a href="#l-30">&nbsp;30</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> About the second part</span></td></tr></table>
<table class="log-line" id="l-31"><tr class="log-row"><td class="log-lineno"><a href="#l-31">&nbsp;31</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:seagreen">&lt;stickies-v&gt;</span><span class="log-msg"> I think range descriptors with hardened paths can still self expand, but only if they contain the xpriv?</span></td></tr></table>
<table class="log-line" id="l-32"><tr class="log-row"><td class="log-lineno"><a href="#l-32">&nbsp;32</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> pkh(pubkey) cannot expand because it is not ranged but the other one (which shows the limitation of IsRange()/IsSingleType() checks) cannot expand because it contains hardened paths.</span></td></tr></table>
<table class="log-line" id="l-33"><tr class="log-row"><td class="log-lineno"><a href="#l-33">&nbsp;33</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> stringintech, yeah it&#39;s just in the exported wallet there are no private keys, so anything hardened needs to be exported in the cache</span></td></tr></table>
<table class="log-line" id="l-34"><tr class="log-row"><td class="log-lineno"><a href="#l-34">&nbsp;34</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> oops that was in reply to stickies-v</span></td></tr></table>
<table class="log-line" id="l-35"><tr class="log-row"><td class="log-lineno"><a href="#l-35">&nbsp;35</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> :D</span></td></tr></table>
<table class="log-line" id="l-36"><tr class="log-row"><td class="log-lineno"><a href="#l-36">&nbsp;36</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> stringintech, your answer sounds right</span></td></tr></table>
<table class="log-line" id="l-37"><tr class="log-row"><td class="log-lineno"><a href="#l-37">&nbsp;37</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:seagreen">&lt;stickies-v&gt;</span><span class="log-msg"> oh yeah, watchonly exports wouldn&#39;t contain any private keys, i was making a more general comment</span></td></tr></table>
<table class="log-line" id="l-38"><tr class="log-row"><td class="log-lineno"><a href="#l-38">&nbsp;38</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Basically in order to do the export the wallet needs to know if the descriptor uses any hardened paths, so CanSelfExport searched the descriptor recursively for anything hardened and returns true if it finds that</span></td></tr></table>
<table class="log-line" id="l-39"><tr class="log-row"><td class="log-lineno"><a href="#l-39">&nbsp;39</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> If there are any hardened paths caches need to be exported</span></td></tr></table>
<table class="log-line" id="l-40"><tr class="log-row"><td class="log-lineno"><a href="#l-40">&nbsp;40</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> I did have a code question, where is CanSelfExpand defined for OriginPubkeyProvider? since it is just returning m_provider-&gt;CanSelfExpand()?</span></td></tr></table>
<table class="log-line" id="l-41"><tr class="log-row"><td class="log-lineno"><a href="#l-41">&nbsp;41</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> I belive OriginPubkeyProvider just wraps another pubkey provider and adds origin information</span></td></tr></table>
<table class="log-line" id="l-42"><tr class="log-row"><td class="log-lineno"><a href="#l-42">&nbsp;42</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:seagreen">&lt;stickies-v&gt;</span><span class="log-msg"> I don&#39;t really understand what the relevant of the `IsSingleType()` part to the question is,  when is that relevant?</span></td></tr></table>
<table class="log-line" id="l-43"><tr class="log-row"><td class="log-lineno"><a href="#l-43">&nbsp;43</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> wait doesn&#39;t it return false if it finds hardened paths?</span></td></tr></table>
<table class="log-line" id="l-44"><tr class="log-row"><td class="log-lineno"><a href="#l-44">&nbsp;44</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> So since it doesn&#39;t need to derive anything it can call the wrapped pubkey provider</span></td></tr></table>
<table class="log-line" id="l-45"><tr class="log-row"><td class="log-lineno"><a href="#l-45">&nbsp;45</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> IsSingleType() is really not relevant. The question was just asking why existing methods like IsSingleType were not sufficient and a new CanSelfExpand method needed to be added</span></td></tr></table>
<table class="log-line" id="l-46"><tr class="log-row"><td class="log-lineno"><a href="#l-46">&nbsp;46</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:seagreen">&lt;stickies-v&gt;</span><span class="log-msg"> okay, thx</span></td></tr></table>
<table class="log-line" id="l-47"><tr class="log-row"><td class="log-lineno"><a href="#l-47">&nbsp;47</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> so does pkh(pubkey) not use ConstPubkeyProvider? bc I had assumed it did but stringintech said pkh(pubkey) would not be able to expand</span></td></tr></table>
<table class="log-line" id="l-48"><tr class="log-row"><td class="log-lineno"><a href="#l-48">&nbsp;48</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> pkh(pubkey) should self-expand, right?</span></td></tr></table>
<table class="log-line" id="l-49"><tr class="log-row"><td class="log-lineno"><a href="#l-49">&nbsp;49</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Anything that doesn&#39;t include a hardened path should self-expand</span></td></tr></table>
<table class="log-line" id="l-50"><tr class="log-row"><td class="log-lineno"><a href="#l-50">&nbsp;50</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> ryanofsky: that is what I thought</span></td></tr></table>
<table class="log-line" id="l-51"><tr class="log-row"><td class="log-lineno"><a href="#l-51">&nbsp;51</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Well next question is about application of CanSelfExpand, so related</span></td></tr></table>
<table class="log-line" id="l-52"><tr class="log-row"><td class="log-lineno"><a href="#l-52">&nbsp;52</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> 3. ExportWatchOnlyWallet only copies the descriptor cache if !desc-&gt;CanSelfExpand(). What exactly is stored in that cache? How could an incomplete cache affect address derivation on the watch-only wallet?</span></td></tr></table>
<table class="log-line" id="l-53"><tr class="log-row"><td class="log-lineno"><a href="#l-53">&nbsp;53</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> ryanofsky: about OriginPubkeyProvider question, m_provider is cast as std::unique_ptr&lt;PubkeyProvider&gt; which only defines a virtual CanSelfExpand function. how can I see that it is wrapped?</span></td></tr></table>
<table class="log-line" id="l-54"><tr class="log-row"><td class="log-lineno"><a href="#l-54">&nbsp;54</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Oh I might be using the word &quot;wrapped&quot; in a different way maybe?</span></td></tr></table>
<table class="log-line" id="l-55"><tr class="log-row"><td class="log-lineno"><a href="#l-55">&nbsp;55</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> monlovesmongo you are right i confused CanSelfExpand() with CanGetAddresses() earlier</span></td></tr></table>
<table class="log-line" id="l-56"><tr class="log-row"><td class="log-lineno"><a href="#l-56">&nbsp;56</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> I might also be asking the question in an unintuitive way haha</span></td></tr></table>
<table class="log-line" id="l-57"><tr class="log-row"><td class="log-lineno"><a href="#l-57">&nbsp;57</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> I just meant to say that OriginPubkeyProvider contains another PubkeyProvider. And since can just call CanSelfExpand on that provider since origin information in a descriptor doesn&#39;t affect what the descriptor expands to</span></td></tr></table>
<table class="log-line" id="l-58"><tr class="log-row"><td class="log-lineno"><a href="#l-58">&nbsp;58</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Origin information is just additional metadata, doesn&#39;t affect how addresses are generated or what scriptPubKeys are matched</span></td></tr></table>
<table class="log-line" id="l-59"><tr class="log-row"><td class="log-lineno"><a href="#l-59">&nbsp;59</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> ok that makes sense! thank you!</span></td></tr></table>
<table class="log-line" id="l-60"><tr class="log-row"><td class="log-lineno"><a href="#l-60">&nbsp;60</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:seagreen">&lt;stickies-v&gt;</span><span class="log-msg"> The cache stores all the parent xpubs (aren&#39;t those in the descriptor already?), a well a a number of derived xpubs (`m_derived_xpubs`), I think according to the size of the keypool?</span></td></tr></table>
<table class="log-line" id="l-61"><tr class="log-row"><td class="log-lineno"><a href="#l-61">&nbsp;61</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Ok, I&#39;m not 100% sure of this stuff myself so don&#39;t take me as authority, but that&#39;s my understanding</span></td></tr></table>
<table class="log-line" id="l-62"><tr class="log-row"><td class="log-lineno"><a href="#l-62">&nbsp;62</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> On question 3: This case we need to copy the cache because it contains the pregenerated addresses from a hardened path where copying them allows us to use those addresses while not having private keys to resolve the hardened paths.</span></td></tr></table>
<table class="log-line" id="l-63"><tr class="log-row"><td class="log-lineno"><a href="#l-63">&nbsp;63</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:seagreen">&lt;stickies-v&gt;</span><span class="log-msg"> so an incomplete cache would be similar to someone sending a transaction to a derived address that exceeds the gap limit, I think?</span></td></tr></table>
<table class="log-line" id="l-64"><tr class="log-row"><td class="log-lineno"><a href="#l-64">&nbsp;64</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> +1 stickies-v and stringintech yes that all sounds right</span></td></tr></table>
<table class="log-line" id="l-65"><tr class="log-row"><td class="log-lineno"><a href="#l-65">&nbsp;65</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:sienna">&lt;pablomartin4btc&gt;</span><span class="log-msg"> stringintech +1 (derivation info like last index used, etc)</span></td></tr></table>
<table class="log-line" id="l-66"><tr class="log-row"><td class="log-lineno"><a href="#l-66">&nbsp;66</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> The cache stores pre-derived pubkeys for hardened paths. If it isn’t copied, the watch-only wallet will not be able to see transactions sent to resulting addresses</span></td></tr></table>
<table class="log-line" id="l-67"><tr class="log-row"><td class="log-lineno"><a href="#l-67">&nbsp;67</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Feel free to ask more about that if not clear, next question is on another topic</span></td></tr></table>
<table class="log-line" id="l-68"><tr class="log-row"><td class="log-lineno"><a href="#l-68">&nbsp;68</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> 4. The exporter sets create_flags = GetWalletFlags() | WALLET_FLAG_DISABLE_PRIVATE_KEYS. Why is it important to preserve the original flags (e.g. AVOID_REUSE) instead of clearing everything and starting fresh?</span></td></tr></table>
<table class="log-line" id="l-69"><tr class="log-row"><td class="log-lineno"><a href="#l-69">&nbsp;69</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> How can the number of pre-derived pubkeys be configured? (before exporting the watchonly wallet) Is it configurable? Cause eventually we will run out of them I guess.</span></td></tr></table>
<table class="log-line" id="l-70"><tr class="log-row"><td class="log-lineno"><a href="#l-70">&nbsp;70</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> stringintech: great question!</span></td></tr></table>
<table class="log-line" id="l-71"><tr class="log-row"><td class="log-lineno"><a href="#l-71">&nbsp;71</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:sienna">&lt;pablomartin4btc&gt;</span><span class="log-msg"> 4. i think keeping user intent and expected behavior across exported/restored environments</span></td></tr></table>
<table class="log-line" id="l-72"><tr class="log-row"><td class="log-lineno"><a href="#l-72">&nbsp;72</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> yes good question i wonder if the keypool size options affect it</span></td></tr></table>
<table class="log-line" id="l-73"><tr class="log-row"><td class="log-lineno"><a href="#l-73">&nbsp;73</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:seagreen">&lt;stickies-v&gt;</span><span class="log-msg"> continuing on the cache: does that mean user should consider calling `keypoolrefill` rpc before exporting the watchonly wallet?</span></td></tr></table>
<table class="log-line" id="l-74"><tr class="log-row"><td class="log-lineno"><a href="#l-74">&nbsp;74</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> or maybe you just topup the keypool before exporting the wallet</span></td></tr></table>
<table class="log-line" id="l-75"><tr class="log-row"><td class="log-lineno"><a href="#l-75">&nbsp;75</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:seagreen">&lt;stickies-v&gt;</span><span class="log-msg"> oh we were all thinking the same hah</span></td></tr></table>
<table class="log-line" id="l-76"><tr class="log-row"><td class="log-lineno"><a href="#l-76">&nbsp;76</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Yes could look into it, good question</span></td></tr></table>
<table class="log-line" id="l-77"><tr class="log-row"><td class="log-lineno"><a href="#l-77">&nbsp;77</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> Cool :)))</span></td></tr></table>
<table class="log-line" id="l-78"><tr class="log-row"><td class="log-lineno"><a href="#l-78">&nbsp;78</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Yes for question 4 I had: I think AVOID_REUSE flag is actually not relevant. IIUC point of that flag is to avoid spending from coins previously spent from to improve privacy, and since watch-only wallets can&#39;t spend it&#39;s not relevant. But not sure about this.</span></td></tr></table>
<table class="log-line" id="l-79"><tr class="log-row"><td class="log-lineno"><a href="#l-79">&nbsp;79</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> In general seems good to preserve flags though</span></td></tr></table>
<table class="log-line" id="l-80"><tr class="log-row"><td class="log-lineno"><a href="#l-80">&nbsp;80</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> yes, any you never know if future flags might have differences in behavior</span></td></tr></table>
<table class="log-line" id="l-81"><tr class="log-row"><td class="log-lineno"><a href="#l-81">&nbsp;81</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Yep</span></td></tr></table>
<table class="log-line" id="l-82"><tr class="log-row"><td class="log-lineno"><a href="#l-82">&nbsp;82</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:purple">&lt;glozow&gt;</span><span class="log-msg"> I think AvailableCoins&#39;s result depends on AVOID_REUSE, so there is a difference?</span></td></tr></table>
<table class="log-line" id="l-83"><tr class="log-row"><td class="log-lineno"><a href="#l-83">&nbsp;83</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:purple">&lt;glozow&gt;</span><span class="log-msg"> even though you can&#39;t spend those coins</span></td></tr></table>
<table class="log-line" id="l-84"><tr class="log-row"><td class="log-lineno"><a href="#l-84">&nbsp;84</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> true</span></td></tr></table>
<table class="log-line" id="l-85"><tr class="log-row"><td class="log-lineno"><a href="#l-85">&nbsp;85</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Oh so balance would show up differently, that makes sense if I&#39;m understanding right</span></td></tr></table>
<table class="log-line" id="l-86"><tr class="log-row"><td class="log-lineno"><a href="#l-86">&nbsp;86</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:purple">&lt;glozow&gt;</span><span class="log-msg"> the user would be confused why the balance shown isn&#39;t the same</span></td></tr></table>
<table class="log-line" id="l-87"><tr class="log-row"><td class="log-lineno"><a href="#l-87">&nbsp;87</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:purple">&lt;glozow&gt;</span><span class="log-msg"> yeah I think so</span></td></tr></table>
<table class="log-line" id="l-88"><tr class="log-row"><td class="log-lineno"><a href="#l-88">&nbsp;88</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> like if you just need to provide an address AVOID_REUSE would affect which address could be returned?</span></td></tr></table>
<table class="log-line" id="l-89"><tr class="log-row"><td class="log-lineno"><a href="#l-89">&nbsp;89</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> oh ok</span></td></tr></table>
<table class="log-line" id="l-90"><tr class="log-row"><td class="log-lineno"><a href="#l-90">&nbsp;90</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> wait AVOID_REUSE would make the wallet not identify balances just bc address is reused?</span></td></tr></table>
<table class="log-line" id="l-91"><tr class="log-row"><td class="log-lineno"><a href="#l-91">&nbsp;91</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:purple">&lt;glozow&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/blob/cf15d45192e03ff2b0267842353f5f89541cb3f1/src/wallet/spend.cpp#L420" target="blank">https://github.com/bitcoin/bitcoin/blob/cf15d45192e03ff2b0267842353f5f89541cb3f1/src/wallet/spend.cpp#L420</a></span></td></tr></table>
<table class="log-line" id="l-92"><tr class="log-row"><td class="log-lineno"><a href="#l-92">&nbsp;92</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> monlovesmango, I&#39;m guessing it would still be in overall balance but not available balance</span></td></tr></table>
<table class="log-line" id="l-93"><tr class="log-row"><td class="log-lineno"><a href="#l-93">&nbsp;93</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> 5. Why does the exporter read the locator from the source wallet and write it verbatim into the new wallet instead of letting the new wallet start from block 0?</span></td></tr></table>
<table class="log-line" id="l-94"><tr class="log-row"><td class="log-lineno"><a href="#l-94">&nbsp;94</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> glozow: thanks :) ryanofsky: gotcha</span></td></tr></table>
<table class="log-line" id="l-95"><tr class="log-row"><td class="log-lineno"><a href="#l-95">&nbsp;95</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> I assume to not have to rescan the wallet?</span></td></tr></table>
<table class="log-line" id="l-96"><tr class="log-row"><td class="log-lineno"><a href="#l-96">&nbsp;96</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:sienna">&lt;pablomartin4btc&gt;</span><span class="log-msg"> monlovesmango: check avoid_reuse description in getbalance RPC</span></td></tr></table>
<table class="log-line" id="l-97"><tr class="log-row"><td class="log-lineno"><a href="#l-97">&nbsp;97</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> I think it is because we want to know where to resume scanning the blocks for txs we are interested in (and since we have already copied the old txs data, the wallet doesn&#39;t need to rescan from genesis). Though I am not confident yet on how locators work in general.</span></td></tr></table>
<table class="log-line" id="l-98"><tr class="log-row"><td class="log-lineno"><a href="#l-98">&nbsp;98</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> pablomartin4btc: will do!</span></td></tr></table>
<table class="log-line" id="l-99"><tr class="log-row"><td class="log-lineno"><a href="#l-99">&nbsp;99</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> feel free to ask about locators! But yeah that all sounds right, it&#39;s just to avoid rescanning. It would almost defeat purpose of the RPC if needed to rescan after exporting</span></td></tr></table>
<table class="log-line" id="l-100"><tr class="log-row"><td class="log-lineno"><a href="#l-100">100</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> 6. Consider a multisig descriptor wsh(multi(2,xpub1,xpub2)). If one cosigner exports a watch-only wallet and shares it with a third party, what new information does that third party learn compared to just giving them the descriptor strings?</span></td></tr></table>
<table class="log-line" id="l-101"><tr class="log-row"><td class="log-lineno"><a href="#l-101">101</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:sienna">&lt;pablomartin4btc&gt;</span><span class="log-msg"> monlovesmango +1 plus avoid missing transactions that happened after wallet creation but before export</span></td></tr></table>
<table class="log-line" id="l-102"><tr class="log-row"><td class="log-lineno"><a href="#l-102">102</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> About locators, what other parts of the codebase use them other than wallet?</span></td></tr></table>
<table class="log-line" id="l-103"><tr class="log-row"><td class="log-lineno"><a href="#l-103">103</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> pablomartin4btc: watch only wallet wouldn&#39;t find these? interesting</span></td></tr></table>
<table class="log-line" id="l-104"><tr class="log-row"><td class="log-lineno"><a href="#l-104">104</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> I think just the wallets and indexes use locators</span></td></tr></table>
<table class="log-line" id="l-105"><tr class="log-row"><td class="log-lineno"><a href="#l-105">105</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> is it all scenarios or are there only certain scenarios where watch only wallet wouldn&#39;t find these?</span></td></tr></table>
<table class="log-line" id="l-106"><tr class="log-row"><td class="log-lineno"><a href="#l-106">106</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> ryanofsky Thanks!</span></td></tr></table>
<table class="log-line" id="l-107"><tr class="log-row"><td class="log-lineno"><a href="#l-107">107</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:purple">&lt;glozow&gt;</span><span class="log-msg"> are these the same locators we use for syncing headers with our peers?</span></td></tr></table>
<table class="log-line" id="l-108"><tr class="log-row"><td class="log-lineno"><a href="#l-108">108</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Could be? Maybe they are. I&#39;m very ignorant of p2p</span></td></tr></table>
<table class="log-line" id="l-109"><tr class="log-row"><td class="log-lineno"><a href="#l-109">109</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:purple">&lt;glozow&gt;</span><span class="log-msg"> Seems they could be! `CBlockLocator`</span></td></tr></table>
<table class="log-line" id="l-110"><tr class="log-row"><td class="log-lineno"><a href="#l-110">110</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:magenta">&lt;furszy&gt;</span><span class="log-msg"> yes, they are.</span></td></tr></table>
<table class="log-line" id="l-111"><tr class="log-row"><td class="log-lineno"><a href="#l-111">111</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> Nice!</span></td></tr></table>
<table class="log-line" id="l-112"><tr class="log-row"><td class="log-lineno"><a href="#l-112">112</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> For answer 6 I had: If the third-party was given the watch-only wallet they would transaction history and wallet metadata along with the descriptor. If they only had the descriptor they might not be able to get full transaction history if uses hardened paths.</span></td></tr></table>
<table class="log-line" id="l-113"><tr class="log-row"><td class="log-lineno"><a href="#l-113">113</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> And also the addresses copied through the cache I guess (related to hardened paths)?</span></td></tr></table>
<table class="log-line" id="l-114"><tr class="log-row"><td class="log-lineno"><a href="#l-114">114</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> ryanofsky: oh that makes sense</span></td></tr></table>
<table class="log-line" id="l-115"><tr class="log-row"><td class="log-lineno"><a href="#l-115">115</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> stringintech, yes I think that&#39;s right</span></td></tr></table>
<table class="log-line" id="l-116"><tr class="log-row"><td class="log-lineno"><a href="#l-116">116</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> IIUC DescriptorCache just contains CExtPubKey objects so not addresses directly, but the thing you would use to derive them and also to match transactions</span></td></tr></table>
<table class="log-line" id="l-117"><tr class="log-row"><td class="log-lineno"><a href="#l-117">117</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> so just to test my understanding, would watch only descriptor of hardened path kinda be useless? or what information could you discern from the descriptor alone?</span></td></tr></table>
<table class="log-line" id="l-118"><tr class="log-row"><td class="log-lineno"><a href="#l-118">118</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> Oh right, thanks ryanofsky</span></td></tr></table>
<table class="log-line" id="l-119"><tr class="log-row"><td class="log-lineno"><a href="#l-119">119</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> monlovesmango, yes I can&#39;t think of any uses if the wallet only had a hardened descriptor and not private key and no cache</span></td></tr></table>
<table class="log-line" id="l-120"><tr class="log-row"><td class="log-lineno"><a href="#l-120">120</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> ryanofsky: cool thanks</span></td></tr></table>
<table class="log-line" id="l-121"><tr class="log-row"><td class="log-lineno"><a href="#l-121">121</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Since not much time left will just post the last two questions, feel free to respond to either</span></td></tr></table>
<table class="log-line" id="l-122"><tr class="log-row"><td class="log-lineno"><a href="#l-122">122</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> 7. In wallet_exported_watchonly.py, why does the test call wallet.keypoolrefill(100) before checking spendability across the online/offline pair?</span></td></tr></table>
<table class="log-line" id="l-123"><tr class="log-row"><td class="log-lineno"><a href="#l-123">123</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> 8. Prior to this PR, users could achieve a watch-only setup via dumpwallet → importwallet or importdescriptors. Compare those approaches with exportwatchonlywallet in terms of UX, completeness, and long-term maintainability.</span></td></tr></table>
<table class="log-line" id="l-124"><tr class="log-row"><td class="log-lineno"><a href="#l-124">124</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> On the last one, dumpwallet and importwallet currently do not exist in the codebase, right?</span></td></tr></table>
<table class="log-line" id="l-125"><tr class="log-row"><td class="log-lineno"><a href="#l-125">125</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Ha yeah, that&#39;s a pretty good reason</span></td></tr></table>
<table class="log-line" id="l-126"><tr class="log-row"><td class="log-lineno"><a href="#l-126">126</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> hahaah</span></td></tr></table>
<table class="log-line" id="l-127"><tr class="log-row"><td class="log-lineno"><a href="#l-127">127</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> :D :D :D</span></td></tr></table>
<table class="log-line" id="l-128"><tr class="log-row"><td class="log-lineno"><a href="#l-128">128</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> for the last one, there is no way to avoid rescan right?</span></td></tr></table>
<table class="log-line" id="l-129"><tr class="log-row"><td class="log-lineno"><a href="#l-129">129</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> I wrote: dumpwallet saves private keys which we don&#39;t want to export. importdescriptors would drop metadata, require rescanning, not work with hardened descriptors</span></td></tr></table>
<table class="log-line" id="l-130"><tr class="log-row"><td class="log-lineno"><a href="#l-130">130</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:sienna">&lt;pablomartin4btc&gt;</span><span class="log-msg"> stringintech yeah so at the moment you cant achieve the watch-only setup... unles you run it from the latest release</span></td></tr></table>
<table class="log-line" id="l-131"><tr class="log-row"><td class="log-lineno"><a href="#l-131">131</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:sienna">&lt;pablomartin4btc&gt;</span><span class="log-msg"> but you can do the dump from the wallettool/ bitcoin-wallet bin</span></td></tr></table>
<table class="log-line" id="l-132"><tr class="log-row"><td class="log-lineno"><a href="#l-132">132</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> and if descriptor of hardened path without priv key isn&#39;t useful importdescriptors wouldn&#39;t really do much?</span></td></tr></table>
<table class="log-line" id="l-133"><tr class="log-row"><td class="log-lineno"><a href="#l-133">133</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> pablomartin4btc, I think the PR doesn&#39;t provide a way to do this from wallettool, but it could in the future</span></td></tr></table>
<table class="log-line" id="l-134"><tr class="log-row"><td class="log-lineno"><a href="#l-134">134</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> ryanofsky: Is a manual copy of the wallet database file be equivalent of dumpwallet?</span></td></tr></table>
<table class="log-line" id="l-135"><tr class="log-row"><td class="log-lineno"><a href="#l-135">135</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> pablomartin4btc: ah thanks!!</span></td></tr></table>
<table class="log-line" id="l-136"><tr class="log-row"><td class="log-lineno"><a href="#l-136">136</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:sienna">&lt;pablomartin4btc&gt;</span><span class="log-msg"> ryanofsky, to run the dump, not the export</span></td></tr></table>
<table class="log-line" id="l-137"><tr class="log-row"><td class="log-lineno"><a href="#l-137">137</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> ryanofsky: ok you beat me haa</span></td></tr></table>
<table class="log-line" id="l-138"><tr class="log-row"><td class="log-lineno"><a href="#l-138">138</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> On question 7</span></td></tr></table>
<table class="log-line" id="l-139"><tr class="log-row"><td class="log-lineno"><a href="#l-139">139</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> In that test the watch-only wallet generates a new address and prepares an incomplete tx and for the offline wallet to be able to sign that tx it has to call keypoolrefill so it can pre-compute addresses which includes that specific address which allows the offline wallet to sign the transaction (since the offline wallet has the corresponding</span></td></tr></table>
<table class="log-line" id="l-140"><tr class="log-row"><td class="log-lineno"><a href="#l-140">140</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> private key)</span></td></tr></table>
<table class="log-line" id="l-141"><tr class="log-row"><td class="log-lineno"><a href="#l-141">141</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> i think a manual copy of the file had some more information, dumpwallet was like a text representation, but similar</span></td></tr></table>
<table class="log-line" id="l-142"><tr class="log-row"><td class="log-lineno"><a href="#l-142">142</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> ryanofsky: great thank you</span></td></tr></table>
<table class="log-line" id="l-143"><tr class="log-row"><td class="log-lineno"><a href="#l-143">143</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> stringintech, I think that is correct for question 7</span></td></tr></table>
<table class="log-line" id="l-144"><tr class="log-row"><td class="log-lineno"><a href="#l-144">144</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Thanks everybody for reviewing and participating!</span></td></tr></table>
<table class="log-line" id="l-145"><tr class="log-row"><td class="log-lineno"><a href="#l-145">145</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:red">&lt;stringintech&gt;</span><span class="log-msg"> Thank you and thanks everyone.</span></td></tr></table>
<table class="log-line" id="l-146"><tr class="log-row"><td class="log-lineno"><a href="#l-146">146</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:purple">&lt;glozow&gt;</span><span class="log-msg"> thanks ryanofsky!</span></td></tr></table>
<table class="log-line" id="l-147"><tr class="log-row"><td class="log-lineno"><a href="#l-147">147</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> Will end the meeting in a minute if no remaining comments</span></td></tr></table>
<table class="log-line" id="l-148"><tr class="log-row"><td class="log-lineno"><a href="#l-148">148</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:sienna">&lt;pablomartin4btc&gt;</span><span class="log-msg"> thank you ryanofsky! thanks for the useful notes!</span></td></tr></table>
<table class="log-line" id="l-149"><tr class="log-row"><td class="log-lineno"><a href="#l-149">149</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> thanks for hosting ryanofsky !! went fast and learned a lot</span></td></tr></table>
<table class="log-line" id="l-150"><tr class="log-row"><td class="log-lineno"><a href="#l-150">150</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> I learned a lot too, this was fun!</span></td></tr></table>
<table class="log-line" id="l-151"><tr class="log-row"><td class="log-lineno"><a href="#l-151">151</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:olive">&lt;ryanofsky&gt;</span><span class="log-msg"> #endmeeting </span></td></tr></table>]]></content><author><name>achow101</name></author><summary type="html"><![CDATA[Notes]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bitcoincore.reviews/assets/img/twitter_card.png" /><media:content medium="image" url="https://bitcoincore.reviews/assets/img/twitter_card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Improve TxOrphanage denial of service bounds</title><link href="https://bitcoincore.reviews/31829" rel="alternate" type="text/html" title="Improve TxOrphanage denial of service bounds" /><published>2025-06-18T00:00:00+00:00</published><updated>2025-06-18T00:00:00+00:00</updated><id>https://bitcoincore.reviews/#31829</id><content type="html" xml:base="https://bitcoincore.reviews/31829"><![CDATA[<h2 id="notes">Notes</h2>

<ul>
  <li>
    <p>The <a href="https://github.com/bitcoin/bitcoin/pull/31829#issue-2840961349">PR description</a> summarizes the motivations for
this change and the new eviction strategy: we must ensure the orphanage is DoS-resistant, but also want to prevent any
peer from affecting another peer’s usage of orphanage space.</p>
  </li>
  <li>
    <p>The PR does a few things: it virtualizes the <code class="language-plaintext highlighter-rouge">TxOrphanage</code> class inherited by <code class="language-plaintext highlighter-rouge">TxOrphanageImpl</code>, it implements a new
eviction strategy, and it replaces the various <code class="language-plaintext highlighter-rouge">TxOrphanage</code> data structure(s) with a single <code class="language-plaintext highlighter-rouge">boost::multi_index_container</code>.</p>
  </li>
  <li>
    <p>With these changes, we can now guarantee at least 1 maximum size-package worth of orphan resolution per peer at a
time. This is tested by the <code class="language-plaintext highlighter-rouge">txorphan_protected</code> fuzz test and a few functional tests.</p>
  </li>
  <li>
    <p>If most peers are not providing orphans, the unused space allocated to them can be used by peers that need it.</p>
  </li>
  <li>
    <p>An earlier version of this PR implemented the new eviction strategy using the existing <code class="language-plaintext highlighter-rouge">TxOrphanage</code> data structures.
This version makes the PR’s behavior changes clearer. It may also demonstrate why a <code class="language-plaintext highlighter-rouge">boost::multi_index_container</code> is
the more natural data structure for <code class="language-plaintext highlighter-rouge">TxOrphanage</code>, as the original implementation is a bit convoluted.
You can find that version of the PR <a href="https://github.com/glozow/bitcoin/tree/2025-05-copy-31829">here</a>.</p>
  </li>
</ul>

<h2 id="questions">Questions</h2>

<h3 id="concept">Concept</h3>

<ol>
  <li>
    <p>Did you review the PR? <a href="https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#peer-review">Concept ACK, approach ACK, tested ACK, or NACK</a>? What was your review approach?</p>
  </li>
  <li>
    <p>Why is the current <code class="language-plaintext highlighter-rouge">TxOrphanage</code> global maximum size limit of 100 transactions with random eviction problematic? Can you think of a concrete attack scenario that would affect 1-parent-1-child (1p1c) relay?</p>
  </li>
  <li>
    <p>Can you summarize the changes to the eviction algorithm at a high level?</p>
  </li>
  <li>
    <p>Why is it desirable to allow peers to exceed their individual limits while the global limits are not reached?</p>
  </li>
  <li>
    <p>The new algorithm evicts announcements instead of transactions. What is the difference and why does it matter?</p>
  </li>
  <li>
    <p>Why is there an announcement “limit” but a memory <em>“reservation”</em>?</p>
  </li>
  <li>
    <p>How does the per-peer memory usage reservation change as the number of peers increases?</p>
  </li>
  <li>
    <p>How does the per-peer announcement limit change as the number of peers increases? Why is this different from the per-peer memory usage reservation?</p>
  </li>
  <li>
    <p>Why is it ok to remove orphan expiration?</p>
  </li>
  <li>
    <p>Should we also remove <code class="language-plaintext highlighter-rouge">EraseForBlock</code> and instead rely on eviction to remove orphans that confirm or conflict with
a block? Why or why not?</p>
  </li>
  <li>
    <p>Going back to your attack scenario from an earlier question, how does this PR improve the reliability of 1p1c relay in adversarial environments?</p>
  </li>
</ol>

<h3 id="implementation">Implementation</h3>

<ol>
  <li>
    <p>What is the purpose of reimplementing <code class="language-plaintext highlighter-rouge">TxOrphanageImpl</code> using a <code class="language-plaintext highlighter-rouge">boost::multi_index_container</code> along with the eviction changes?</p>
  </li>
  <li>
    <p>What is a peer’s “DoS Score” and how is it calculated?</p>
  </li>
  <li>
    <p>The global memory limit scales with the number of peers. Could this create new DoS vectors where an attacker opens many connections to increase the global limit?</p>
  </li>
  <li>
    <p>Is it possible for the orphanage to <code class="language-plaintext highlighter-rouge">NeedsTrim()</code> when there is no peer whose “DoS Score” is greater than 1?</p>
  </li>
  <li>
    <p>Is it possible that a peer’s “DoS Score” is greater than 1 but <code class="language-plaintext highlighter-rouge">NeedsTrim()</code> returns false?</p>
  </li>
  <li>
    <p>When evicting orphans, why <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/498f1c019197a8e4105490cdc4a0605594ca97d5#diff-e6100361fa0e9e25478f808ca084e5f681d4dddbbee7b3bea0f9d5bcd29db3aaR457">evict</a> non-reconsiderable orphans before reconsiderable ones? What’s the difference between these categories?</p>
  </li>
  <li>
    <p>How does the number of announcements represent a meaningful bound on “computation” in <code class="language-plaintext highlighter-rouge">TxOrphanage</code> operations?</p>
  </li>
  <li>
    <p>What is the computational complexity of the <code class="language-plaintext highlighter-rouge">LimitOrphans</code> <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/498f1c019197a8e4105490cdc4a0605594ca97d5#diff-e6100361fa0e9e25478f808ca084e5f681d4dddbbee7b3bea0f9d5bcd29db3aaR433-R478">loop</a>? How many heap operations can there be? How many erasures can there be?</p>
  </li>
  <li>
    <p>How can we test (and do tests exist?) that <code class="language-plaintext highlighter-rouge">TxOrphanage</code>’s internal data structures are updated correctly, that its DoS limits are correctly enforced, and that the orphans of “honest” peers are protected from eviction?</p>
  </li>
  <li>
    <p>How does the <code class="language-plaintext highlighter-rouge">txorphan_protected</code> <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/05e6241be627aa0152698f5f71adfacd790df58d">fuzz harness</a> test that orphans are protected from eviction?</p>
  </li>
  <li>
    <p>The default announcement limit is <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/5e86bb8b2914d43112a568d04fbbdb14036b70a6">increased</a> from 100 to 3000. How was this number chosen and what are the tradeoffs?</p>
  </li>
</ol>

<h2 id="meeting-log">Meeting Log</h2>

<table class="log-line" id="l-1"><tr class="log-row"><td class="log-lineno"><a href="#l-1">&nbsp;&nbsp;1</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> #startmeeting </span></td></tr></table>
<table class="log-line" id="l-2"><tr class="log-row"><td class="log-lineno"><a href="#l-2">&nbsp;&nbsp;2</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> heyy</span></td></tr></table>
<table class="log-line" id="l-3"><tr class="log-row"><td class="log-lineno"><a href="#l-3">&nbsp;&nbsp;3</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:blue">&lt;pseudoramdom&gt;</span><span class="log-msg"> hi hi</span></td></tr></table>
<table class="log-line" id="l-4"><tr class="log-row"><td class="log-lineno"><a href="#l-4">&nbsp;&nbsp;4</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> welcome to PR Review Club! we&#39;re looking at Improve TxOrphanage denial of service bounds today: <a href="https://bitcoincore.reviews/31829" target="blank">https://bitcoincore.reviews/31829</a></span></td></tr></table>
<table class="log-line" id="l-5"><tr class="log-row"><td class="log-lineno"><a href="#l-5">&nbsp;&nbsp;5</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> hola</span></td></tr></table>
<table class="log-line" id="l-6"><tr class="log-row"><td class="log-lineno"><a href="#l-6">&nbsp;&nbsp;6</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:grey">&lt;theStack&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-7"><tr class="log-row"><td class="log-lineno"><a href="#l-7">&nbsp;&nbsp;7</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> did anybody get a chance to review the PR or the notes?</span></td></tr></table>
<table class="log-line" id="l-8"><tr class="log-row"><td class="log-lineno"><a href="#l-8">&nbsp;&nbsp;8</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:hotpink">&lt;instagibbs&gt;</span><span class="log-msg"> reviewing the PR</span></td></tr></table>
<table class="log-line" id="l-9"><tr class="log-row"><td class="log-lineno"><a href="#l-9">&nbsp;&nbsp;9</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> yes, mostly notes and focused on new txorphanage</span></td></tr></table>
<table class="log-line" id="l-10"><tr class="log-row"><td class="log-lineno"><a href="#l-10">&nbsp;10</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> yes, mostly. haven&#39;t reviewed test commits</span></td></tr></table>
<table class="log-line" id="l-11"><tr class="log-row"><td class="log-lineno"><a href="#l-11">&nbsp;11</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> instagibbs marcofleon monlovesmango: awesome!</span></td></tr></table>
<table class="log-line" id="l-12"><tr class="log-row"><td class="log-lineno"><a href="#l-12">&nbsp;12</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> Why is the current TxOrphanage global maximum size limit of 100 transactions with random eviction problematic? Can you think of a concrete attack scenario that would affect 1-parent-1-child (1p1c) relay?</span></td></tr></table>
<table class="log-line" id="l-13"><tr class="log-row"><td class="log-lineno"><a href="#l-13">&nbsp;13</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:blue">&lt;pseudoramdom&gt;</span><span class="log-msg"> Just read the notes as well</span></td></tr></table>
<table class="log-line" id="l-14"><tr class="log-row"><td class="log-lineno"><a href="#l-14">&nbsp;14</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> i&#39;m also sending the fuzz tests cmooon</span></td></tr></table>
<table class="log-line" id="l-15"><tr class="log-row"><td class="log-lineno"><a href="#l-15">&nbsp;15</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> bc it enables peers to evict other peer&#39;s orphans from your orphanage</span></td></tr></table>
<table class="log-line" id="l-16"><tr class="log-row"><td class="log-lineno"><a href="#l-16">&nbsp;16</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> Attack scenario could be an attacker node spamming the orphanage to prevent a child paying for a low fee parent</span></td></tr></table>
<table class="log-line" id="l-17"><tr class="log-row"><td class="log-lineno"><a href="#l-17">&nbsp;17</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> if the child keeps getting evicted, then i guess parent would be dropped from mempool?</span></td></tr></table>
<table class="log-line" id="l-18"><tr class="log-row"><td class="log-lineno"><a href="#l-18">&nbsp;18</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: in a 1p1c scenario, the parent isn&#39;t in mempool yet. We opportunistically pair it with its child in orphanage if we find one. But if the child gets evicted, then we&#39;re out of luck</span></td></tr></table>
<table class="log-line" id="l-19"><tr class="log-row"><td class="log-lineno"><a href="#l-19">&nbsp;19</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> Can you summarize the changes to the eviction algorithm at a high level?</span></td></tr></table>
<table class="log-line" id="l-20"><tr class="log-row"><td class="log-lineno"><a href="#l-20">&nbsp;20</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> if a malicious peer floods you with orphans, its pretty likely that you will evict a child that could have otherwise been resolved as 1p1c?</span></td></tr></table>
<table class="log-line" id="l-21"><tr class="log-row"><td class="log-lineno"><a href="#l-21">&nbsp;21</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:blue">&lt;pseudoramdom&gt;</span><span class="log-msg"> +1. Low fee rate parent + CPFP scenario, attacker floods with orphan tx?</span></td></tr></table>
<table class="log-line" id="l-22"><tr class="log-row"><td class="log-lineno"><a href="#l-22">&nbsp;22</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> well eviction is no longer random, it&#39;s based on the &quot;worst behaving&quot; peer, and its the oldest announcement</span></td></tr></table>
<table class="log-line" id="l-23"><tr class="log-row"><td class="log-lineno"><a href="#l-23">&nbsp;23</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> highest Dos score peer will have their annoucement removed</span></td></tr></table>
<table class="log-line" id="l-24"><tr class="log-row"><td class="log-lineno"><a href="#l-24">&nbsp;24</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: yep! and we&#39;ll get into how we calculate DoS score in a later question</span></td></tr></table>
<table class="log-line" id="l-25"><tr class="log-row"><td class="log-lineno"><a href="#l-25">&nbsp;25</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> Why is it desirable to allow peers to exceed their individual limits while the global limits are not reached?</span></td></tr></table>
<table class="log-line" id="l-26"><tr class="log-row"><td class="log-lineno"><a href="#l-26">&nbsp;26</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> Because there could be a peer that is sending a lot of orphans, not necessarily dishonestly</span></td></tr></table>
<table class="log-line" id="l-27"><tr class="log-row"><td class="log-lineno"><a href="#l-27">&nbsp;27</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:hotpink">&lt;instagibbs&gt;</span><span class="log-msg"> in the non-adversarial case, it could allow a lot more &quot;honest&quot; CPFPs through</span></td></tr></table>
<table class="log-line" id="l-28"><tr class="log-row"><td class="log-lineno"><a href="#l-28">&nbsp;28</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:blue">&lt;pseudoramdom&gt;</span><span class="log-msg"> Not all peers may be active actively broadcasting at the same time?</span></td></tr></table>
<table class="log-line" id="l-29"><tr class="log-row"><td class="log-lineno"><a href="#l-29">&nbsp;29</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> just makes sense to not waste the space by having an inflexible limit per peer</span></td></tr></table>
<table class="log-line" id="l-30"><tr class="log-row"><td class="log-lineno"><a href="#l-30">&nbsp;30</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: instagibbs: yes exactly. often, peers are using a lot of resources simply because they are the most helpful peer</span></td></tr></table>
<table class="log-line" id="l-31"><tr class="log-row"><td class="log-lineno"><a href="#l-31">&nbsp;31</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:blue">&lt;pseudoramdom&gt;</span><span class="log-msg"> Is it possible for attacker to game the DDoS scoring?</span></td></tr></table>
<table class="log-line" id="l-32"><tr class="log-row"><td class="log-lineno"><a href="#l-32">&nbsp;32</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> rather than having a common pool of orphans, this pr will restructure orphanage to track orphanage counts and usage by peer. each peer will be subject to a orphan announcment count limit that is the global max announcement count divided by the number of peers, and allowed a set amount of weight for the orphans they announce</span></td></tr></table>
<table class="log-line" id="l-33"><tr class="log-row"><td class="log-lineno"><a href="#l-33">&nbsp;33</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> This was why I originally thought of doing a &quot;token bucket&quot; approach where we&#39;d allow peers resources based on an amount of tokens, and then either replenished tokens if the orphans were useful or destroyed them if it was just spam</span></td></tr></table>
<table class="log-line" id="l-34"><tr class="log-row"><td class="log-lineno"><a href="#l-34">&nbsp;34</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> The new algorithm evicts announcements instead of transactions. What is the difference and why does it matter?</span></td></tr></table>
<table class="log-line" id="l-35"><tr class="log-row"><td class="log-lineno"><a href="#l-35">&nbsp;35</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> pseudoramdom: I was thinking about this too. I think if you flood a node with peers with counts that are just over the limit you could theoretically evict a high weight tx from a peer with high weight announcements but low announcement count</span></td></tr></table>
<table class="log-line" id="l-36"><tr class="log-row"><td class="log-lineno"><a href="#l-36">&nbsp;36</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: yeah, you might as well use the space</span></td></tr></table>
<table class="log-line" id="l-37"><tr class="log-row"><td class="log-lineno"><a href="#l-37">&nbsp;37</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> annoucements are wtxid, peer. so if a peer is misbehaving then the orphan will only be removed for that peer. So a peer can&#39;t affect the orphan announcments of other peers</span></td></tr></table>
<table class="log-line" id="l-38"><tr class="log-row"><td class="log-lineno"><a href="#l-38">&nbsp;38</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> but i&#39;m not sure thats really too much of a concern..?</span></td></tr></table>
<table class="log-line" id="l-39"><tr class="log-row"><td class="log-lineno"><a href="#l-39">&nbsp;39</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> pseudoramdom: do you mean for an attacker to try to get us to evict a specific orphan? or to appear less resource-intensive than another peer and get them chosen for eviction instead?</span></td></tr></table>
<table class="log-line" id="l-40"><tr class="log-row"><td class="log-lineno"><a href="#l-40">&nbsp;40</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: yes bingo!</span></td></tr></table>
<table class="log-line" id="l-41"><tr class="log-row"><td class="log-lineno"><a href="#l-41">&nbsp;41</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:blue">&lt;pseudoramdom&gt;</span><span class="log-msg"> I was thinking of latter. Staying just under the limit but still managing to evict certain orphans.</span></td></tr></table>
<table class="log-line" id="l-42"><tr class="log-row"><td class="log-lineno"><a href="#l-42">&nbsp;42</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> I think this relates to pseudoramdom&#39;s question: if they did something tricky to try to get a particular orphan of theirs chosen for eviction, that&#39;s fine, because we&#39;ll keep the transaction as long as another peer has announced it</span></td></tr></table>
<table class="log-line" id="l-43"><tr class="log-row"><td class="log-lineno"><a href="#l-43">&nbsp;43</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> as long as you have at least one honest peer</span></td></tr></table>
<table class="log-line" id="l-44"><tr class="log-row"><td class="log-lineno"><a href="#l-44">&nbsp;44</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> the orphan should (hopefully) remain in the orphanage</span></td></tr></table>
<table class="log-line" id="l-45"><tr class="log-row"><td class="log-lineno"><a href="#l-45">&nbsp;45</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> pseudoramdom: the other peer won&#39;t experience eviction unless they exceed the limits. This still presents a limitation - peers might get evicted if they&#39;re just sending stuff at a far faster rate than we manage to process them - but the point is you can&#39;t influence the eviction of another peer&#39;s announcements</span></td></tr></table>
<table class="log-line" id="l-46"><tr class="log-row"><td class="log-lineno"><a href="#l-46">&nbsp;46</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> any peer that stays under peer limits can&#39;t have their orphan evicted by another peer</span></td></tr></table>
<table class="log-line" id="l-47"><tr class="log-row"><td class="log-lineno"><a href="#l-47">&nbsp;47</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: correct</span></td></tr></table>
<table class="log-line" id="l-48"><tr class="log-row"><td class="log-lineno"><a href="#l-48">&nbsp;48</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> Why is there an announcement “limit” but a memory “reservation”?</span></td></tr></table>
<table class="log-line" id="l-49"><tr class="log-row"><td class="log-lineno"><a href="#l-49">&nbsp;49</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> hi!</span></td></tr></table>
<table class="log-line" id="l-50"><tr class="log-row"><td class="log-lineno"><a href="#l-50">&nbsp;50</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> sipa: hello hello</span></td></tr></table>
<table class="log-line" id="l-51"><tr class="log-row"><td class="log-lineno"><a href="#l-51">&nbsp;51</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> Actually, I feel like you can call them both reservations, haha</span></td></tr></table>
<table class="log-line" id="l-52"><tr class="log-row"><td class="log-lineno"><a href="#l-52">&nbsp;52</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> I think bc announcement count affects CPU usage? and its not much of a concern to allocate a certain amount of memory to each peer. guessing here, think I read something like that in the PR notes</span></td></tr></table>
<table class="log-line" id="l-53"><tr class="log-row"><td class="log-lineno"><a href="#l-53">&nbsp;53</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> glozow: both have a global limit, and a per-peer reservation</span></td></tr></table>
<table class="log-line" id="l-54"><tr class="log-row"><td class="log-lineno"><a href="#l-54">&nbsp;54</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> but one can be exceeded and the other is a decreasing share of the pie</span></td></tr></table>
<table class="log-line" id="l-55"><tr class="log-row"><td class="log-lineno"><a href="#l-55">&nbsp;55</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> the difference is the announcement global limit is a constant, but the global memory limit is a function of the number of peers</span></td></tr></table>
<table class="log-line" id="l-56"><tr class="log-row"><td class="log-lineno"><a href="#l-56">&nbsp;56</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> so the &quot;constant&quot; is a global announcement limit, and per-peer memory reservation</span></td></tr></table>
<table class="log-line" id="l-57"><tr class="log-row"><td class="log-lineno"><a href="#l-57">&nbsp;57</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> or i think we make the assumption that there is more memory that can be used up to a certain point, but for announcements we&#39;re trying to figure out which peer is &quot;overusing&quot; their share</span></td></tr></table>
<table class="log-line" id="l-58"><tr class="log-row"><td class="log-lineno"><a href="#l-58">&nbsp;58</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> sipa: I wouldn&#39;t call it an announcement &quot;reservation&quot; though, because you aren&#39;t guaranteed it. if more peers appear, your announcement limit decreases.</span></td></tr></table>
<table class="log-line" id="l-59"><tr class="log-row"><td class="log-lineno"><a href="#l-59">&nbsp;59</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> hahah so many ways to state the same things</span></td></tr></table>
<table class="log-line" id="l-60"><tr class="log-row"><td class="log-lineno"><a href="#l-60">&nbsp;60</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> On the other hand, your memory reservation is guaranteed and constant no matter how the peer set changes</span></td></tr></table>
<table class="log-line" id="l-61"><tr class="log-row"><td class="log-lineno"><a href="#l-61">&nbsp;61</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> glozow: that just means the reservation is dynamic :p</span></td></tr></table>
<table class="log-line" id="l-62"><tr class="log-row"><td class="log-lineno"><a href="#l-62">&nbsp;62</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> but yeah, the term reservation is weird in that context</span></td></tr></table>
<table class="log-line" id="l-63"><tr class="log-row"><td class="log-lineno"><a href="#l-63">&nbsp;63</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> memory reservation is guaranteed per peer yes?</span></td></tr></table>
<table class="log-line" id="l-64"><tr class="log-row"><td class="log-lineno"><a href="#l-64">&nbsp;64</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> oh yeah you said it above</span></td></tr></table>
<table class="log-line" id="l-65"><tr class="log-row"><td class="log-lineno"><a href="#l-65">&nbsp;65</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> &quot;Yes sir, your reservation for 4 tonight at FancyDining is confirmed.&quot; - &quot;What do you mean my reservation was dropped to 3, because another group made a reservation?!&quot;</span></td></tr></table>
<table class="log-line" id="l-66"><tr class="log-row"><td class="log-lineno"><a href="#l-66">&nbsp;66</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: yes. you&#39;re also guaranteed a certain number of announcements, but it&#39;s dynamic</span></td></tr></table>
<table class="log-line" id="l-67"><tr class="log-row"><td class="log-lineno"><a href="#l-67">&nbsp;67</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> sipa: yeah that&#39;s what I mean is weird about &quot;reservation&quot;</span></td></tr></table>
<table class="log-line" id="l-68"><tr class="log-row"><td class="log-lineno"><a href="#l-68">&nbsp;68</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> fair enough</span></td></tr></table>
<table class="log-line" id="l-69"><tr class="log-row"><td class="log-lineno"><a href="#l-69">&nbsp;69</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> We shall commence the bikeshedding for a better term now.</span></td></tr></table>
<table class="log-line" id="l-70"><tr class="log-row"><td class="log-lineno"><a href="#l-70">&nbsp;70</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> How does the per-peer memory usage reservation change as the number of peers increases? How does the per-peer announcement limit change as the number of peers increases?</span></td></tr></table>
<table class="log-line" id="l-71"><tr class="log-row"><td class="log-lineno"><a href="#l-71">&nbsp;71</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> the per peer memory usage doesn&#39;t change iiuc</span></td></tr></table>
<table class="log-line" id="l-72"><tr class="log-row"><td class="log-lineno"><a href="#l-72">&nbsp;72</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> wait, why is one a function of the number of peers and the other not?</span></td></tr></table>
<table class="log-line" id="l-73"><tr class="log-row"><td class="log-lineno"><a href="#l-73">&nbsp;73</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: yes 💯</span></td></tr></table>
<table class="log-line" id="l-74"><tr class="log-row"><td class="log-lineno"><a href="#l-74">&nbsp;74</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> but the per peer annoucement limit decreases?</span></td></tr></table>
<table class="log-line" id="l-75"><tr class="log-row"><td class="log-lineno"><a href="#l-75">&nbsp;75</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> yup</span></td></tr></table>
<table class="log-line" id="l-76"><tr class="log-row"><td class="log-lineno"><a href="#l-76">&nbsp;76</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: indeed, why?</span></td></tr></table>
<table class="log-line" id="l-77"><tr class="log-row"><td class="log-lineno"><a href="#l-77">&nbsp;77</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> What is the purpose of the announcement limit?</span></td></tr></table>
<table class="log-line" id="l-78"><tr class="log-row"><td class="log-lineno"><a href="#l-78">&nbsp;78</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> is it bc anncouncement count affects CPU usage? and so we want to limit this globally?</span></td></tr></table>
<table class="log-line" id="l-79"><tr class="log-row"><td class="log-lineno"><a href="#l-79">&nbsp;79</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: how does our &quot;budget&quot; for CPU usage change with more peers sending us orphans?</span></td></tr></table>
<table class="log-line" id="l-80"><tr class="log-row"><td class="log-lineno"><a href="#l-80">&nbsp;80</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: more specifically, the *global* announcement limit directly affects the *latency* of trimming announcements - it&#39;s not because we have more peers that we can tolerate a longer latency in processing transactions</span></td></tr></table>
<table class="log-line" id="l-81"><tr class="log-row"><td class="log-lineno"><a href="#l-81">&nbsp;81</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: but for memory usage, it is normal and expected that your maximum memory usage goes up with more peers - if you&#39;re memory-constrained, you should limit your number of peers anyway</span></td></tr></table>
<table class="log-line" id="l-82"><tr class="log-row"><td class="log-lineno"><a href="#l-82">&nbsp;82</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> (the answer is it doesn&#39;t. we can&#39;t tolerate more announcements when we have more peers)</span></td></tr></table>
<table class="log-line" id="l-83"><tr class="log-row"><td class="log-lineno"><a href="#l-83">&nbsp;83</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> (sorry if i spoiled it?)</span></td></tr></table>
<table class="log-line" id="l-84"><tr class="log-row"><td class="log-lineno"><a href="#l-84">&nbsp;84</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> in LimitOrphans we&#39;re removing announcements one by one right? and so that&#39;s why we&#39;re using that limit as a proxy for cpu usage</span></td></tr></table>
<table class="log-line" id="l-85"><tr class="log-row"><td class="log-lineno"><a href="#l-85">&nbsp;85</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> sipa: thank you that answered my question</span></td></tr></table>
<table class="log-line" id="l-86"><tr class="log-row"><td class="log-lineno"><a href="#l-86">&nbsp;86</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> marcofleon: that is also a good point</span></td></tr></table>
<table class="log-line" id="l-87"><tr class="log-row"><td class="log-lineno"><a href="#l-87">&nbsp;87</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: yup, the number of iterations that loop in LimitOrphans scales directly with the *global* announcement limit</span></td></tr></table>
<table class="log-line" id="l-88"><tr class="log-row"><td class="log-lineno"><a href="#l-88">&nbsp;88</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> cool cool we can move on thanks all :)</span></td></tr></table>
<table class="log-line" id="l-89"><tr class="log-row"><td class="log-lineno"><a href="#l-89">&nbsp;89</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> Why is it ok to remove orphan expiration?</span></td></tr></table>
<table class="log-line" id="l-90"><tr class="log-row"><td class="log-lineno"><a href="#l-90">&nbsp;90</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> because we take care of oldest orphans now whenever we start evicting</span></td></tr></table>
<table class="log-line" id="l-91"><tr class="log-row"><td class="log-lineno"><a href="#l-91">&nbsp;91</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: yes exactly, that&#39;s the intuition for why the number of announcements is the number we are interested in. not the number of unique orphans (which is what we used to limit)</span></td></tr></table>
<table class="log-line" id="l-92"><tr class="log-row"><td class="log-lineno"><a href="#l-92">&nbsp;92</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> glozow: FWIW, have you benchmarked how long LimitOrphans can take?</span></td></tr></table>
<table class="log-line" id="l-93"><tr class="log-row"><td class="log-lineno"><a href="#l-93">&nbsp;93</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> bc the orhpanage now has other concrete metrics by which we can reliable evict orphans which guarantee the oldest and evicted first and orphans that are no longer needed are removed</span></td></tr></table>
<table class="log-line" id="l-94"><tr class="log-row"><td class="log-lineno"><a href="#l-94">&nbsp;94</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: yep! but wait, doesn&#39;t this mean we can be holding on to orphans for days, or weeks, etc?</span></td></tr></table>
<table class="log-line" id="l-95"><tr class="log-row"><td class="log-lineno"><a href="#l-95">&nbsp;95</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> yes..?</span></td></tr></table>
<table class="log-line" id="l-96"><tr class="log-row"><td class="log-lineno"><a href="#l-96">&nbsp;96</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> sipa: not since the rewrite. I can find my old benchmarks and run them. IIRC the `AddTx`s is what takes a really long time</span></td></tr></table>
<table class="log-line" id="l-97"><tr class="log-row"><td class="log-lineno"><a href="#l-97">&nbsp;97</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> hmm yeah i guess we can hold onto it for a while now. as long as there&#39;s no conflicting txs that arrive in a block or something</span></td></tr></table>
<table class="log-line" id="l-98"><tr class="log-row"><td class="log-lineno"><a href="#l-98">&nbsp;98</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> glozow: sure, but the reason for the existence of the global announcement limit is the time that LimitOrphans can take, not AddTx... so perhaps it&#39;s worth benchmarking, and seeing if we can perhaps tolerate a higher global announcement limit (or, otherwise, be sad to find out it needs to be reduced)</span></td></tr></table>
<table class="log-line" id="l-99"><tr class="log-row"><td class="log-lineno"><a href="#l-99">&nbsp;99</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: is it problematic?</span></td></tr></table>
<table class="log-line" id="l-100"><tr class="log-row"><td class="log-lineno"><a href="#l-100">100</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> i don&#39;t think so, as long as limits aren&#39;t being exceeded, seems fine to me</span></td></tr></table>
<table class="log-line" id="l-101"><tr class="log-row"><td class="log-lineno"><a href="#l-101">101</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> sipa: yeah definitely. I just wanted to add some context for anybody who looks at the old benchmarks. What do you think is an acceptable amount of time?</span></td></tr></table>
<table class="log-line" id="l-102"><tr class="log-row"><td class="log-lineno"><a href="#l-102">102</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> unless i&#39;m missing something...</span></td></tr></table>
<table class="log-line" id="l-103"><tr class="log-row"><td class="log-lineno"><a href="#l-103">103</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> glozow: probably in the millisecond range?</span></td></tr></table>
<table class="log-line" id="l-104"><tr class="log-row"><td class="log-lineno"><a href="#l-104">104</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> marcofleon: I agree with you</span></td></tr></table>
<table class="log-line" id="l-105"><tr class="log-row"><td class="log-lineno"><a href="#l-105">105</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> sipa: 👍</span></td></tr></table>
<table class="log-line" id="l-106"><tr class="log-row"><td class="log-lineno"><a href="#l-106">106</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> Should we also remove EraseForBlock and instead rely on eviction to remove orphans that confirm or conflict with a block? Why or why not?</span></td></tr></table>
<table class="log-line" id="l-107"><tr class="log-row"><td class="log-lineno"><a href="#l-107">107</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> could maybe be worked out somehow, but feels like a separate thing</span></td></tr></table>
<table class="log-line" id="l-108"><tr class="log-row"><td class="log-lineno"><a href="#l-108">108</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> so i would say no</span></td></tr></table>
<table class="log-line" id="l-109"><tr class="log-row"><td class="log-lineno"><a href="#l-109">109</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> it&#39;s not the same reason that an orphan is being removed</span></td></tr></table>
<table class="log-line" id="l-110"><tr class="log-row"><td class="log-lineno"><a href="#l-110">110</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> I would also say no, bc otherwise the caller would have to have knowledge of what is in the orphanage and individually evict txs</span></td></tr></table>
<table class="log-line" id="l-111"><tr class="log-row"><td class="log-lineno"><a href="#l-111">111</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> fwiw, I think the worst case for EraseForBlock is probably worse than LimitOrphans. But EraseForBlock happens on the scheduler thread so speed might not be as much of an issue</span></td></tr></table>
<table class="log-line" id="l-112"><tr class="log-row"><td class="log-lineno"><a href="#l-112">112</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> glozow: it also costs an attacker mining a valid block</span></td></tr></table>
<table class="log-line" id="l-113"><tr class="log-row"><td class="log-lineno"><a href="#l-113">113</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> sipa: is that true? You could look at what&#39;s in the projected next block and just create conflicting transactions with a lot of nonexistent utxos</span></td></tr></table>
<table class="log-line" id="l-114"><tr class="log-row"><td class="log-lineno"><a href="#l-114">114</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> glozow: sure, but the victim will still never experience it more than once per block, which is expensive. good point though that it&#39;s not necessarily the attacker themselves that pay this cost</span></td></tr></table>
<table class="log-line" id="l-115"><tr class="log-row"><td class="log-lineno"><a href="#l-115">115</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> right. it&#39;s not a very worthwhile attack imo</span></td></tr></table>
<table class="log-line" id="l-116"><tr class="log-row"><td class="log-lineno"><a href="#l-116">116</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> And the benefit of freeing up this space is probably worth it</span></td></tr></table>
<table class="log-line" id="l-117"><tr class="log-row"><td class="log-lineno"><a href="#l-117">117</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> What is the purpose of reimplementing TxOrphanageImpl using a boost::multi_index_container along with the eviction changes?</span></td></tr></table>
<table class="log-line" id="l-118"><tr class="log-row"><td class="log-lineno"><a href="#l-118">118</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> it&#39;s easier on the eyes :)</span></td></tr></table>
<table class="log-line" id="l-119"><tr class="log-row"><td class="log-lineno"><a href="#l-119">119</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:hotpink">&lt;instagibbs&gt;</span><span class="log-msg"> glozow we could just look for txid matches instead of scanning inputs :)</span></td></tr></table>
<table class="log-line" id="l-120"><tr class="log-row"><td class="log-lineno"><a href="#l-120">120</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> so that you can look up orphan announcements by either wtxid or peer?</span></td></tr></table>
<table class="log-line" id="l-121"><tr class="log-row"><td class="log-lineno"><a href="#l-121">121</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> instagibbs: indeed. It would require adding a txid index, but maybe that&#39;s what we&#39;re evicting in practice anyway! Could measure what it looks like in the wild</span></td></tr></table>
<table class="log-line" id="l-122"><tr class="log-row"><td class="log-lineno"><a href="#l-122">122</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: we can already do that though!</span></td></tr></table>
<table class="log-line" id="l-123"><tr class="log-row"><td class="log-lineno"><a href="#l-123">123</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:hotpink">&lt;instagibbs&gt;</span><span class="log-msg"> oh right, wtxid would be the thing on hand</span></td></tr></table>
<table class="log-line" id="l-124"><tr class="log-row"><td class="log-lineno"><a href="#l-124">124</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> instagibbs: right but same thing, maybe we&#39;re always evicting exact block txns</span></td></tr></table>
<table class="log-line" id="l-125"><tr class="log-row"><td class="log-lineno"><a href="#l-125">125</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:hotpink">&lt;instagibbs&gt;</span><span class="log-msg"> 👍</span></td></tr></table>
<table class="log-line" id="l-126"><tr class="log-row"><td class="log-lineno"><a href="#l-126">126</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> i think it was me who suggested using a multi_index, and the reason was because i saw the older implementation was effectively implementing a multi-index inefficiently, by having separate data structures for per-peer and per-wtxid information about announcements</span></td></tr></table>
<table class="log-line" id="l-127"><tr class="log-row"><td class="log-lineno"><a href="#l-127">127</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> glozow: haha it was just my best guess, didn&#39;t actually get around to understanding boost::multi_index_container better</span></td></tr></table>
<table class="log-line" id="l-128"><tr class="log-row"><td class="log-lineno"><a href="#l-128">128</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> yeah it is the more natural data structure. I was also pleasantly surprised to realize that we only needed 2 indexes</span></td></tr></table>
<table class="log-line" id="l-129"><tr class="log-row"><td class="log-lineno"><a href="#l-129">129</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> yeah, i was assuming we&#39;d need 3</span></td></tr></table>
<table class="log-line" id="l-130"><tr class="log-row"><td class="log-lineno"><a href="#l-130">130</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> nice find</span></td></tr></table>
<table class="log-line" id="l-131"><tr class="log-row"><td class="log-lineno"><a href="#l-131">131</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> I&#39;ve also been told many times that the existing `TxOrphanage` is hard to review</span></td></tr></table>
<table class="log-line" id="l-132"><tr class="log-row"><td class="log-lineno"><a href="#l-132">132</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> so good to hear from marcofleon that it&#39;s easier this way</span></td></tr></table>
<table class="log-line" id="l-133"><tr class="log-row"><td class="log-lineno"><a href="#l-133">133</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> What is a peer’s “DoS Score” and how is it calculated?</span></td></tr></table>
<table class="log-line" id="l-134"><tr class="log-row"><td class="log-lineno"><a href="#l-134">134</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> its the max bettween announcement_count/peer_announcement_limit and announcement_usage/peer_announcement_usage_reservation</span></td></tr></table>
<table class="log-line" id="l-135"><tr class="log-row"><td class="log-lineno"><a href="#l-135">135</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: think of an SQL database with multiple indexes on various columns, but then in-memory entirely, and in a C++y way; it&#39;s more efficient (both in memory and CPU) than having multiple independent maps (one for each index), and much easier to keep consistent (because there is no way for the different indexes to contain different information)</span></td></tr></table>
<table class="log-line" id="l-136"><tr class="log-row"><td class="log-lineno"><a href="#l-136">136</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> maximum of cpu score and memory score. cpu score is a peers number of announcments / their per peer limit. and memory score is sum of the weight of a peers announced tx weights / the reserved memory usage per peer</span></td></tr></table>
<table class="log-line" id="l-137"><tr class="log-row"><td class="log-lineno"><a href="#l-137">137</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: marcofleon: yep. how does this compare to having 2 separate scores, and trimming &quot;while CPU score is exceeded or memory score is exceeded&quot; ?</span></td></tr></table>
<table class="log-line" id="l-138"><tr class="log-row"><td class="log-lineno"><a href="#l-138">138</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> hmmm well a peer can have a dos score of more than 1</span></td></tr></table>
<table class="log-line" id="l-139"><tr class="log-row"><td class="log-lineno"><a href="#l-139">139</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> or maybe i&#39;m confused with the q</span></td></tr></table>
<table class="log-line" id="l-140"><tr class="log-row"><td class="log-lineno"><a href="#l-140">140</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> sipa: that helps my conceptual understanding a lot thanks</span></td></tr></table>
<table class="log-line" id="l-141"><tr class="log-row"><td class="log-lineno"><a href="#l-141">141</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> glozow: this is much simplier for sure</span></td></tr></table>
<table class="log-line" id="l-142"><tr class="log-row"><td class="log-lineno"><a href="#l-142">142</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> Er, my point was &quot;it&#39;s the same thing&quot;</span></td></tr></table>
<table class="log-line" id="l-143"><tr class="log-row"><td class="log-lineno"><a href="#l-143">143</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> i think the question is: why do we have a *single* DoS score = max(mem_score, ann_score), as opposed to two different DoS scores that are never compared with one another, and a rule &quot;trim the worst announcement offenders while there are any&quot; + &#39;trim the worst memory offenders while there are any&quot;</span></td></tr></table>
<table class="log-line" id="l-144"><tr class="log-row"><td class="log-lineno"><a href="#l-144">144</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> bc we only have to track one score rather than two</span></td></tr></table>
<table class="log-line" id="l-145"><tr class="log-row"><td class="log-lineno"><a href="#l-145">145</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> wait this is actually a good question, i&#39;m not immediately seeing what the benefit of one score is over two</span></td></tr></table>
<table class="log-line" id="l-146"><tr class="log-row"><td class="log-lineno"><a href="#l-146">146</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> is it more gameable somehow?</span></td></tr></table>
<table class="log-line" id="l-147"><tr class="log-row"><td class="log-lineno"><a href="#l-147">147</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> i think this way also allows more the advantage of allowing peers to exceed limits/reservations</span></td></tr></table>
<table class="log-line" id="l-148"><tr class="log-row"><td class="log-lineno"><a href="#l-148">148</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:indianred">&lt;sipa&gt;</span><span class="log-msg"> i don&#39;t think the two approaches are equivalent, fwiw, but the difference is small</span></td></tr></table>
<table class="log-line" id="l-149"><tr class="log-row"><td class="log-lineno"><a href="#l-149">149</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> as long as global limits are not reached</span></td></tr></table>
<table class="log-line" id="l-150"><tr class="log-row"><td class="log-lineno"><a href="#l-150">150</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> hmm so global limits reached, we get dos scores and target a peer based on that</span></td></tr></table>
<table class="log-line" id="l-151"><tr class="log-row"><td class="log-lineno"><a href="#l-151">151</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> So we&#39;re comparing this approach to having 2 loops. &quot;While global announcement limit is exceeded, pick the peer with the most announcements, evict from them. Then, while global memory limit is exceeded, pick the per with the most memory usage, evict from them.&quot;</span></td></tr></table>
<table class="log-line" id="l-152"><tr class="log-row"><td class="log-lineno"><a href="#l-152">152</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> well practically speaking, usually only one limit will be reached at a time so it would usually only be one loop no?</span></td></tr></table>
<table class="log-line" id="l-153"><tr class="log-row"><td class="log-lineno"><a href="#l-153">153</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> This approach basically rolls them into 1 loop. &quot;While global announcement or memory limit is exceeded, pick the peer with the highest score (max ratio of both) and evict from them.&quot;</span></td></tr></table>
<table class="log-line" id="l-154"><tr class="log-row"><td class="log-lineno"><a href="#l-154">154</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:indigo">&lt;Emc99&gt;</span><span class="log-msg"> What is dos?</span></td></tr></table>
<table class="log-line" id="l-155"><tr class="log-row"><td class="log-lineno"><a href="#l-155">155</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:hotpink">&lt;instagibbs&gt;</span><span class="log-msg"> denial of service</span></td></tr></table>
<table class="log-line" id="l-156"><tr class="log-row"><td class="log-lineno"><a href="#l-156">156</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:indigo">&lt;Emc99&gt;</span><span class="log-msg"> Thanks</span></td></tr></table>
<table class="log-line" id="l-157"><tr class="log-row"><td class="log-lineno"><a href="#l-157">157</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> oh oops we are out of time!</span></td></tr></table>
<table class="log-line" id="l-158"><tr class="log-row"><td class="log-lineno"><a href="#l-158">158</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> is the two loop approach worse in some other way i&#39;m not seeing other than it&#39;s two loops</span></td></tr></table>
<table class="log-line" id="l-159"><tr class="log-row"><td class="log-lineno"><a href="#l-159">159</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:green">&lt;marcofleon&gt;</span><span class="log-msg"> thanks for hosting and answering qs glozow! good stuff as usual</span></td></tr></table>
<table class="log-line" id="l-160"><tr class="log-row"><td class="log-lineno"><a href="#l-160">160</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> fwiw, I think that having a ratio-based score is good if we want to consider giving different peers different reservation amounts</span></td></tr></table>
<table class="log-line" id="l-161"><tr class="log-row"><td class="log-lineno"><a href="#l-161">161</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> one small flaw with this approach is that if count limit is reached first, the highest DOS peer might actually be violating the memory reservation and removing it won&#39;t immediately resolve the global limit being exceeded</span></td></tr></table>
<table class="log-line" id="l-162"><tr class="log-row"><td class="log-lineno"><a href="#l-162">162</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:firebrick">&lt;monlovesmango&gt;</span><span class="log-msg"> thanks for hosting glozow!!</span></td></tr></table>
<table class="log-line" id="l-163"><tr class="log-row"><td class="log-lineno"><a href="#l-163">163</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:darkblue">&lt;glozow&gt;</span><span class="log-msg"> #endmeeting </span></td></tr></table>]]></content><author><name>glozow</name></author><summary type="html"><![CDATA[Notes]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bitcoincore.reviews/assets/img/twitter_card.png" /><media:content medium="image" url="https://bitcoincore.reviews/assets/img/twitter_card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Cluster linearization: separate tests from tests-of-tests</title><link href="https://bitcoincore.reviews/30605" rel="alternate" type="text/html" title="Cluster linearization: separate tests from tests-of-tests" /><published>2025-06-11T00:00:00+00:00</published><updated>2025-06-11T00:00:00+00:00</updated><id>https://bitcoincore.reviews/#30605</id><content type="html" xml:base="https://bitcoincore.reviews/30605"><![CDATA[<h2 id="notes">Notes</h2>

<ul>
  <li>
    <p>A cluster is a group of transactions where some transactions depend on others, forming parent-child relationships. The simplest cluster is a single transaction, and most clusters consist of just a few transactions. However, there can be more complex configurations that form large directed acyclic graphs (with grandparents, siblings, uncles, etc). The current limit on cluster size is 64 transactions.</p>
  </li>
  <li>At a high level, cluster linearization is the process of sorting the transactions within a given cluster in a way that respects dependencies (parents before children) while maximizing the effective fee rate when considering “chunks” of this ordered list. The goal is to produce an optimal linearization: an ordering with the best possible sequence of chunk fee rates (fee rate profile). This linearization allows miners to include the most profitable transactions first. (for more in-depth reading, see <a href="https://delvingbitcoin.org/t/how-to-linearize-your-cluster/303">here</a>)
    <ul>
      <li>The data structures and algorithms for cluster linearization can be found in <a href="https://github.com/bitcoin/bitcoin/blob/master/src/cluster_linearize.h"><code class="language-plaintext highlighter-rouge">cluster_linearize.h</code></a>.</li>
    </ul>
  </li>
  <li>
    <p>The linearization code is complex and therefore relies on fuzz testing to ensure correctness. Using the wide variety of data generated by the fuzzer to build dependency graphs (<code class="language-plaintext highlighter-rouge">DepGraph</code> instances) and produce/update linearizations is probably our best bet for finding any subtle bugs or edge cases in the code.</p>
  </li>
  <li>
    <p>The <code class="language-plaintext highlighter-rouge">cluster_linearize</code> fuzz test includes a few helper classes and functions that are used to compare against the actual implementation. The motivation for this PR is to construct new fuzz targets that are used to make sure these helpers work properly. By having dedicated targets that test the test, we can be even more confident that our cluster linearization code is bug-free. Woo!</p>
  </li>
  <li>Note: the current cluster linearization algorithm may be replaced by a new and improved spanning-forest linearization (SFL) algorithm in the future. SFL is essentially a drop-in replacement, so while the underlying algorithm changes, it doesn’t change the tests much. It’s outside of the scope of this review club, but you can look at <a href="https://github.com/bitcoin/bitcoin/pull/32545">PR 32545</a> or <a href="https://delvingbitcoin.org/t/spanning-forest-cluster-linearization/1419">this delving post</a> if you’re interested.</li>
</ul>

<h2 id="exercise">Exercise</h2>

<ul>
  <li>
    <p>Try fuzzing the <code class="language-plaintext highlighter-rouge">clusterlin_linearize</code> target. You can refer to the <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md">fuzzing docs</a> for assistance. Using <code class="language-plaintext highlighter-rouge">--preset=libfuzzer-nosan</code> will likely make building easier.</p>
  </li>
  <li>
    <p>Now change <code class="language-plaintext highlighter-rouge">chunking</code> to <code class="language-plaintext highlighter-rouge">simple_chunking</code> at this <a href="https://github.com/bitcoin-core-review-club/bitcoin/blob/d2fc10b64505512a70bed05e7bb21d76c8f748cd/src/test/fuzz/cluster_linearize.cpp#L1104">line</a> and run the target again.</p>
  </li>
  <li>
    <p>After a few minutes, you should see a crash. Welcome to fuzzing. This is a simple example of a tiny bug in the test itself which fuzz testing catches quickly. A lot of the time, a crash happens because something is wrong in the fuzz harness itself, as opposed to a bug in the production code. This is why it can be useful to have targets or assertions that ensure that the fuzz test itself is correct.</p>
  </li>
</ul>

<h2 id="questions">Questions</h2>

<ol>
  <li>
    <p>Did you review the PR? <a href="https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#peer-review">Concept ACK, approach ACK, tested ACK, or NACK</a>? What was your review approach?</p>
  </li>
  <li>
    <p>What are the two new fuzz targets introduced and what are they testing? In terms of what they’re testing, how are they different from the other targets?</p>
  </li>
  <li>
    <p>What are the benefits of separating out the fuzzing of the internal test helpers?</p>
  </li>
  <li>
    <p>Were you able to run the <code class="language-plaintext highlighter-rouge">clusterlin_linearize</code> target? How many iterations (the first number libFuzzer shows at each line) did it take to produce a crash after making the <code class="language-plaintext highlighter-rouge">s/chunking/simple_chunking/</code> change?</p>
  </li>
  <li>
    <p>In <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/2763b753c7974c877659fdfa1cfcb6a09e2cd2ac">commit 2763b75</a>, why was <code class="language-plaintext highlighter-rouge">--iterations_left</code> moved?</p>
  </li>
  <li>
    <p>In <code class="language-plaintext highlighter-rouge">clusterlin_simple_finder</code>, when finding a topologically valid subset to remove from the graph, why is it important to set <code class="language-plaintext highlighter-rouge">non_empty</code> to true? What could happen if we allowed empty sets?</p>
  </li>
  <li>
    <p>In <code class="language-plaintext highlighter-rouge">clusterlin_simple_linearize</code>, why does the code only verify against all possible permutations when <code class="language-plaintext highlighter-rouge">depgraph.TxCount() &lt;= 8</code>? What would happen if we tried to do this for larger transaction counts?</p>
  </li>
  <li>
    <p>In <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/1e4f3452a980744ece8a57bf46c35f44e2aa83a0">commit 1e4f345</a>, when a non-topological permutation is found, the code now fast forwards by reversing part of the permutation. Why does this optimization work, and how many permutations can it skip in the best case?</p>
  </li>
  <li>
    <p>In <code class="language-plaintext highlighter-rouge">SimpleCandidateFinder::FindCandidateSet()</code>, the algorithm keeps track of two sets for each work unit: <code class="language-plaintext highlighter-rouge">inc</code> (transactions definitely included) and <code class="language-plaintext highlighter-rouge">und</code> (transactions that can still be added). Why does it need to track both sets instead of just tracking undecided transactions?</p>
  </li>
  <li>
    <p>What is, no doubt, the coolest way to test code?</p>
  </li>
</ol>

<h2 id="meeting-log">Meeting Log</h2>

<table class="log-line" id="l-1"><tr class="log-row"><td class="log-lineno"><a href="#l-1">&nbsp;&nbsp;1</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> #startmeeting</span></td></tr></table>
<table class="log-line" id="l-2"><tr class="log-row"><td class="log-lineno"><a href="#l-2">&nbsp;&nbsp;2</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:indigo">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Meeting started at 2025-06-11T17:00+0000</span></td></tr></table>
<table class="log-line" id="l-3"><tr class="log-row"><td class="log-lineno"><a href="#l-3">&nbsp;&nbsp;3</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:indigo">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Current chairs: marcofleon</span></td></tr></table>
<table class="log-line" id="l-4"><tr class="log-row"><td class="log-lineno"><a href="#l-4">&nbsp;&nbsp;4</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:indigo">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Useful commands: #action #info #idea #link #topic #motion #vote #close #endmeeting</span></td></tr></table>
<table class="log-line" id="l-5"><tr class="log-row"><td class="log-lineno"><a href="#l-5">&nbsp;&nbsp;5</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:indigo">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: See also: <a href="https://hcoop-meetbot.readthedocs.io/en/stable/" target="blank">https://hcoop-meetbot.readthedocs.io/en/stable/</a></span></td></tr></table>
<table class="log-line" id="l-6"><tr class="log-row"><td class="log-lineno"><a href="#l-6">&nbsp;&nbsp;6</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:indigo">&lt;corebot`&gt;</span><span class="log-msg"> marcofleon: Participants should now identify themselves with &#39;#here&#39; or with an alias like &#39;#here FirstLast&#39;</span></td></tr></table>
<table class="log-line" id="l-7"><tr class="log-row"><td class="log-lineno"><a href="#l-7">&nbsp;&nbsp;7</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> Hi!</span></td></tr></table>
<table class="log-line" id="l-8"><tr class="log-row"><td class="log-lineno"><a href="#l-8">&nbsp;&nbsp;8</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:maroon">&lt;stickies-v&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-9"><tr class="log-row"><td class="log-lineno"><a href="#l-9">&nbsp;&nbsp;9</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> heyy</span></td></tr></table>
<table class="log-line" id="l-10"><tr class="log-row"><td class="log-lineno"><a href="#l-10">&nbsp;10</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-11"><tr class="log-row"><td class="log-lineno"><a href="#l-11">&nbsp;11</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> welcome! we&#39;ll be going over <a href="https://bitcoincore.reviews/30605" target="blank">https://bitcoincore.reviews/30605</a></span></td></tr></table>
<table class="log-line" id="l-12"><tr class="log-row"><td class="log-lineno"><a href="#l-12">&nbsp;12</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> litte re run of last week, we can actually go over the questions this time</span></td></tr></table>
<table class="log-line" id="l-13"><tr class="log-row"><td class="log-lineno"><a href="#l-13">&nbsp;13</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> Did you review the PR/notes? Concept ACK, approach ACK, tested ACK, or NACK?</span></td></tr></table>
<table class="log-line" id="l-14"><tr class="log-row"><td class="log-lineno"><a href="#l-14">&nbsp;14</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:maroon">&lt;stickies-v&gt;</span><span class="log-msg"> didn&#39;t review, just lurking today</span></td></tr></table>
<table class="log-line" id="l-15"><tr class="log-row"><td class="log-lineno"><a href="#l-15">&nbsp;15</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> lurkers are welcome</span></td></tr></table>
<table class="log-line" id="l-16"><tr class="log-row"><td class="log-lineno"><a href="#l-16">&nbsp;16</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> tried to :) was not an easy one</span></td></tr></table>
<table class="log-line" id="l-17"><tr class="log-row"><td class="log-lineno"><a href="#l-17">&nbsp;17</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> yes a bit. tested too.</span></td></tr></table>
<table class="log-line" id="l-18"><tr class="log-row"><td class="log-lineno"><a href="#l-18">&nbsp;18</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> agreed, the cluster linearization code can be tough</span></td></tr></table>
<table class="log-line" id="l-19"><tr class="log-row"><td class="log-lineno"><a href="#l-19">&nbsp;19</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> i hope the testing code for it is easier!</span></td></tr></table>
<table class="log-line" id="l-20"><tr class="log-row"><td class="log-lineno"><a href="#l-20">&nbsp;20</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> monlovesmango: ran the fuzz tests? nice! I guess we can go over that a bit with question 4</span></td></tr></table>
<table class="log-line" id="l-21"><tr class="log-row"><td class="log-lineno"><a href="#l-21">&nbsp;21</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> okay, let&#39;s dive in</span></td></tr></table>
<table class="log-line" id="l-22"><tr class="log-row"><td class="log-lineno"><a href="#l-22">&nbsp;22</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> What are the two new fuzz targets introduced and what are they testing? In terms of what they’re testing, how are they different from the other targets?</span></td></tr></table>
<table class="log-line" id="l-23"><tr class="log-row"><td class="log-lineno"><a href="#l-23">&nbsp;23</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> clusterlin_simple_finder and clusterlin_simple_linearize</span></td></tr></table>
<table class="log-line" id="l-24"><tr class="log-row"><td class="log-lineno"><a href="#l-24">&nbsp;24</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> ✔️</span></td></tr></table>
<table class="log-line" id="l-25"><tr class="log-row"><td class="log-lineno"><a href="#l-25">&nbsp;25</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> here I have a question bc I though ones were testing the functionality and the other ones were testing the tests but when I checked the functions I saw that were just simpler re-implementations of the ones found in cluster_linearize.h</span></td></tr></table>
<table class="log-line" id="l-26"><tr class="log-row"><td class="log-lineno"><a href="#l-26">&nbsp;26</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> why is that?</span></td></tr></table>
<table class="log-line" id="l-27"><tr class="log-row"><td class="log-lineno"><a href="#l-27">&nbsp;27</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> clusterlin_simple_finder and clusterlin_simple_linearize. they are different than other targets bc they are fuzz testing functions implemented for fuzz tests</span></td></tr></table>
<table class="log-line" id="l-28"><tr class="log-row"><td class="log-lineno"><a href="#l-28">&nbsp;28</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> sliv3r__: let me explain</span></td></tr></table>
<table class="log-line" id="l-29"><tr class="log-row"><td class="log-lineno"><a href="#l-29">&nbsp;29</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> sliv3r__: That could be related to the next question actually</span></td></tr></table>
<table class="log-line" id="l-30"><tr class="log-row"><td class="log-lineno"><a href="#l-30">&nbsp;30</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> in terms of what are the benefits of doing that</span></td></tr></table>
<table class="log-line" id="l-31"><tr class="log-row"><td class="log-lineno"><a href="#l-31">&nbsp;31</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> marcofleon: that could be the reason why I wrote IDK as an answer to the next one in my notes :)</span></td></tr></table>
<table class="log-line" id="l-32"><tr class="log-row"><td class="log-lineno"><a href="#l-32">&nbsp;32</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> sliv3r__: the short answer is that SimpleCandidateFinder, ExhaustiveCandidateFinder, SimpleLinearize are part of the test suite, not of production code, even though they mimick the functionality of production code funcstions/classes</span></td></tr></table>
<table class="log-line" id="l-33"><tr class="log-row"><td class="log-lineno"><a href="#l-33">&nbsp;33</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> the point is that the production code is complicated, which means it may be hard for reviewers to get confidence in their correctness</span></td></tr></table>
<table class="log-line" id="l-34"><tr class="log-row"><td class="log-lineno"><a href="#l-34">&nbsp;34</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> and how can we be sure that the behaviour is equal or at least equivalent?</span></td></tr></table>
<table class="log-line" id="l-35"><tr class="log-row"><td class="log-lineno"><a href="#l-35">&nbsp;35</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> and so the simpler implementations provide an oracle to check against</span></td></tr></table>
<table class="log-line" id="l-36"><tr class="log-row"><td class="log-lineno"><a href="#l-36">&nbsp;36</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> one tool that we (or i, as author, in this case) have available to make it easier on reviewers, is by writing a simpler, more obviously correct, but potentially slower/less feature-rich reimplementation that does the same thing, plus tests that they are identical</span></td></tr></table>
<table class="log-line" id="l-37"><tr class="log-row"><td class="log-lineno"><a href="#l-37">&nbsp;37</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> so then if you as a reviewer have confidence in the reimplementation + the equivalence test, you also gain confidence in the original implementation</span></td></tr></table>
<table class="log-line" id="l-38"><tr class="log-row"><td class="log-lineno"><a href="#l-38">&nbsp;38</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> sliv3r__: well that is what the fuzz tests do: run a scenario (controlled by the fuzzer) of operation to both the production version and the simpler version, and see they produce the same result</span></td></tr></table>
<table class="log-line" id="l-39"><tr class="log-row"><td class="log-lineno"><a href="#l-39">&nbsp;39</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> that&#39;s not a proof of course, but it is one tool that can increase confidence if no such differences are found</span></td></tr></table>
<table class="log-line" id="l-40"><tr class="log-row"><td class="log-lineno"><a href="#l-40">&nbsp;40</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> make sense</span></td></tr></table>
<table class="log-line" id="l-41"><tr class="log-row"><td class="log-lineno"><a href="#l-41">&nbsp;41</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> if you want to get an idea of how good it is, you can try inserting deliberate bugs and see how long it takes for the fuzzer to find it</span></td></tr></table>
<table class="log-line" id="l-42"><tr class="log-row"><td class="log-lineno"><a href="#l-42">&nbsp;42</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-43"><tr class="log-row"><td class="log-lineno"><a href="#l-43">&nbsp;43</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> abubakarsadiq: welcome</span></td></tr></table>
<table class="log-line" id="l-44"><tr class="log-row"><td class="log-lineno"><a href="#l-44">&nbsp;44</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> nice thanks, more clear now</span></td></tr></table>
<table class="log-line" id="l-45"><tr class="log-row"><td class="log-lineno"><a href="#l-45">&nbsp;45</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> and in this case, even the &quot;simpler&quot; version is fairly nontrivial, so in addition, there is a third, *even* simpler and *even* slower version implemented</span></td></tr></table>
<table class="log-line" id="l-46"><tr class="log-row"><td class="log-lineno"><a href="#l-46">&nbsp;46</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> i&#39;ll move on to question 4, unless there&#39;s more benefits other than increasing confidence of correctness? for question 3 I mean</span></td></tr></table>
<table class="log-line" id="l-47"><tr class="log-row"><td class="log-lineno"><a href="#l-47">&nbsp;47</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> where the current fuzz tests compare all 3 with each other</span></td></tr></table>
<table class="log-line" id="l-48"><tr class="log-row"><td class="log-lineno"><a href="#l-48">&nbsp;48</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> That&#39;s the exhaustive one yes?</span></td></tr></table>
<table class="log-line" id="l-49"><tr class="log-row"><td class="log-lineno"><a href="#l-49">&nbsp;49</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> marcofleon: yeah</span></td></tr></table>
<table class="log-line" id="l-50"><tr class="log-row"><td class="log-lineno"><a href="#l-50">&nbsp;50</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> I think that makes sense for clusterlin_simple_finder bc it doesn&#39;t seem to compare with other prod code, but for clusterlin_simple_linearization it is comparing to ChunkLinearization which doesn&#39;t necessarily feel simpler</span></td></tr></table>
<table class="log-line" id="l-51"><tr class="log-row"><td class="log-lineno"><a href="#l-51">&nbsp;51</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> marcofleon: there are 2 dimensions i think</span></td></tr></table>
<table class="log-line" id="l-52"><tr class="log-row"><td class="log-lineno"><a href="#l-52">&nbsp;52</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> marcofleon: there is the candidate-finding logic, where we have SearchCandidateFinder (prod), SimpleCandidateFinder (simpler), ExhaustiveCandidateFinder (simplest)</span></td></tr></table>
<table class="log-line" id="l-53"><tr class="log-row"><td class="log-lineno"><a href="#l-53">&nbsp;53</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> and there is the linearization logic on top, where there are also 3 version: Linearize (prod), SimpleLinearize (simpler), and the std::next_permutation based exhaustive search (simplest, but not a separate function)</span></td></tr></table>
<table class="log-line" id="l-54"><tr class="log-row"><td class="log-lineno"><a href="#l-54">&nbsp;54</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> sipa: haven&#39;t look yet, but after SFL simple candidate finder would be changed to match the new algorithm yeah?</span></td></tr></table>
<table class="log-line" id="l-55"><tr class="log-row"><td class="log-lineno"><a href="#l-55">&nbsp;55</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: there is no SearchCandidateFinder anymore post-SFL; SFL is a replacement for Linearize directly, which doesn&#39;t involve candidate finding anymore</span></td></tr></table>
<table class="log-line" id="l-56"><tr class="log-row"><td class="log-lineno"><a href="#l-56">&nbsp;56</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> So building layers of trust essentially, makes sense</span></td></tr></table>
<table class="log-line" id="l-57"><tr class="log-row"><td class="log-lineno"><a href="#l-57">&nbsp;57</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> SimpleCandidateFinder and ExhaustiveCandidateFinder stay, but they&#39;re just used in/for SimpleLinearize, which the SFL-based Linearize is then compared against</span></td></tr></table>
<table class="log-line" id="l-58"><tr class="log-row"><td class="log-lineno"><a href="#l-58">&nbsp;58</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> kind of vestigial</span></td></tr></table>
<table class="log-line" id="l-59"><tr class="log-row"><td class="log-lineno"><a href="#l-59">&nbsp;59</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> So we will use exhaustive search to validate correctness of SFL?</span></td></tr></table>
<table class="log-line" id="l-60"><tr class="log-row"><td class="log-lineno"><a href="#l-60">&nbsp;60</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> that would be a possibility!</span></td></tr></table>
<table class="log-line" id="l-61"><tr class="log-row"><td class="log-lineno"><a href="#l-61">&nbsp;61</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> monlovesmango if you ran the fuzz tests a bit, question 4: Were you able to run the clusterlin_linearize target? How many iterations (the first number libFuzzer shows at each line) did it take to produce a crash after making the s/chunking/simple_chunking/ change?</span></td></tr></table>
<table class="log-line" id="l-62"><tr class="log-row"><td class="log-lineno"><a href="#l-62">&nbsp;62</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> sipa: ok std::next_permutation was what I was missing</span></td></tr></table>
<table class="log-line" id="l-63"><tr class="log-row"><td class="log-lineno"><a href="#l-63">&nbsp;63</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: but i don&#39;t think it gains us very much, as it&#39;s pretty non-trivial anyway, so the &quot;added confidence&quot; isn&#39;t as much as compared with the much simpler reimplementations gives us</span></td></tr></table>
<table class="log-line" id="l-64"><tr class="log-row"><td class="log-lineno"><a href="#l-64">&nbsp;64</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Or the permutation of the graph linearizations I think will be more valid candidate</span></td></tr></table>
<table class="log-line" id="l-65"><tr class="log-row"><td class="log-lineno"><a href="#l-65">&nbsp;65</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> marcofleon: I actually had a question about that. I did get the failure, but I was using the python test runner and it doesn&#39;t show any output with the counts, just the error</span></td></tr></table>
<table class="log-line" id="l-66"><tr class="log-row"><td class="log-lineno"><a href="#l-66">&nbsp;66</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> marcofleon: it took for me 566593 iteartions</span></td></tr></table>
<table class="log-line" id="l-67"><tr class="log-row"><td class="log-lineno"><a href="#l-67">&nbsp;67</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> is there another way I should be running individual tests?</span></td></tr></table>
<table class="log-line" id="l-68"><tr class="log-row"><td class="log-lineno"><a href="#l-68">&nbsp;68</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> i always run the tests individually</span></td></tr></table>
<table class="log-line" id="l-69"><tr class="log-row"><td class="log-lineno"><a href="#l-69">&nbsp;69</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> I did it running: FUZZ=clusterlin_linearize build_fuzz_nosan/bin/fuzz</span></td></tr></table>
<table class="log-line" id="l-70"><tr class="log-row"><td class="log-lineno"><a href="#l-70">&nbsp;70</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> that ^</span></td></tr></table>
<table class="log-line" id="l-71"><tr class="log-row"><td class="log-lineno"><a href="#l-71">&nbsp;71</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> exactly, yeah</span></td></tr></table>
<table class="log-line" id="l-72"><tr class="log-row"><td class="log-lineno"><a href="#l-72">&nbsp;72</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> sliv3r__: ok that helps thank you :)</span></td></tr></table>
<table class="log-line" id="l-73"><tr class="log-row"><td class="log-lineno"><a href="#l-73">&nbsp;73</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> i usually add -use_value_profile=1 -workers=30 -jobs=30, to get 30 concurrent processes, with more tendency to explore more paths</span></td></tr></table>
<table class="log-line" id="l-74"><tr class="log-row"><td class="log-lineno"><a href="#l-74">&nbsp;74</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> and yeah ~500k iterations was where i was at too. It crashes pretty quickly</span></td></tr></table>
<table class="log-line" id="l-75"><tr class="log-row"><td class="log-lineno"><a href="#l-75">&nbsp;75</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> monlovesmango: in the fuzzing docs you have an example at the very begining <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md" target="blank">https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md</a></span></td></tr></table>
<table class="log-line" id="l-76"><tr class="log-row"><td class="log-lineno"><a href="#l-76">&nbsp;76</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> And then running it like how sliv3r__ said you can add a directory at the end to save the inputs if you&#39;d like. Keep a corpus for later</span></td></tr></table>
<table class="log-line" id="l-77"><tr class="log-row"><td class="log-lineno"><a href="#l-77">&nbsp;77</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> marcofleon: Then it says something like: Test unit written to ./crash-1cea6b51b877d277ba4d1ba7f522b7d3ac182349</span></td></tr></table>
<table class="log-line" id="l-78"><tr class="log-row"><td class="log-lineno"><a href="#l-78">&nbsp;78</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> what&#39;s that? bc it&#39;s impossible to human-read it :)</span></td></tr></table>
<table class="log-line" id="l-79"><tr class="log-row"><td class="log-lineno"><a href="#l-79">&nbsp;79</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> marcofleon: maybe it makes sense to move the std::next_permutation based logic to an ExhaustiveLinearize function</span></td></tr></table>
<table class="log-line" id="l-80"><tr class="log-row"><td class="log-lineno"><a href="#l-80">&nbsp;80</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> sipa: it could make it clearer, agreed</span></td></tr></table>
<table class="log-line" id="l-81"><tr class="log-row"><td class="log-lineno"><a href="#l-81">&nbsp;81</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> sliv3r__: that&#39;s the input that caused the crash</span></td></tr></table>
<table class="log-line" id="l-82"><tr class="log-row"><td class="log-lineno"><a href="#l-82">&nbsp;82</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> sliv3r__: it is the input to the fuzz harness, which interprets bytes from it (each of the provider.ConsumeIntegral... functions decodes some bytes from it)</span></td></tr></table>
<table class="log-line" id="l-83"><tr class="log-row"><td class="log-lineno"><a href="#l-83">&nbsp;83</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> if you run the fuzz command and that input after, it should reproduce, hopefully</span></td></tr></table>
<table class="log-line" id="l-84"><tr class="log-row"><td class="log-lineno"><a href="#l-84">&nbsp;84</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> you can re-run it, using FUZZ=clusterlin_linearize build_fuzz_nosan/bin/fuzz ./crash-1cea6b51b877d277ba4d1ba7f522b7d3ac182349</span></td></tr></table>
<table class="log-line" id="l-85"><tr class="log-row"><td class="log-lineno"><a href="#l-85">&nbsp;85</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> which will not do any fuzzing, just run that one fuzz input through the harness</span></td></tr></table>
<table class="log-line" id="l-86"><tr class="log-row"><td class="log-lineno"><a href="#l-86">&nbsp;86</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> sipa: I think ExhaustiveLinearize would be good and consistent</span></td></tr></table>
<table class="log-line" id="l-87"><tr class="log-row"><td class="log-lineno"><a href="#l-87">&nbsp;87</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> yep runs one iteration and crashes instantly</span></td></tr></table>
<table class="log-line" id="l-88"><tr class="log-row"><td class="log-lineno"><a href="#l-88">&nbsp;88</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> but now you can also modify the code, attempt to fix the bug, and retry with just that case</span></td></tr></table>
<table class="log-line" id="l-89"><tr class="log-row"><td class="log-lineno"><a href="#l-89">&nbsp;89</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> that&#39;s when the debugging starts</span></td></tr></table>
<table class="log-line" id="l-90"><tr class="log-row"><td class="log-lineno"><a href="#l-90">&nbsp;90</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> question 5: In commit 2763b75, why was --iterations_left moved?</span></td></tr></table>
<table class="log-line" id="l-91"><tr class="log-row"><td class="log-lineno"><a href="#l-91">&nbsp;91</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> sliv3r__: thank you I see that example now... I think I didn&#39;t really know what that param did bc I didn&#39;t realize &#39;process_message&#39; was a test</span></td></tr></table>
<table class="log-line" id="l-92"><tr class="log-row"><td class="log-lineno"><a href="#l-92">&nbsp;92</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> monlovesmango: sorry if I moved on too quickly! Yeah, the thing after FUZZ= is the fuzz target</span></td></tr></table>
<table class="log-line" id="l-93"><tr class="log-row"><td class="log-lineno"><a href="#l-93">&nbsp;93</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> marcofleon: no you&#39;re good!</span></td></tr></table>
<table class="log-line" id="l-94"><tr class="log-row"><td class="log-lineno"><a href="#l-94">&nbsp;94</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> sipa: right setting it back to chunking works :P</span></td></tr></table>
<table class="log-line" id="l-95"><tr class="log-row"><td class="log-lineno"><a href="#l-95">&nbsp;95</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> are we at q 5?</span></td></tr></table>
<table class="log-line" id="l-96"><tr class="log-row"><td class="log-lineno"><a href="#l-96">&nbsp;96</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> we have a bunch of them. all looking something like &quot;FUZZ_TARGET(clusterlin_depgraph_sim)&quot; for example and then the test itself</span></td></tr></table>
<table class="log-line" id="l-97"><tr class="log-row"><td class="log-lineno"><a href="#l-97">&nbsp;97</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> yeah, i&#39;ll paste again</span></td></tr></table>
<table class="log-line" id="l-98"><tr class="log-row"><td class="log-lineno"><a href="#l-98">&nbsp;98</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> In commit 2763b75, why was --iterations_left moved?</span></td></tr></table>
<table class="log-line" id="l-99"><tr class="log-row"><td class="log-lineno"><a href="#l-99">&nbsp;99</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> it was moved bc otherwise it decrements for splits that don&#39;t actually need to be considered (which I imagine might also mess with the result being optimal assumption)</span></td></tr></table>
<table class="log-line" id="l-100"><tr class="log-row"><td class="log-lineno"><a href="#l-100">100</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> i think the answer here is kind of nuanced</span></td></tr></table>
<table class="log-line" id="l-101"><tr class="log-row"><td class="log-lineno"><a href="#l-101">101</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> I&#39;m actually not sure if it was a bug fix per se... I think just an optimization?</span></td></tr></table>
<table class="log-line" id="l-102"><tr class="log-row"><td class="log-lineno"><a href="#l-102">102</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> but it also doesn&#39;t matter much</span></td></tr></table>
<table class="log-line" id="l-103"><tr class="log-row"><td class="log-lineno"><a href="#l-103">103</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> If I didn&#39;t understand wrong we want to only reduce the counter when we add a new &quot;valid&quot; subset. So the number of iterations is proportional to the number of different connected subsets that cna be created instead to be realted to the total num of elements in the queue</span></td></tr></table>
<table class="log-line" id="l-104"><tr class="log-row"><td class="log-lineno"><a href="#l-104">104</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> so the idea is that we want some kind of &quot;cost metric&quot; to control how much time is spent inside SimpleCandidateFinder, just so that it does not run forever, but can stop it after &quot;too much&quot; work has been performed</span></td></tr></table>
<table class="log-line" id="l-105"><tr class="log-row"><td class="log-lineno"><a href="#l-105">105</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> it doesn&#39;t really matter what that metric is, as long as it&#39;s roughly proportional to runtime</span></td></tr></table>
<table class="log-line" id="l-106"><tr class="log-row"><td class="log-lineno"><a href="#l-106">106</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> the metric that was being used so far was &quot;queue elements processed&quot;</span></td></tr></table>
<table class="log-line" id="l-107"><tr class="log-row"><td class="log-lineno"><a href="#l-107">107</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> moving the --iterations_left is really changing the metric to something else: the number of candidate sets considered</span></td></tr></table>
<table class="log-line" id="l-108"><tr class="log-row"><td class="log-lineno"><a href="#l-108">108</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> interesting</span></td></tr></table>
<table class="log-line" id="l-109"><tr class="log-row"><td class="log-lineno"><a href="#l-109">109</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> they&#39;re very similar, but each candidate set being considered can give rise to two queue elements</span></td></tr></table>
<table class="log-line" id="l-110"><tr class="log-row"><td class="log-lineno"><a href="#l-110">110</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> and there is an initial queue element on the stack that&#39;s not a candidate set</span></td></tr></table>
<table class="log-line" id="l-111"><tr class="log-row"><td class="log-lineno"><a href="#l-111">111</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> so the old metric is at most 2*N+1, where N is the new metric</span></td></tr></table>
<table class="log-line" id="l-112"><tr class="log-row"><td class="log-lineno"><a href="#l-112">112</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> In clusterlin_simple_finder, when finding a topologically valid subset to remove from the graph, why is it important to set non_empty to true? What could happen if we allowed empty sets?</span></td></tr></table>
<table class="log-line" id="l-113"><tr class="log-row"><td class="log-lineno"><a href="#l-113">113</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> infinite loop</span></td></tr></table>
<table class="log-line" id="l-114"><tr class="log-row"><td class="log-lineno"><a href="#l-114">114</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> so why change is: the new one is easier to reason about, because it&#39;s easy to count how many candidate sets a cluster can have (2^(N-1))</span></td></tr></table>
<table class="log-line" id="l-115"><tr class="log-row"><td class="log-lineno"><a href="#l-115">115</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> so that&#39;s something that can be concretely tested for: if the limit is set to at least 2^(N-1), the optimal must be found</span></td></tr></table>
<table class="log-line" id="l-116"><tr class="log-row"><td class="log-lineno"><a href="#l-116">116</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> makes sense?</span></td></tr></table>
<table class="log-line" id="l-117"><tr class="log-row"><td class="log-lineno"><a href="#l-117">117</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> seems like a better metric. yes.</span></td></tr></table>
<table class="log-line" id="l-118"><tr class="log-row"><td class="log-lineno"><a href="#l-118">118</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> it&#39;s not a big change, just making things slightly easier to reason about</span></td></tr></table>
<table class="log-line" id="l-119"><tr class="log-row"><td class="log-lineno"><a href="#l-119">119</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> it makes more sense</span></td></tr></table>
<table class="log-line" id="l-120"><tr class="log-row"><td class="log-lineno"><a href="#l-120">120</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> but the most important thing is that there is some metric, and it&#39;s being hit</span></td></tr></table>
<table class="log-line" id="l-121"><tr class="log-row"><td class="log-lineno"><a href="#l-121">121</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> sure, I do thiink it makes sense to have it be only when a valid transaction is found</span></td></tr></table>
<table class="log-line" id="l-122"><tr class="log-row"><td class="log-lineno"><a href="#l-122">122</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> a better metric, then just next in the queue</span></td></tr></table>
<table class="log-line" id="l-123"><tr class="log-row"><td class="log-lineno"><a href="#l-123">123</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> *than</span></td></tr></table>
<table class="log-line" id="l-124"><tr class="log-row"><td class="log-lineno"><a href="#l-124">124</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> *candidate set, not transaction</span></td></tr></table>
<table class="log-line" id="l-125"><tr class="log-row"><td class="log-lineno"><a href="#l-125">125</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> valid set, sorry yeah</span></td></tr></table>
<table class="log-line" id="l-126"><tr class="log-row"><td class="log-lineno"><a href="#l-126">126</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> We have to find something to remove in the prior commit we evict the found transactions when the it&#39;s empty</span></td></tr></table>
<table class="log-line" id="l-127"><tr class="log-row"><td class="log-lineno"><a href="#l-127">127</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> infinite loop if we don&#39;t remove anything</span></td></tr></table>
<table class="log-line" id="l-128"><tr class="log-row"><td class="log-lineno"><a href="#l-128">128</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> for q6, nice yeah</span></td></tr></table>
<table class="log-line" id="l-129"><tr class="log-row"><td class="log-lineno"><a href="#l-129">129</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> yeah so basically we have an empty one the next iteration is equal to the current one so loop loop loop :)</span></td></tr></table>
<table class="log-line" id="l-130"><tr class="log-row"><td class="log-lineno"><a href="#l-130">130</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> it would just be the same set if nothing is removed</span></td></tr></table>
<table class="log-line" id="l-131"><tr class="log-row"><td class="log-lineno"><a href="#l-131">131</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> if we have*</span></td></tr></table>
<table class="log-line" id="l-132"><tr class="log-row"><td class="log-lineno"><a href="#l-132">132</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: (bonus) how likely would it be that we *keep* removing nothing, because just occasionally not removing anything wouldn&#39;t be an infinite loop?</span></td></tr></table>
<table class="log-line" id="l-133"><tr class="log-row"><td class="log-lineno"><a href="#l-133">133</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Yeah highly unlikely</span></td></tr></table>
<table class="log-line" id="l-134"><tr class="log-row"><td class="log-lineno"><a href="#l-134">134</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> actually no, extremely likely :p</span></td></tr></table>
<table class="log-line" id="l-135"><tr class="log-row"><td class="log-lineno"><a href="#l-135">135</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> I&#39;m lost haha</span></td></tr></table>
<table class="log-line" id="l-136"><tr class="log-row"><td class="log-lineno"><a href="#l-136">136</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> it would happen anytime you hit the end of the fuzz input</span></td></tr></table>
<table class="log-line" id="l-137"><tr class="log-row"><td class="log-lineno"><a href="#l-137">137</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> because once you hit the end, ConsumeIntegral and friends will keep forever returning 0</span></td></tr></table>
<table class="log-line" id="l-138"><tr class="log-row"><td class="log-lineno"><a href="#l-138">138</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> which would be interpreted as the empty set</span></td></tr></table>
<table class="log-line" id="l-139"><tr class="log-row"><td class="log-lineno"><a href="#l-139">139</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> fuzz input is **not** random</span></td></tr></table>
<table class="log-line" id="l-140"><tr class="log-row"><td class="log-lineno"><a href="#l-140">140</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> oh yes of course, there&#39;d be no more data from the provider at some point</span></td></tr></table>
<table class="log-line" id="l-141"><tr class="log-row"><td class="log-lineno"><a href="#l-141">141</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> it&#39;s hopefully better than random, but it can also be a lot worse</span></td></tr></table>
<table class="log-line" id="l-142"><tr class="log-row"><td class="log-lineno"><a href="#l-142">142</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: sorry, that was a trick question :)</span></td></tr></table>
<table class="log-line" id="l-143"><tr class="log-row"><td class="log-lineno"><a href="#l-143">143</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> In clusterlin_simple_linearize, why does the code only verify against all possible permutations when depgraph.TxCount() &lt;= 8? What would happen if we tried to do this for larger transaction counts?</span></td></tr></table>
<table class="log-line" id="l-144"><tr class="log-row"><td class="log-lineno"><a href="#l-144">144</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> very thought provoking trick question</span></td></tr></table>
<table class="log-line" id="l-145"><tr class="log-row"><td class="log-lineno"><a href="#l-145">145</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> the exhaustive search would start taking too long</span></td></tr></table>
<table class="log-line" id="l-146"><tr class="log-row"><td class="log-lineno"><a href="#l-146">146</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> I think I can answer for TxCount &lt;= 7 bc I don&#39;t understand the optimization included in cce29ef63ecf114003b529093fdfd2574b830afc</span></td></tr></table>
<table class="log-line" id="l-147"><tr class="log-row"><td class="log-lineno"><a href="#l-147">147</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> was wondering the reason you choose to evict randomly. For testing weird and all kind of behaviors yeah. Because the found txs can also be the read transaction</span></td></tr></table>
<table class="log-line" id="l-148"><tr class="log-row"><td class="log-lineno"><a href="#l-148">148</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> sipa: it&#39;s okay I learn something :P</span></td></tr></table>
<table class="log-line" id="l-149"><tr class="log-row"><td class="log-lineno"><a href="#l-149">149</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> We can throw in the next question, it&#39;s related. In commit 1e4f345, when a non-topological permutation is found, the code now fast forwards by reversing part of the permutation. Why does this optimization work, and how many permutations can it skip in the best case?</span></td></tr></table>
<table class="log-line" id="l-150"><tr class="log-row"><td class="log-lineno"><a href="#l-150">150</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> So basically the cost would be huge as the possible permutations is N!. For 7 would be 5050 and higher numbers increase the number heavily</span></td></tr></table>
<table class="log-line" id="l-151"><tr class="log-row"><td class="log-lineno"><a href="#l-151">151</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> i tried with 9 and the execs/sec were about 4x slower</span></td></tr></table>
<table class="log-line" id="l-152"><tr class="log-row"><td class="log-lineno"><a href="#l-152">152</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> But with 1e4f345 the worst case still being 8! which is huge right? Why is this acceptable if it wasn&#39;t before? (bc we had 7)</span></td></tr></table>
<table class="log-line" id="l-153"><tr class="log-row"><td class="log-lineno"><a href="#l-153">153</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> yeah, that&#39;s the answer... the number of iterations can grow factorially</span></td></tr></table>
<table class="log-line" id="l-154"><tr class="log-row"><td class="log-lineno"><a href="#l-154">154</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> sliv3r__: just 8! = 40320, that&#39;s not enormous</span></td></tr></table>
<table class="log-line" id="l-155"><tr class="log-row"><td class="log-lineno"><a href="#l-155">155</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> fuzz tests work best when they stay above 100-1000 attempts per second</span></td></tr></table>
<table class="log-line" id="l-156"><tr class="log-row"><td class="log-lineno"><a href="#l-156">156</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> why was it 7 before if 8 is ok?</span></td></tr></table>
<table class="log-line" id="l-157"><tr class="log-row"><td class="log-lineno"><a href="#l-157">157</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> hmm?</span></td></tr></table>
<table class="log-line" id="l-158"><tr class="log-row"><td class="log-lineno"><a href="#l-158">158</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> oh, with the optimization there are just fewer permutations searched through</span></td></tr></table>
<table class="log-line" id="l-159"><tr class="log-row"><td class="log-lineno"><a href="#l-159">159</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> The optimization of skipping all invalid permutations makes it possible to bump up</span></td></tr></table>
<table class="log-line" id="l-160"><tr class="log-row"><td class="log-lineno"><a href="#l-160">160</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> sorry, i should be more specific</span></td></tr></table>
<table class="log-line" id="l-161"><tr class="log-row"><td class="log-lineno"><a href="#l-161">161</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> it&#39;s not actually possible for all 8! permutations to be topological, so many/most of them will be skipped by the optimization</span></td></tr></table>
<table class="log-line" id="l-162"><tr class="log-row"><td class="log-lineno"><a href="#l-162">162</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> and the numbers 7 and 8 are just set based on benchmarks... which ones make the test too slow</span></td></tr></table>
<table class="log-line" id="l-163"><tr class="log-row"><td class="log-lineno"><a href="#l-163">163</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> all the permutations, after having found an invalid prefix yes?</span></td></tr></table>
<table class="log-line" id="l-164"><tr class="log-row"><td class="log-lineno"><a href="#l-164">164</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> yes, it&#39;ll skip all the permutations with the *same* invalid prefix</span></td></tr></table>
<table class="log-line" id="l-165"><tr class="log-row"><td class="log-lineno"><a href="#l-165">165</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> oh ok so there&#39;s no &quot;human logic&quot; to that :) I was getting too picky with the numbers</span></td></tr></table>
<table class="log-line" id="l-166"><tr class="log-row"><td class="log-lineno"><a href="#l-166">166</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> It&#39;s human logic :p</span></td></tr></table>
<table class="log-line" id="l-167"><tr class="log-row"><td class="log-lineno"><a href="#l-167">167</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> so the number of permutations tried is equal to the number of topologically-valid ones, plus the number of topologically-invalid minimal prefixes</span></td></tr></table>
<table class="log-line" id="l-168"><tr class="log-row"><td class="log-lineno"><a href="#l-168">168</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> i don&#39;t have numbers for what those are, it just works in practice (TM)</span></td></tr></table>
<table class="log-line" id="l-169"><tr class="log-row"><td class="log-lineno"><a href="#l-169">169</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> and how many permutations can it skip in the best case then, just to complete the question</span></td></tr></table>
<table class="log-line" id="l-170"><tr class="log-row"><td class="log-lineno"><a href="#l-170">170</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> also sipa: did you ever figure out how many permutations can be tried in total knowing that there are K valid ones?</span></td></tr></table>
<table class="log-line" id="l-171"><tr class="log-row"><td class="log-lineno"><a href="#l-171">171</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> marcofleon: i have not</span></td></tr></table>
<table class="log-line" id="l-172"><tr class="log-row"><td class="log-lineno"><a href="#l-172">172</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Depends on the cluster</span></td></tr></table>
<table class="log-line" id="l-173"><tr class="log-row"><td class="log-lineno"><a href="#l-173">173</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> ^ that&#39;s what i was thinking too</span></td></tr></table>
<table class="log-line" id="l-174"><tr class="log-row"><td class="log-lineno"><a href="#l-174">174</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> i thought it&#39;d be easy to find a formula, but it does not seem simple at all</span></td></tr></table>
<table class="log-line" id="l-175"><tr class="log-row"><td class="log-lineno"><a href="#l-175">175</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> after some experimentation</span></td></tr></table>
<table class="log-line" id="l-176"><tr class="log-row"><td class="log-lineno"><a href="#l-176">176</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> but it skips a lot in practice, which is enough :p</span></td></tr></table>
<table class="log-line" id="l-177"><tr class="log-row"><td class="log-lineno"><a href="#l-177">177</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> 7! ?</span></td></tr></table>
<table class="log-line" id="l-178"><tr class="log-row"><td class="log-lineno"><a href="#l-178">178</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> sipa: why is not possible for all 8! permutations be topological?</span></td></tr></table>
<table class="log-line" id="l-179"><tr class="log-row"><td class="log-lineno"><a href="#l-179">179</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> sliv3r__: that would imply there are no dependencies in the cluster, so it isn&#39;t a cluster</span></td></tr></table>
<table class="log-line" id="l-180"><tr class="log-row"><td class="log-lineno"><a href="#l-180">180</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> monlovesmango: basically yeah, although I think you would subtract one from that</span></td></tr></table>
<table class="log-line" id="l-181"><tr class="log-row"><td class="log-lineno"><a href="#l-181">181</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> oh ok that was a stupid question :P</span></td></tr></table>
<table class="log-line" id="l-182"><tr class="log-row"><td class="log-lineno"><a href="#l-182">182</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> sliv3r__: every dependency is a &quot;parent must come before child in topological orderings&quot; constraint, so easy additional dependency reduces the number of valid ones</span></td></tr></table>
<table class="log-line" id="l-183"><tr class="log-row"><td class="log-lineno"><a href="#l-183">183</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> whats the minus 1 for?</span></td></tr></table>
<table class="log-line" id="l-184"><tr class="log-row"><td class="log-lineno"><a href="#l-184">184</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> by how much depends on the topology</span></td></tr></table>
<table class="log-line" id="l-185"><tr class="log-row"><td class="log-lineno"><a href="#l-185">185</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> (n-1)! - 1 for n txs</span></td></tr></table>
<table class="log-line" id="l-186"><tr class="log-row"><td class="log-lineno"><a href="#l-186">186</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> you skip from the first topologically-invalid order with a given prefix to the last one with the same prefix</span></td></tr></table>
<table class="log-line" id="l-187"><tr class="log-row"><td class="log-lineno"><a href="#l-187">187</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> the -1 is the one tx that you did just try</span></td></tr></table>
<table class="log-line" id="l-188"><tr class="log-row"><td class="log-lineno"><a href="#l-188">188</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> you don&#39;t immediately skip to the next prefix</span></td></tr></table>
<table class="log-line" id="l-189"><tr class="log-row"><td class="log-lineno"><a href="#l-189">189</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> marcofleon: makes sense thanks!</span></td></tr></table>
<table class="log-line" id="l-190"><tr class="log-row"><td class="log-lineno"><a href="#l-190">190</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> i think we never answered question 3?</span></td></tr></table>
<table class="log-line" id="l-191"><tr class="log-row"><td class="log-lineno"><a href="#l-191">191</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> What are the benefits of separating out the fuzzing of the internal test helpers?</span></td></tr></table>
<table class="log-line" id="l-192"><tr class="log-row"><td class="log-lineno"><a href="#l-192">192</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> I thought we touched on it, but that&#39;s true, never explicitly answered</span></td></tr></table>
<table class="log-line" id="l-193"><tr class="log-row"><td class="log-lineno"><a href="#l-193">193</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> oh also I was able to test the fuzz crash and got 340233</span></td></tr></table>
<table class="log-line" id="l-194"><tr class="log-row"><td class="log-lineno"><a href="#l-194">194</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> nice. I love fuzz crashes</span></td></tr></table>
<table class="log-line" id="l-195"><tr class="log-row"><td class="log-lineno"><a href="#l-195">195</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> 😂</span></td></tr></table>
<table class="log-line" id="l-196"><tr class="log-row"><td class="log-lineno"><a href="#l-196">196</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> marcofleon: fwiw, i suspect the vast majority of the fuzz crashes in these PRs happen before the PR is opened</span></td></tr></table>
<table class="log-line" id="l-197"><tr class="log-row"><td class="log-lineno"><a href="#l-197">197</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> I think it help instill confidence on what is actually being tested</span></td></tr></table>
<table class="log-line" id="l-198"><tr class="log-row"><td class="log-lineno"><a href="#l-198">198</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> as in, i use them to help development</span></td></tr></table>
<table class="log-line" id="l-199"><tr class="log-row"><td class="log-lineno"><a href="#l-199">199</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: maybe, but nothing really changes there... take Search/Simple/ExhaustiveCandidateFinder... before we had one fuzz test that compared all three (subject to cluster-not-too-large constraints etc)</span></td></tr></table>
<table class="log-line" id="l-200"><tr class="log-row"><td class="log-lineno"><a href="#l-200">200</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> now we have two tests, one comparing Search with Simple, one comparing Simple with Exhaustive</span></td></tr></table>
<table class="log-line" id="l-201"><tr class="log-row"><td class="log-lineno"><a href="#l-201">201</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> what&#39;s the benefit of the split?</span></td></tr></table>
<table class="log-line" id="l-202"><tr class="log-row"><td class="log-lineno"><a href="#l-202">202</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> Avoid redundancy</span></td></tr></table>
<table class="log-line" id="l-203"><tr class="log-row"><td class="log-lineno"><a href="#l-203">203</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> yes!</span></td></tr></table>
<table class="log-line" id="l-204"><tr class="log-row"><td class="log-lineno"><a href="#l-204">204</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> yes for me thats much easier to reason about and so for me I can be more confident in comparing Search with Simple</span></td></tr></table>
<table class="log-line" id="l-205"><tr class="log-row"><td class="log-lineno"><a href="#l-205">205</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> sipa: makes sense, it&#39;s a fairly easy and quick way to help initial bugs surface</span></td></tr></table>
<table class="log-line" id="l-206"><tr class="log-row"><td class="log-lineno"><a href="#l-206">206</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> and also easier to review the code</span></td></tr></table>
<table class="log-line" id="l-207"><tr class="log-row"><td class="log-lineno"><a href="#l-207">207</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> if you&#39;re already confident in SimpleCandidateFinder, you have no &quot;need&quot; to waste computation effort on running the Simple/Exhaustive comparison too</span></td></tr></table>
<table class="log-line" id="l-208"><tr class="log-row"><td class="log-lineno"><a href="#l-208">208</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> if you&#39;re not, you should be focusing on just establishing that confidence first without putting effort into comparing with the production code</span></td></tr></table>
<table class="log-line" id="l-209"><tr class="log-row"><td class="log-lineno"><a href="#l-209">209</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> (whether that means more review, running fuzz tests, attending a review club, ...)</span></td></tr></table>
<table class="log-line" id="l-210"><tr class="log-row"><td class="log-lineno"><a href="#l-210">210</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> so i feel the goals of what you obtain from these tests is different, and it makes sense to separate them for that reason</span></td></tr></table>
<table class="log-line" id="l-211"><tr class="log-row"><td class="log-lineno"><a href="#l-211">211</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> Yeah, I think it&#39;s good to have the separate targets here</span></td></tr></table>
<table class="log-line" id="l-212"><tr class="log-row"><td class="log-lineno"><a href="#l-212">212</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> but yes, clearer code too :0</span></td></tr></table>
<table class="log-line" id="l-213"><tr class="log-row"><td class="log-lineno"><a href="#l-213">213</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> i will need to drop off now, but thanks for hosting marcofleon, and thanks all for spending time looking at my PR!</span></td></tr></table>
<table class="log-line" id="l-214"><tr class="log-row"><td class="log-lineno"><a href="#l-214">214</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> thanks for the explanations :)</span></td></tr></table>
<table class="log-line" id="l-215"><tr class="log-row"><td class="log-lineno"><a href="#l-215">215</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> thanks sipa!</span></td></tr></table>
<table class="log-line" id="l-216"><tr class="log-row"><td class="log-lineno"><a href="#l-216">216</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> thanks for all your help sipa</span></td></tr></table>
<table class="log-line" id="l-217"><tr class="log-row"><td class="log-lineno"><a href="#l-217">217</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> thanks for hosting, thanks for your work sipa</span></td></tr></table>
<table class="log-line" id="l-218"><tr class="log-row"><td class="log-lineno"><a href="#l-218">218</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> okay let&#39;s jump into SFL then?</span></td></tr></table>
<table class="log-line" id="l-219"><tr class="log-row"><td class="log-lineno"><a href="#l-219">219</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> :P</span></td></tr></table>
<table class="log-line" id="l-220"><tr class="log-row"><td class="log-lineno"><a href="#l-220">220</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> We have txgraph reorg waiting though</span></td></tr></table>
<table class="log-line" id="l-221"><tr class="log-row"><td class="log-lineno"><a href="#l-221">221</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> another day. Thanks for attending everybody</span></td></tr></table>
<table class="log-line" id="l-222"><tr class="log-row"><td class="log-lineno"><a href="#l-222">222</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:mediumseagreen">&lt;abubakarsadiq&gt;</span><span class="log-msg"> It&#39;s also juicy</span></td></tr></table>
<table class="log-line" id="l-223"><tr class="log-row"><td class="log-lineno"><a href="#l-223">223</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> oh yeah I kinda forgot about that one, good call</span></td></tr></table>
<table class="log-line" id="l-224"><tr class="log-row"><td class="log-lineno"><a href="#l-224">224</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> Could you guys share the answer for the last-1 question? Didn&#39;t get a clear answer of that</span></td></tr></table>
<table class="log-line" id="l-225"><tr class="log-row"><td class="log-lineno"><a href="#l-225">225</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> I think for last question inc and und are not complementary</span></td></tr></table>
<table class="log-line" id="l-226"><tr class="log-row"><td class="log-lineno"><a href="#l-226">226</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> My idea checking the algorithm was that for inclusion if you don&#39;t have inc you may try to add a tx without an ancestor being in the anc set</span></td></tr></table>
<table class="log-line" id="l-227"><tr class="log-row"><td class="log-lineno"><a href="#l-227">227</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> sure, maybe Abubakar has a clearer way to look at it, but I sort of initially thought that it was possible to get the inc with only having und</span></td></tr></table>
<table class="log-line" id="l-228"><tr class="log-row"><td class="log-lineno"><a href="#l-228">228</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> but then I realized that in order to keep track of feerate, you would need inc I believe</span></td></tr></table>
<table class="log-line" id="l-229"><tr class="log-row"><td class="log-lineno"><a href="#l-229">229</a></td><td class="log-time">18:03 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> it&#39;s really a tristate: undecided, included (definitely in the candidate set), excluded (definitely not in the candidate set)</span></td></tr></table>
<table class="log-line" id="l-230"><tr class="log-row"><td class="log-lineno"><a href="#l-230">230</a></td><td class="log-time">18:03 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> one of the sets that you add back to the queue has und - descendants(split), so I don&#39;t know how you would figure out inc from that queue set</span></td></tr></table>
<table class="log-line" id="l-231"><tr class="log-row"><td class="log-lineno"><a href="#l-231">231</a></td><td class="log-time">18:03 </td><td><span class="log-nick" style="color:mediumpurple">&lt;sipa&gt;</span><span class="log-msg"> excluded is just implicitly everything not included and not undecided</span></td></tr></table>
<table class="log-line" id="l-232"><tr class="log-row"><td class="log-lineno"><a href="#l-232">232</a></td><td class="log-time">18:04 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> tristate is a good way of phrasing it</span></td></tr></table>
<table class="log-line" id="l-233"><tr class="log-row"><td class="log-lineno"><a href="#l-233">233</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> could you implicitly have something like included = m_todo - undecided - excluded?</span></td></tr></table>
<table class="log-line" id="l-234"><tr class="log-row"><td class="log-lineno"><a href="#l-234">234</a></td><td class="log-time">18:07 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> would that be better? I&#39;m not sure</span></td></tr></table>
<table class="log-line" id="l-235"><tr class="log-row"><td class="log-lineno"><a href="#l-235">235</a></td><td class="log-time">18:08 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> No probably not, that&#39;s just what prompted the question for me. Better to keep track of included explicitly</span></td></tr></table>
<table class="log-line" id="l-236"><tr class="log-row"><td class="log-lineno"><a href="#l-236">236</a></td><td class="log-time">18:09 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> I think keeping inc explicitly is needed bc tx have dependencies between them, not explicitly knowing what is inc may cause you try to add a tx without some ancestor in the inc</span></td></tr></table>
<table class="log-line" id="l-237"><tr class="log-row"><td class="log-lineno"><a href="#l-237">237</a></td><td class="log-time">18:11 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> Right that makes sense</span></td></tr></table>
<table class="log-line" id="l-238"><tr class="log-row"><td class="log-lineno"><a href="#l-238">238</a></td><td class="log-time">18:11 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> still learning a lot about the clusterlin stuff, it&#39;s not easy</span></td></tr></table>
<table class="log-line" id="l-239"><tr class="log-row"><td class="log-lineno"><a href="#l-239">239</a></td><td class="log-time">18:12 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> no it&#39;s not, this was first time I read about it and also about fuzz, too many new things in one pr :)</span></td></tr></table>
<table class="log-line" id="l-240"><tr class="log-row"><td class="log-lineno"><a href="#l-240">240</a></td><td class="log-time">18:12 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> sliv3r__ i saw your question on the PR and I believe smallest set breaks the tie</span></td></tr></table>
<table class="log-line" id="l-241"><tr class="log-row"><td class="log-lineno"><a href="#l-241">241</a></td><td class="log-time">18:12 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> And that&#39;s good to know actually, I&#39;ll keep that mind. I did realize this review club was trying to do two things at once, which didn&#39;t help</span></td></tr></table>
<table class="log-line" id="l-242"><tr class="log-row"><td class="log-lineno"><a href="#l-242">242</a></td><td class="log-time">18:13 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> marcofleon: if that&#39;s the case would it make sense to assert the size?</span></td></tr></table>
<table class="log-line" id="l-243"><tr class="log-row"><td class="log-lineno"><a href="#l-243">243</a></td><td class="log-time">18:13 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> this is my second fuzz pr review and still learning... haha</span></td></tr></table>
<table class="log-line" id="l-244"><tr class="log-row"><td class="log-lineno"><a href="#l-244">244</a></td><td class="log-time">18:13 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> marcofleon: nono it was great :) double knowledge</span></td></tr></table>
<table class="log-line" id="l-245"><tr class="log-row"><td class="log-lineno"><a href="#l-245">245</a></td><td class="log-time">18:14 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> sliv3r__: yes agree</span></td></tr></table>
<table class="log-line" id="l-246"><tr class="log-row"><td class="log-lineno"><a href="#l-246">246</a></td><td class="log-time">18:15 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> fuzzing is awesome, it&#39;s a great tool</span></td></tr></table>
<table class="log-line" id="l-247"><tr class="log-row"><td class="log-lineno"><a href="#l-247">247</a></td><td class="log-time">18:16 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> Last question answer was: just release the code and let users complain and say that Core introduces bugs right (as it&#39;s the new tred saying that)? :P</span></td></tr></table>
<table class="log-line" id="l-248"><tr class="log-row"><td class="log-lineno"><a href="#l-248">248</a></td><td class="log-time">18:16 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> sliv3r__ I at least know in cluster_linearize.h FindCandidateSet says smallest set is the tiebreaker</span></td></tr></table>
<table class="log-line" id="l-249"><tr class="log-row"><td class="log-lineno"><a href="#l-249">249</a></td><td class="log-time">18:17 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> oh yeah haha q10 What is, no doubt, the coolest way to test code?</span></td></tr></table>
<table class="log-line" id="l-250"><tr class="log-row"><td class="log-lineno"><a href="#l-250">250</a></td><td class="log-time">18:18 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> marcofleon: Yeah I saw the comment in the code. Just added a line in my prev comment so sipa can see it and say</span></td></tr></table>
<table class="log-line" id="l-251"><tr class="log-row"><td class="log-lineno"><a href="#l-251">251</a></td><td class="log-time">18:19 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> glad you two were able to fuzz it a bit. But yeah monlovesmango I recommend doing the indivdual targets like how we said earlier. The test runner is fine for running through a corpus of inputs once</span></td></tr></table>
<table class="log-line" id="l-252"><tr class="log-row"><td class="log-lineno"><a href="#l-252">252</a></td><td class="log-time">18:19 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> yeah I agree its much better. I learned a lot more about fuzz best practices</span></td></tr></table>
<table class="log-line" id="l-253"><tr class="log-row"><td class="log-lineno"><a href="#l-253">253</a></td><td class="log-time">18:20 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> thank you all for walking me through that :)</span></td></tr></table>
<table class="log-line" id="l-254"><tr class="log-row"><td class="log-lineno"><a href="#l-254">254</a></td><td class="log-time">18:20 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> me too this was actually really usefull</span></td></tr></table>
<table class="log-line" id="l-255"><tr class="log-row"><td class="log-lineno"><a href="#l-255">255</a></td><td class="log-time">18:20 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> Glad to hear it. Okay that&#39;s it for me. Thanks again for coming, see you both soon!</span></td></tr></table>
<table class="log-line" id="l-256"><tr class="log-row"><td class="log-lineno"><a href="#l-256">256</a></td><td class="log-time">18:20 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> Thanks for hosting!</span></td></tr></table>
<table class="log-line" id="l-257"><tr class="log-row"><td class="log-lineno"><a href="#l-257">257</a></td><td class="log-time">18:21 </td><td><span class="log-nick" style="color:mediumblue">&lt;monlovesmango&gt;</span><span class="log-msg"> thanks for hosting marcofleon !! was a good one</span></td></tr></table>
<table class="log-line" id="l-258"><tr class="log-row"><td class="log-lineno"><a href="#l-258">258</a></td><td class="log-time">18:26 </td><td><span class="log-nick" style="color:blueviolet">&lt;sliv3r__&gt;</span><span class="log-msg"> marcofleon: I think you forgot to end the meeting ;)</span></td></tr></table>
<table class="log-line" id="l-259"><tr class="log-row"><td class="log-lineno"><a href="#l-259">259</a></td><td class="log-time">18:27 </td><td><span class="log-nick" style="color:indianred">&lt;marcofleon&gt;</span><span class="log-msg"> #endmeeting</span></td></tr></table>]]></content><author><name>sipa</name></author><summary type="html"><![CDATA[Notes]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bitcoincore.reviews/assets/img/twitter_card.png" /><media:content medium="image" url="https://bitcoincore.reviews/assets/img/twitter_card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Protect addnode peers during IBD</title><link href="https://bitcoincore.reviews/32051" rel="alternate" type="text/html" title="Protect addnode peers during IBD" /><published>2025-05-28T00:00:00+00:00</published><updated>2025-05-28T00:00:00+00:00</updated><id>https://bitcoincore.reviews/#32051</id><content type="html" xml:base="https://bitcoincore.reviews/32051"><![CDATA[<h2 id="notes">Notes</h2>

<h3 id="motivation">Motivation</h3>

<p>While doing initial block download (IBD) over a fluctuating and slow internet
connection in El Salvador, I observed very frequent peer disconnections in the
debug log, on the order of 100+ per hour. These disconnections were often of
manually added “addnode” peers, and logged as <code class="language-plaintext highlighter-rouge">Peer is stalling block download,
disconnecting &lt;peer&gt;</code>. Ping requests to these peers often took 20-100 seconds.</p>

<p>Even after IBD was completed, addnode peer disconnections still happened:</p>

<p><code class="language-plaintext highlighter-rouge">Timeout downloading block &lt;hex&gt;, disconnecting &lt;peer&gt;</code></p>

<h3 id="discussion">Discussion</h3>

<p>When an addnode peer is disconnected by the IBD headers/blocks download timeout
or stalling logic, <code class="language-plaintext highlighter-rouge">ThreadOpenAddedConnections</code> attempts to immediately
reconnect it – unless “onetry” was passed to the addnode RPC – up to the limit
of 8 addnode connections. This limit is separate from the regular peer
connection limits.</p>

<p><code class="language-plaintext highlighter-rouge">ThreadOpenAddedConnections</code> will continue to attempt reconnection of the
disconnected addnode peer until it succeeds.</p>

<p>When these disconnection/reconnection cycles happen frequently with
addnode peers, it is likely network, resource and time intensive.
This is particularly true for I2P peers, as these involve destroying and
rebuilding 2 tunnels for each peer connection. It seems worth avoiding this if
it is straightforward to do so.</p>

<p>Automatic (non-addnode) peers are also disconnected by the same logic, but they
are a different category and case (non-protected peers, no immediate
connection/reconnection) that would require monitoring over time to adjust the
timeouts accordingly. Martin Zumsande was looking into optimizing this (see
https://bitcoin-irc.chaincode.com/bitcoin-core-dev/2025-01-22#1083993): <em>“The
challenge is to distinguish this situation from making things worse for
fast/reliable connections that just have some slow peers which should be
disconnected.”</em></p>

<p>The goal of this pull request is thus to avoid unnecessary frequent
disconnections and immediate reconnections of addnode peers, both during IBD and
afterwards.</p>

<h3 id="approach">Approach</h3>

<ol>
  <li>
    <p>The first commit, “p2p: protect addnode peers during IBD”, provides addnode
peers the max <code class="language-plaintext highlighter-rouge">BLOCK_STALLING_TIMEOUT_MAX</code> value of 64 seconds for the IBD
stalling logic (“Peer is stalling block download”) in <code class="language-plaintext highlighter-rouge">src/net_processing.cpp</code>.</p>
  </li>
  <li>
    <p>The second commit, “p2p: don’t disconnect addnode peers for block download
timeout”, proposes to protect addnode peers from disconnection. <a href="https://github.com/bitcoin/bitcoin/pull/32051#pullrequestreview-2691505746">Review
feedback</a>
suggested that we also clear their block requests, so that these blocks can
be requested from other peers.</p>
  </li>
  <li>
    <p>The third commit, “p2p: don’t disconnect addnode peers for slow
initial-headers-sync”, proposes the same protection for addnode peers that we
currently already provide to peers with <code class="language-plaintext highlighter-rouge">NetPermissionFlags::NoBan</code>
permission.</p>
  </li>
  <li>
    <p>The fourth commit, “rpc, doc: update addnode documentation”, updates the RPC
addnode help documentation.</p>
  </li>
</ol>

<h2 id="questions">Questions</h2>

<ol>
  <li>
    <p>Did you review the PR? <a href="https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#peer-review">Concept ACK, approach ACK, tested ACK, or NACK</a>? What was your review approach?</p>
  </li>
  <li>
    <p>What is an addnode peer? How can you specify them to your node?</p>
  </li>
  <li>
    <p>Do you provide addnode peers to the node(s) that you run? Why or why not?
What kind of peers do you choose?</p>
  </li>
  <li>
    <p>What is a fundamental protection that addnode peers can provide to your node?</p>
  </li>
  <li>
    <p>What do you think of the <a href="https://github.com/bitcoin/bitcoin/pull/32051#issuecomment-2825824998">review suggestion</a>
to rate peers and use that to scale the number of blocks we request from them?</p>
  </li>
  <li>
    <p>One reviewer
<a href="https://github.com/bitcoin/bitcoin/pull/32051#pullrequestreview-2691505746">suggested</a>
clearing block requests instead of disconnecting peers. How would you
implement this?</p>
  </li>
  <li>
    <p>How is the test coverage for the code affected by this change? Can
you think of any tests that would be worthwhile adding?</p>
  </li>
</ol>

<h2 id="erratum">Erratum</h2>

<p>Attendee stringintech correctly <a href="#l-24">identified</a> that the <code class="language-plaintext highlighter-rouge">addnode</code>
code was introduced by Satoshi, namely in commit
<a href="https://github.com/bitcoin/bitcoin/commit/e66ec79b18717bf83b7dbbe54f844b4463dabdeb"><code class="language-plaintext highlighter-rouge">e66ec79b</code></a>.</p>

<h2 id="meeting-log">Meeting Log</h2>

<table class="log-line" id="l-1"><tr class="log-row"><td class="log-lineno"><a href="#l-1">&nbsp;&nbsp;1</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> #startmeeting</span></td></tr></table>
<table class="log-line" id="l-2"><tr class="log-row"><td class="log-lineno"><a href="#l-2">&nbsp;&nbsp;2</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:slateblue">&lt;corebot&gt;</span><span class="log-msg"> jonatack: Meeting started at 2025-05-28T17:00+0000</span></td></tr></table>
<table class="log-line" id="l-3"><tr class="log-row"><td class="log-lineno"><a href="#l-3">&nbsp;&nbsp;3</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:slateblue">&lt;corebot&gt;</span><span class="log-msg"> jonatack: Current chairs: jonatack</span></td></tr></table>
<table class="log-line" id="l-4"><tr class="log-row"><td class="log-lineno"><a href="#l-4">&nbsp;&nbsp;4</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:slateblue">&lt;corebot&gt;</span><span class="log-msg"> jonatack: Useful commands: #action #info #idea #link #topic #motion #vote #close #endmeeting</span></td></tr></table>
<table class="log-line" id="l-5"><tr class="log-row"><td class="log-lineno"><a href="#l-5">&nbsp;&nbsp;5</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:slateblue">&lt;corebot&gt;</span><span class="log-msg"> jonatack: See also: <a href="https://hcoop-meetbot.readthedocs.io/en/stable/" target="blank">https://hcoop-meetbot.readthedocs.io/en/stable/</a></span></td></tr></table>
<table class="log-line" id="l-6"><tr class="log-row"><td class="log-lineno"><a href="#l-6">&nbsp;&nbsp;6</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:slateblue">&lt;corebot&gt;</span><span class="log-msg"> jonatack: Participants should now identify themselves with &#39;#here&#39; or with an alias like &#39;#here FirstLast&#39;</span></td></tr></table>
<table class="log-line" id="l-7"><tr class="log-row"><td class="log-lineno"><a href="#l-7">&nbsp;&nbsp;7</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Hi and welcome to this week&#39;s review club!</span></td></tr></table>
<table class="log-line" id="l-8"><tr class="log-row"><td class="log-lineno"><a href="#l-8">&nbsp;&nbsp;8</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> Hi!</span></td></tr></table>
<table class="log-line" id="l-9"><tr class="log-row"><td class="log-lineno"><a href="#l-9">&nbsp;&nbsp;9</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> hello :)</span></td></tr></table>
<table class="log-line" id="l-10"><tr class="log-row"><td class="log-lineno"><a href="#l-10">&nbsp;10</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-11"><tr class="log-row"><td class="log-lineno"><a href="#l-11">&nbsp;11</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Today we&#39;ll be discussing &quot;p2p: protect addnode peers during IBD&quot;</span></td></tr></table>
<table class="log-line" id="l-12"><tr class="log-row"><td class="log-lineno"><a href="#l-12">&nbsp;12</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> hello</span></td></tr></table>
<table class="log-line" id="l-13"><tr class="log-row"><td class="log-lineno"><a href="#l-13">&nbsp;13</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Review club url:</span></td></tr></table>
<table class="log-line" id="l-14"><tr class="log-row"><td class="log-lineno"><a href="#l-14">&nbsp;14</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> <a href="https://bitcoincore.reviews/32051" target="blank">https://bitcoincore.reviews/32051</a></span></td></tr></table>
<table class="log-line" id="l-15"><tr class="log-row"><td class="log-lineno"><a href="#l-15">&nbsp;15</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Bitcoin Core PR url:</span></td></tr></table>
<table class="log-line" id="l-16"><tr class="log-row"><td class="log-lineno"><a href="#l-16">&nbsp;16</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/pull/32051" target="blank">https://github.com/bitcoin/bitcoin/pull/32051</a></span></td></tr></table>
<table class="log-line" id="l-17"><tr class="log-row"><td class="log-lineno"><a href="#l-17">&nbsp;17</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Anyone here for the first time? Feel free to say hi, even if you&#39;re only observing.</span></td></tr></table>
<table class="log-line" id="l-18"><tr class="log-row"><td class="log-lineno"><a href="#l-18">&nbsp;18</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> This discussion is ad hoc and asynchronous, so feel free to continue conversation on previous questions when we move on, or raise any other questions or thoughts you have.</span></td></tr></table>
<table class="log-line" id="l-19"><tr class="log-row"><td class="log-lineno"><a href="#l-19">&nbsp;19</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> To get the convo warmed up: Anyone know who originally introduced the addnode code into Bitcoin Core?</span></td></tr></table>
<table class="log-line" id="l-20"><tr class="log-row"><td class="log-lineno"><a href="#l-20">&nbsp;20</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> stringintech: monlovesmango: yuvic: enochazariah: welcome!</span></td></tr></table>
<table class="log-line" id="l-21"><tr class="log-row"><td class="log-lineno"><a href="#l-21">&nbsp;21</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> no idea..</span></td></tr></table>
<table class="log-line" id="l-22"><tr class="log-row"><td class="log-lineno"><a href="#l-22">&nbsp;22</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> maybe laanwj?</span></td></tr></table>
<table class="log-line" id="l-23"><tr class="log-row"><td class="log-lineno"><a href="#l-23">&nbsp;23</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> i do not know that</span></td></tr></table>
<table class="log-line" id="l-24"><tr class="log-row"><td class="log-lineno"><a href="#l-24">&nbsp;24</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> satoshi? seeing him in addnode commits in git log :))</span></td></tr></table>
<table class="log-line" id="l-25"><tr class="log-row"><td class="log-lineno"><a href="#l-25">&nbsp;25</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> :D if my memory serves, it was gregory maxwell (&quot;gmax&quot; in the poll at <a href="https://x.com/jonatack/status/1927768398630387973" target="blank">https://x.com/jonatack/status/1927768398630387973</a>)</span></td></tr></table>
<table class="log-line" id="l-26"><tr class="log-row"><td class="log-lineno"><a href="#l-26">&nbsp;26</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> So</span></td></tr></table>
<table class="log-line" id="l-27"><tr class="log-row"><td class="log-lineno"><a href="#l-27">&nbsp;27</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> an interesting observation, I have found, from out in the field in Central America,</span></td></tr></table>
<table class="log-line" id="l-28"><tr class="log-row"><td class="log-lineno"><a href="#l-28">&nbsp;28</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> is that bitcoind in general is quite robust in dealing with a hostile environment of poor or intermittent internet connection</span></td></tr></table>
<table class="log-line" id="l-29"><tr class="log-row"><td class="log-lineno"><a href="#l-29">&nbsp;29</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> e.g. where browsing the internet might be painfully slow or no longer really viable, but your bitcoind node survives/thrives quite well</span></td></tr></table>
<table class="log-line" id="l-30"><tr class="log-row"><td class="log-lineno"><a href="#l-30">&nbsp;30</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> in contrast</span></td></tr></table>
<table class="log-line" id="l-31"><tr class="log-row"><td class="log-lineno"><a href="#l-31">&nbsp;31</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> the stalling/timeout logic seems less tolerant and adapted, to a slow hostile environment</span></td></tr></table>
<table class="log-line" id="l-32"><tr class="log-row"><td class="log-lineno"><a href="#l-32">&nbsp;32</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> as it lacks the ability to monitor and adapt accordingly</span></td></tr></table>
<table class="log-line" id="l-33"><tr class="log-row"><td class="log-lineno"><a href="#l-33">&nbsp;33</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> which, as noted in the notes, mzumsande was looking at improving</span></td></tr></table>
<table class="log-line" id="l-34"><tr class="log-row"><td class="log-lineno"><a href="#l-34">&nbsp;34</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> still, I noticed the disconnections were heavily affecting some of my addnode peers that were being targeted for no fault of their own, some of which were low latency (like cjdns peers) or medium/higher latency (like tor and i2p peers)</span></td></tr></table>
<table class="log-line" id="l-35"><tr class="log-row"><td class="log-lineno"><a href="#l-35">&nbsp;35</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> which motivated this pull request.</span></td></tr></table>
<table class="log-line" id="l-36"><tr class="log-row"><td class="log-lineno"><a href="#l-36">&nbsp;36</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Did anyone get the chance to review the notes and/or PR (y/n)?</span></td></tr></table>
<table class="log-line" id="l-37"><tr class="log-row"><td class="log-lineno"><a href="#l-37">&nbsp;37</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> y</span></td></tr></table>
<table class="log-line" id="l-38"><tr class="log-row"><td class="log-lineno"><a href="#l-38">&nbsp;38</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> yes</span></td></tr></table>
<table class="log-line" id="l-39"><tr class="log-row"><td class="log-lineno"><a href="#l-39">&nbsp;39</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> y</span></td></tr></table>
<table class="log-line" id="l-40"><tr class="log-row"><td class="log-lineno"><a href="#l-40">&nbsp;40</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> yes</span></td></tr></table>
<table class="log-line" id="l-41"><tr class="log-row"><td class="log-lineno"><a href="#l-41">&nbsp;41</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> excellent</span></td></tr></table>
<table class="log-line" id="l-42"><tr class="log-row"><td class="log-lineno"><a href="#l-42">&nbsp;42</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> I&#39;ll add some bonus questions about the code, but let&#39;s begin with the more general ones</span></td></tr></table>
<table class="log-line" id="l-43"><tr class="log-row"><td class="log-lineno"><a href="#l-43">&nbsp;43</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> 1. What is an addnode peer? How can you specify them to your node?</span></td></tr></table>
<table class="log-line" id="l-44"><tr class="log-row"><td class="log-lineno"><a href="#l-44">&nbsp;44</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> (this is a practical question for anyone who runs a node)</span></td></tr></table>
<table class="log-line" id="l-45"><tr class="log-row"><td class="log-lineno"><a href="#l-45">&nbsp;45</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> peer which we manually add or connect, using addnode rpc or -addnode/-connect config.</span></td></tr></table>
<table class="log-line" id="l-46"><tr class="log-row"><td class="log-lineno"><a href="#l-46">&nbsp;46</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> yes! and why would you want to do that, as a node runner</span></td></tr></table>
<table class="log-line" id="l-47"><tr class="log-row"><td class="log-lineno"><a href="#l-47">&nbsp;47</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> peer that a node can connect to, it can be speified to the node by using the command line</span></td></tr></table>
<table class="log-line" id="l-48"><tr class="log-row"><td class="log-lineno"><a href="#l-48">&nbsp;48</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> right, either via CLI/RPC addnode (onetry for a one-shot attempt, or &quot;add&quot; to add it to the addnode list)</span></td></tr></table>
<table class="log-line" id="l-49"><tr class="log-row"><td class="log-lineno"><a href="#l-49">&nbsp;49</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> so you can connect to a peer that you know to be honest</span></td></tr></table>
<table class="log-line" id="l-50"><tr class="log-row"><td class="log-lineno"><a href="#l-50">&nbsp;50</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> as I trust that peer or also to sync up faster during IBD</span></td></tr></table>
<table class="log-line" id="l-51"><tr class="log-row"><td class="log-lineno"><a href="#l-51">&nbsp;51</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> to maintain connections to nodes I trust in case for example the core peer selection fails for some reason</span></td></tr></table>
<table class="log-line" id="l-52"><tr class="log-row"><td class="log-lineno"><a href="#l-52">&nbsp;52</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> I think a reason why someone would want to add node to add more trust in the network, verify don&#39;t trust</span></td></tr></table>
<table class="log-line" id="l-53"><tr class="log-row"><td class="log-lineno"><a href="#l-53">&nbsp;53</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> or in your bitcoin.conf file with addnode=&lt;peer&gt; ... one per line</span></td></tr></table>
<table class="log-line" id="l-54"><tr class="log-row"><td class="log-lineno"><a href="#l-54">&nbsp;54</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> So: to ensure a connection to a *trusted* peer</span></td></tr></table>
<table class="log-line" id="l-55"><tr class="log-row"><td class="log-lineno"><a href="#l-55">&nbsp;55</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> What is a fundamental protection that a trusted peer can provide to your node?</span></td></tr></table>
<table class="log-line" id="l-56"><tr class="log-row"><td class="log-lineno"><a href="#l-56">&nbsp;56</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> assuming they are an honest peer becaue you know/trust them</span></td></tr></table>
<table class="log-line" id="l-57"><tr class="log-row"><td class="log-lineno"><a href="#l-57">&nbsp;57</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> it can help prevent the node from being isolated from the rest of the network (not having the knowledge of the best chain anymore) by malicious peers</span></td></tr></table>
<table class="log-line" id="l-58"><tr class="log-row"><td class="log-lineno"><a href="#l-58">&nbsp;58</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> yes to sync with the best chain</span></td></tr></table>
<table class="log-line" id="l-59"><tr class="log-row"><td class="log-lineno"><a href="#l-59">&nbsp;59</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> would probably provide protection against a sybil attack</span></td></tr></table>
<table class="log-line" id="l-60"><tr class="log-row"><td class="log-lineno"><a href="#l-60">&nbsp;60</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> protection from isolation</span></td></tr></table>
<table class="log-line" id="l-61"><tr class="log-row"><td class="log-lineno"><a href="#l-61">&nbsp;61</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> right!</span></td></tr></table>
<table class="log-line" id="l-62"><tr class="log-row"><td class="log-lineno"><a href="#l-62">&nbsp;62</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> <a href="https://river.com/learn/terms/e/eclipse-attack/" target="blank">https://river.com/learn/terms/e/eclipse-attack/</a></span></td></tr></table>
<table class="log-line" id="l-63"><tr class="log-row"><td class="log-lineno"><a href="#l-63">&nbsp;63</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> &quot;An eclipse attack targets particular nodes in a network by surrounding them and obscuring their view of the entire network. For example, if a Bitcoin node has eight connections to other nodes, and an attacker controls all eight of those nodes, the attacker can refuse to relay any new blocks that miners produce. Although the rest of the network continues to process new blocks, the</span></td></tr></table>
<table class="log-line" id="l-64"><tr class="log-row"><td class="log-lineno"><a href="#l-64">&nbsp;64</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> victim node will be unaware that blocks are coming in.&quot;</span></td></tr></table>
<table class="log-line" id="l-65"><tr class="log-row"><td class="log-lineno"><a href="#l-65">&nbsp;65</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> It only takes one single honest peer connection to break out of an eclipe attack</span></td></tr></table>
<table class="log-line" id="l-66"><tr class="log-row"><td class="log-lineno"><a href="#l-66">&nbsp;66</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> ah so there is a term for it hah</span></td></tr></table>
<table class="log-line" id="l-67"><tr class="log-row"><td class="log-lineno"><a href="#l-67">&nbsp;67</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> yes</span></td></tr></table>
<table class="log-line" id="l-68"><tr class="log-row"><td class="log-lineno"><a href="#l-68">&nbsp;68</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> yes eclipse attack</span></td></tr></table>
<table class="log-line" id="l-69"><tr class="log-row"><td class="log-lineno"><a href="#l-69">&nbsp;69</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> So, by adding a trusted peer, your node cannot be successfully eclipsed unless your addnode peer connections are also eclipsed</span></td></tr></table>
<table class="log-line" id="l-70"><tr class="log-row"><td class="log-lineno"><a href="#l-70">&nbsp;70</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> then if we are choosing more than one addnode peer, they should be also geographically diverse so that for example if one region is compromised, our node can still maintain connections to rest of the network...</span></td></tr></table>
<table class="log-line" id="l-71"><tr class="log-row"><td class="log-lineno"><a href="#l-71">&nbsp;71</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Therefore, it&#39;s a good idea to add some trusted peers using the addnode config option or rpc/cli </span></td></tr></table>
<table class="log-line" id="l-72"><tr class="log-row"><td class="log-lineno"><a href="#l-72">&nbsp;72</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> stringintech: sgtm</span></td></tr></table>
<table class="log-line" id="l-73"><tr class="log-row"><td class="log-lineno"><a href="#l-73">&nbsp;73</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> You can have up to 8 addnode peer connections simultaneously</span></td></tr></table>
<table class="log-line" id="l-74"><tr class="log-row"><td class="log-lineno"><a href="#l-74">&nbsp;74</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> In addition to the limit of 8 autamatic full outbound conns and 2 block-relay-only ones</span></td></tr></table>
<table class="log-line" id="l-75"><tr class="log-row"><td class="log-lineno"><a href="#l-75">&nbsp;75</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> (along with transient connections, like feelers or extra block-relay-only conns</span></td></tr></table>
<table class="log-line" id="l-76"><tr class="log-row"><td class="log-lineno"><a href="#l-76">&nbsp;76</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> or addr_fetch ones)</span></td></tr></table>
<table class="log-line" id="l-77"><tr class="log-row"><td class="log-lineno"><a href="#l-77">&nbsp;77</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> see src/node/connection_types.h for details</span></td></tr></table>
<table class="log-line" id="l-78"><tr class="log-row"><td class="log-lineno"><a href="#l-78">&nbsp;78</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> Thanks for the details</span></td></tr></table>
<table class="log-line" id="l-79"><tr class="log-row"><td class="log-lineno"><a href="#l-79">&nbsp;79</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Now, onto the code</span></td></tr></table>
<table class="log-line" id="l-80"><tr class="log-row"><td class="log-lineno"><a href="#l-80">&nbsp;80</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> What function contains the Bitcoin Core stalling and timeout logic?</span></td></tr></table>
<table class="log-line" id="l-81"><tr class="log-row"><td class="log-lineno"><a href="#l-81">&nbsp;81</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> PeerManagerImpl::SendMessages()</span></td></tr></table>
<table class="log-line" id="l-82"><tr class="log-row"><td class="log-lineno"><a href="#l-82">&nbsp;82</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> this wasn&#39;t a question to prepare in advance, but you can search the codebase right now if you like</span></td></tr></table>
<table class="log-line" id="l-83"><tr class="log-row"><td class="log-lineno"><a href="#l-83">&nbsp;83</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> SendMessages</span></td></tr></table>
<table class="log-line" id="l-84"><tr class="log-row"><td class="log-lineno"><a href="#l-84">&nbsp;84</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> in PeerManagerImpl</span></td></tr></table>
<table class="log-line" id="l-85"><tr class="log-row"><td class="log-lineno"><a href="#l-85">&nbsp;85</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> excellent</span></td></tr></table>
<table class="log-line" id="l-86"><tr class="log-row"><td class="log-lineno"><a href="#l-86">&nbsp;86</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> SendMessages</span></td></tr></table>
<table class="log-line" id="l-87"><tr class="log-row"><td class="log-lineno"><a href="#l-87">&nbsp;87</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> From where is SendMessages() called?</span></td></tr></table>
<table class="log-line" id="l-88"><tr class="log-row"><td class="log-lineno"><a href="#l-88">&nbsp;88</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> (who it its caller)</span></td></tr></table>
<table class="log-line" id="l-89"><tr class="log-row"><td class="log-lineno"><a href="#l-89">&nbsp;89</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> connection manager</span></td></tr></table>
<table class="log-line" id="l-90"><tr class="log-row"><td class="log-lineno"><a href="#l-90">&nbsp;90</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> stringintech: can you elaborate?</span></td></tr></table>
<table class="log-line" id="l-91"><tr class="log-row"><td class="log-lineno"><a href="#l-91">&nbsp;91</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> it is called from a thread, currently inside src/net.cpp</span></td></tr></table>
<table class="log-line" id="l-92"><tr class="log-row"><td class="log-lineno"><a href="#l-92">&nbsp;92</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> I should go back for source for detail</span></td></tr></table>
<table class="log-line" id="l-93"><tr class="log-row"><td class="log-lineno"><a href="#l-93">&nbsp;93</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> but I guess we would loop over peers</span></td></tr></table>
<table class="log-line" id="l-94"><tr class="log-row"><td class="log-lineno"><a href="#l-94">&nbsp;94</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> can call this after ProcessMessages</span></td></tr></table>
<table class="log-line" id="l-95"><tr class="log-row"><td class="log-lineno"><a href="#l-95">&nbsp;95</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> Not sure, but i think THe ThreadMessageHandler is the method that calls the SendMessages</span></td></tr></table>
<table class="log-line" id="l-96"><tr class="log-row"><td class="log-lineno"><a href="#l-96">&nbsp;96</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> correct for both</span></td></tr></table>
<table class="log-line" id="l-97"><tr class="log-row"><td class="log-lineno"><a href="#l-97">&nbsp;97</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> *SendMessage</span></td></tr></table>
<table class="log-line" id="l-98"><tr class="log-row"><td class="log-lineno"><a href="#l-98">&nbsp;98</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> void CConnman::ThreadMessageHandler()</span></td></tr></table>
<table class="log-line" id="l-99"><tr class="log-row"><td class="log-lineno"><a href="#l-99">&nbsp;99</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> that calls ProcessMessages() and then SendMessages() for each peer, if not flagged for disconnection</span></td></tr></table>
<table class="log-line" id="l-100"><tr class="log-row"><td class="log-lineno"><a href="#l-100">100</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Now, on to the PR</span></td></tr></table>
<table class="log-line" id="l-101"><tr class="log-row"><td class="log-lineno"><a href="#l-101">101</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> I was pleasantly surprised by pinheadz&#39;s review here <a href="https://github.com/bitcoin/bitcoin/pull/32051#pullrequestreview-2864676242" target="blank">https://github.com/bitcoin/bitcoin/pull/32051#pullrequestreview-2864676242</a></span></td></tr></table>
<table class="log-line" id="l-102"><tr class="log-row"><td class="log-lineno"><a href="#l-102">102</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> &quot;I believe this also closes an 11-year-old issue: <a href="https://github.com/bitcoin/bitcoin/issues/5097&amp;quot" target="blank">https://github.com/bitcoin/bitcoin/issues/5097&amp;quot</a>;</span></td></tr></table>
<table class="log-line" id="l-103"><tr class="log-row"><td class="log-lineno"><a href="#l-103">103</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> yes that was interesting</span></td></tr></table>
<table class="log-line" id="l-104"><tr class="log-row"><td class="log-lineno"><a href="#l-104">104</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> and also:</span></td></tr></table>
<table class="log-line" id="l-105"><tr class="log-row"><td class="log-lineno"><a href="#l-105">105</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/issues/9213" target="blank">https://github.com/bitcoin/bitcoin/issues/9213</a></span></td></tr></table>
<table class="log-line" id="l-106"><tr class="log-row"><td class="log-lineno"><a href="#l-106">106</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> that I need to read and look into TBH</span></td></tr></table>
<table class="log-line" id="l-107"><tr class="log-row"><td class="log-lineno"><a href="#l-107">107</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> Nice!</span></td></tr></table>
<table class="log-line" id="l-108"><tr class="log-row"><td class="log-lineno"><a href="#l-108">108</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> (as well as the review comments in <a href="https://github.com/bitcoin/bitcoin/pull/25880" target="blank">https://github.com/bitcoin/bitcoin/pull/25880</a>)</span></td></tr></table>
<table class="log-line" id="l-109"><tr class="log-row"><td class="log-lineno"><a href="#l-109">109</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Back to this PR</span></td></tr></table>
<table class="log-line" id="l-110"><tr class="log-row"><td class="log-lineno"><a href="#l-110">110</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> The PR as it is currently, is actually not well-named</span></td></tr></table>
<table class="log-line" id="l-111"><tr class="log-row"><td class="log-lineno"><a href="#l-111">111</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> because only the first commit affects the IBD issues that I observed</span></td></tr></table>
<table class="log-line" id="l-112"><tr class="log-row"><td class="log-lineno"><a href="#l-112">112</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> that first commit gives addnode peers more time. apart from that, it doesn&#39;t protect them from disconnection.</span></td></tr></table>
<table class="log-line" id="l-113"><tr class="log-row"><td class="log-lineno"><a href="#l-113">113</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> I had a question: Is the PR intentionally focusing on “-addnode” peers and not “-connect” peers?</span></td></tr></table>
<table class="log-line" id="l-114"><tr class="log-row"><td class="log-lineno"><a href="#l-114">114</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> I&#39;d be curious to hear if you have any thoughts or suggestions on the changes</span></td></tr></table>
<table class="log-line" id="l-115"><tr class="log-row"><td class="log-lineno"><a href="#l-115">115</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> stringintech: good question. Yes, I was focusing on addnode peers.</span></td></tr></table>
<table class="log-line" id="l-116"><tr class="log-row"><td class="log-lineno"><a href="#l-116">116</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> have you been able to test disconnection frequency after increasing timeout allowed?</span></td></tr></table>
<table class="log-line" id="l-117"><tr class="log-row"><td class="log-lineno"><a href="#l-117">117</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Making a note to verify the effect on a -connect peer. </span></td></tr></table>
<table class="log-line" id="l-118"><tr class="log-row"><td class="log-lineno"><a href="#l-118">118</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> monlovesmango: yes, I saw much fewer disconnections with the ping times of my peers with my internet speed</span></td></tr></table>
<table class="log-line" id="l-119"><tr class="log-row"><td class="log-lineno"><a href="#l-119">119</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> from 100 or more per minute to a few an hour</span></td></tr></table>
<table class="log-line" id="l-120"><tr class="log-row"><td class="log-lineno"><a href="#l-120">120</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> nice</span></td></tr></table>
<table class="log-line" id="l-121"><tr class="log-row"><td class="log-lineno"><a href="#l-121">121</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> it still took more than a month for that node to sync...</span></td></tr></table>
<table class="log-line" id="l-122"><tr class="log-row"><td class="log-lineno"><a href="#l-122">122</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> I had a similar question as mzumsande&#39;s comment on the pr -&gt; <a href="https://github.com/bitcoin/bitcoin/pull/32051/commits/3463a7f4813c3eece5ba9a260670a76e3f8d38ab#r1999313868" target="blank">https://github.com/bitcoin/bitcoin/pull/32051/commits/3463a7f4813c3eece5ba9a260670a76e3f8d38ab#r1999313868</a></span></td></tr></table>
<table class="log-line" id="l-123"><tr class="log-row"><td class="log-lineno"><a href="#l-123">123</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> like 5 weeks, but all those addnode disconnections were not helping, as those peers were being re-connected right away again afterward</span></td></tr></table>
<table class="log-line" id="l-124"><tr class="log-row"><td class="log-lineno"><a href="#l-124">124</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> if it isn&#39;t actually protect them from disconnection then I would say I concept ACK and approach ACK. but if it is protecting from disconnection then I think there needs to be more thought into what desired IBD behavior would be</span></td></tr></table>
<table class="log-line" id="l-125"><tr class="log-row"><td class="log-lineno"><a href="#l-125">125</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:salmon">&lt;monlovesmango&gt;</span><span class="log-msg"> jonatack: omg hahah</span></td></tr></table>
<table class="log-line" id="l-126"><tr class="log-row"><td class="log-lineno"><a href="#l-126">126</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> yuvic: yes, the high frequency of disconnections I was seeing during IBD were not of that logic </span></td></tr></table>
<table class="log-line" id="l-127"><tr class="log-row"><td class="log-lineno"><a href="#l-127">127</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> those are disconnections that occur infrequently (for me) after IBD is completed</span></td></tr></table>
<table class="log-line" id="l-128"><tr class="log-row"><td class="log-lineno"><a href="#l-128">128</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> got it!</span></td></tr></table>
<table class="log-line" id="l-129"><tr class="log-row"><td class="log-lineno"><a href="#l-129">129</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> I need to consider whether to potentially drop the second (and maybe third) commit to keep it focused on IBD only, when the high number of disconnections I was seeing took place</span></td></tr></table>
<table class="log-line" id="l-130"><tr class="log-row"><td class="log-lineno"><a href="#l-130">130</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> or, alternatively, try to implement his review suggestion to clear the block requests</span></td></tr></table>
<table class="log-line" id="l-131"><tr class="log-row"><td class="log-lineno"><a href="#l-131">131</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> I&#39;ve got a bit of a question</span></td></tr></table>
<table class="log-line" id="l-132"><tr class="log-row"><td class="log-lineno"><a href="#l-132">132</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> does this not raise up a silent stall? i mean, if the system does not have the inhererent mechanism to re-request that block from another peer, then the IBD could effectively stall, preventing a disconnection, but introducing a silent stall</span></td></tr></table>
<table class="log-line" id="l-133"><tr class="log-row"><td class="log-lineno"><a href="#l-133">133</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> enochazariah: I need to look at that (test coverage could be useful, as well, but maybe non-trivial to do, and only if it is reliable)</span></td></tr></table>
<table class="log-line" id="l-134"><tr class="log-row"><td class="log-lineno"><a href="#l-134">134</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> okay</span></td></tr></table>
<table class="log-line" id="l-135"><tr class="log-row"><td class="log-lineno"><a href="#l-135">135</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> The review comments turned up valuable history on this that I need to review.</span></td></tr></table>
<table class="log-line" id="l-136"><tr class="log-row"><td class="log-lineno"><a href="#l-136">136</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> I didn&#39;t necessarily expect the PR to be merged quickly as-is, but hoped to gain insight as to what would be best.</span></td></tr></table>
<table class="log-line" id="l-137"><tr class="log-row"><td class="log-lineno"><a href="#l-137">137</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> A long-term goal since years that comes up now and then in developer discussions</span></td></tr></table>
<table class="log-line" id="l-138"><tr class="log-row"><td class="log-lineno"><a href="#l-138">138</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> is how to score peers based on the resources they consume</span></td></tr></table>
<table class="log-line" id="l-139"><tr class="log-row"><td class="log-lineno"><a href="#l-139">139</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> see, for instance: <a href="https://github.com/bitcoin/bitcoin/pull/31672" target="blank">https://github.com/bitcoin/bitcoin/pull/31672</a></span></td></tr></table>
<table class="log-line" id="l-140"><tr class="log-row"><td class="log-lineno"><a href="#l-140">140</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> there was an issue for this</span></td></tr></table>
<table class="log-line" id="l-141"><tr class="log-row"><td class="log-lineno"><a href="#l-141">141</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> yes by vasild</span></td></tr></table>
<table class="log-line" id="l-142"><tr class="log-row"><td class="log-lineno"><a href="#l-142">142</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> yuvic: yes. how to measure this an open question.</span></td></tr></table>
<table class="log-line" id="l-143"><tr class="log-row"><td class="log-lineno"><a href="#l-143">143</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> i&#39;m not sure how useful the cpu load is, as I have been testing it, and the load seems to often be higher when the peer is first connected, and then go down to normal levels </span></td></tr></table>
<table class="log-line" id="l-144"><tr class="log-row"><td class="log-lineno"><a href="#l-144">144</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> and not necessarily indicate a bad peer</span></td></tr></table>
<table class="log-line" id="l-145"><tr class="log-row"><td class="log-lineno"><a href="#l-145">145</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> (to be continued)</span></td></tr></table>
<table class="log-line" id="l-146"><tr class="log-row"><td class="log-lineno"><a href="#l-146">146</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> i haven&#39;t seen it yet as useful -- on its own -- to qualify a peer to be disconnected</span></td></tr></table>
<table class="log-line" id="l-147"><tr class="log-row"><td class="log-lineno"><a href="#l-147">147</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> this perhaps connects to aj towns&#39; review suggestion about scoring peers and using that to scale the number of blocks we request from them</span></td></tr></table>
<table class="log-line" id="l-148"><tr class="log-row"><td class="log-lineno"><a href="#l-148">148</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> If anyone comes up with test coverage for the stalling or timeout logic here, I&#39;d be very happy to look at it and bring it into the PR</span></td></tr></table>
<table class="log-line" id="l-149"><tr class="log-row"><td class="log-lineno"><a href="#l-149">149</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> scoring them and using as an order, so a much higher score would mean higher chances of being requested</span></td></tr></table>
<table class="log-line" id="l-150"><tr class="log-row"><td class="log-lineno"><a href="#l-150">150</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> right now, the changes in this PR do not break any tests...</span></td></tr></table>
<table class="log-line" id="l-151"><tr class="log-row"><td class="log-lineno"><a href="#l-151">151</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> Regarding the timeout logics this PR touches, I could only find p2p_ibd_stalling.py, which covers the IBD block stalling timeout (and should possibly be adapted to reflect the addnode changes). I didn&#39;t find any integration tests for the initial header sync timeout and regular block download timeout. Am I right??</span></td></tr></table>
<table class="log-line" id="l-152"><tr class="log-row"><td class="log-lineno"><a href="#l-152">152</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> yes, test coverage would be interesting</span></td></tr></table>
<table class="log-line" id="l-153"><tr class="log-row"><td class="log-lineno"><a href="#l-153">153</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> stringintech: neat, maybe addnode connections could be added to that functional test file</span></td></tr></table>
<table class="log-line" id="l-154"><tr class="log-row"><td class="log-lineno"><a href="#l-154">154</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> stringintech: as for the header sync and block download, I have not yet looked</span></td></tr></table>
<table class="log-line" id="l-155"><tr class="log-row"><td class="log-lineno"><a href="#l-155">155</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> Hmm... I&#39;d be happy to work on the missing ones (regardless of the PR changes) and open a PR (in case it is out of the scope for this PR of course). If it merges first, the addnode PR could adapt them accordingly too.</span></td></tr></table>
<table class="log-line" id="l-156"><tr class="log-row"><td class="log-lineno"><a href="#l-156">156</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> Have to double check to see if they are actually missing</span></td></tr></table>
<table class="log-line" id="l-157"><tr class="log-row"><td class="log-lineno"><a href="#l-157">157</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> stringintech: that would be great!</span></td></tr></table>
<table class="log-line" id="l-158"><tr class="log-row"><td class="log-lineno"><a href="#l-158">158</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> please ping me (on the github PR, or via IRC or DM on twitter/x) if you come up with coverage</span></td></tr></table>
<table class="log-line" id="l-159"><tr class="log-row"><td class="log-lineno"><a href="#l-159">159</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> stringintech that would be nice</span></td></tr></table>
<table class="log-line" id="l-160"><tr class="log-row"><td class="log-lineno"><a href="#l-160">160</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> any final thoughts or questions?</span></td></tr></table>
<table class="log-line" id="l-161"><tr class="log-row"><td class="log-lineno"><a href="#l-161">161</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> 2 minutes left</span></td></tr></table>
<table class="log-line" id="l-162"><tr class="log-row"><td class="log-lineno"><a href="#l-162">162</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:teal">&lt;yuvic&gt;</span><span class="log-msg"> thanks, nothing from my side!</span></td></tr></table>
<table class="log-line" id="l-163"><tr class="log-row"><td class="log-lineno"><a href="#l-163">163</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> Nothing from my end</span></td></tr></table>
<table class="log-line" id="l-164"><tr class="log-row"><td class="log-lineno"><a href="#l-164">164</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Appreciate you all participating! </span></td></tr></table>
<table class="log-line" id="l-165"><tr class="log-row"><td class="log-lineno"><a href="#l-165">165</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Don&#39;t hesitate to leave a review comment or feedback on that PR or propose test coverage or improvements to it there</span></td></tr></table>
<table class="log-line" id="l-166"><tr class="log-row"><td class="log-lineno"><a href="#l-166">166</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:magenta">&lt;enochazariah&gt;</span><span class="log-msg"> Thank you jonatack</span></td></tr></table>
<table class="log-line" id="l-167"><tr class="log-row"><td class="log-lineno"><a href="#l-167">167</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:peru">&lt;stringintech&gt;</span><span class="log-msg"> Thank you jonatack!</span></td></tr></table>
<table class="log-line" id="l-168"><tr class="log-row"><td class="log-lineno"><a href="#l-168">168</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> Thank you!</span></td></tr></table>
<table class="log-line" id="l-169"><tr class="log-row"><td class="log-lineno"><a href="#l-169">169</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:orange">&lt;jonatack&gt;</span><span class="log-msg"> #endmeeting</span></td></tr></table>]]></content><author><name>jonatack</name></author><summary type="html"><![CDATA[Notes]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bitcoincore.reviews/assets/img/twitter_card.png" /><media:content medium="image" url="https://bitcoincore.reviews/assets/img/twitter_card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Separate UTXO set access from validation functions</title><link href="https://bitcoincore.reviews/32317" rel="alternate" type="text/html" title="Separate UTXO set access from validation functions" /><published>2025-05-14T00:00:00+00:00</published><updated>2025-05-14T00:00:00+00:00</updated><id>https://bitcoincore.reviews/#32317</id><content type="html" xml:base="https://bitcoincore.reviews/32317"><![CDATA[<h2 id="notes">Notes</h2>

<h3 id="motivation">Motivation</h3>

<p>The bitcoinkernel project carves out validation logic into a separate, stateful library, allowing it
to be used by other applications. Because the bitcoinkernel project has opted for an incremental
approach rather than a complete rewrite, its current interface is still strongly influenced by
Bitcoin Core’s architecture, requirements and assumptions.</p>

<p>The UTXO set is a crucial component of Bitcoin Core’s architecture, but it is an implementation
detail, and one that other Bitcoin node implementations may choose not to implement. For example:</p>
<ul>
  <li><a href="https://bitcoinops.org/en/topics/utreexo/">Utreexo</a> nodes, such as
<a href="https://github.com/vinteumorg/Floresta">Floresta</a>, rely on an accumulator instead of a UTXO set</li>
  <li><a href="https://gist.github.com/RubenSomsen/a61a37d14182ccd78760e477c78133cd">SwiftSync</a> is
near-stateless, and does not have the concept of a UTXO set.</li>
</ul>

<p>The motivation behind this PR is to, in future work, allow kernel users without a UTXO set to
validate a transaction by providing the validation function the specific UTXTOs it is spending.</p>

<h3 id="utxo-set">UTXO set</h3>

<p>The UTXO set is managed by <code class="language-plaintext highlighter-rouge">Chainstate::m_coins_views</code>, which contains an in-memory <code class="language-plaintext highlighter-rouge">CCoinsCacheView
m_cacheview</code> caching layer and a canonical on-disk <code class="language-plaintext highlighter-rouge">CCoinsViewDB m_dbview</code> layer. The <code class="language-plaintext highlighter-rouge">m_cacheview</code>
is instantiated with a <a href="https://github.com/bitcoin/bitcoin/blob/3edf400b1020d7b88402ebc0e758b1fad2e7a781/src/coins.h#L346"><code class="language-plaintext highlighter-rouge">base</code>
pointer</a>
to <code class="language-plaintext highlighter-rouge">m_dbview</code>, allowing <code class="language-plaintext highlighter-rouge">CCoinsCacheView::GetCoin()</code> to automatically load a UTXO (or <code class="language-plaintext highlighter-rouge">Coin</code>) from
disk if it does not exist in the cache.</p>

<h3 id="approach">Approach</h3>

<p>In the first 4 commits, this PR reduces coupling between transaction validation
functions and the UTXO set by requiring the caller to first fetch the <code class="language-plaintext highlighter-rouge">Coin</code>s or <code class="language-plaintext highlighter-rouge">CTxOut</code>s they
require and passing those to the validation function, instead of letting the validation function
access the UTXO set directly.</p>

<p>In subsequent commits, <code class="language-plaintext highlighter-rouge">ConnectBlock()</code>’s dependency on the UTXO set is removed entirely by carving
out the remaining logic that requires UTXO set interaction into a separate <code class="language-plaintext highlighter-rouge">SpendBlock()</code> method.</p>

<h2 id="questions">Questions</h2>

<ol>
  <li>
    <p>Did you review the PR? <a href="https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#peer-review">Concept ACK, approach ACK, tested ACK, or
NACK</a>? What was your
review approach?</p>
  </li>
  <li>
    <p>Why is carving out the new <code class="language-plaintext highlighter-rouge">SpendBlock()</code> function from <code class="language-plaintext highlighter-rouge">ConnectBlock()</code> helpful for this PR? How
would you compare the purpose of the two functions?</p>
  </li>
  <li>
    <p>Do you see another benefit of this decoupling, besides allowing kernel usage without a UTXO set?</p>
  </li>
  <li>
    <p>Especially during IBD, transaction validation must be fast. Are there any changes where you have
concerns about performance? Which measures can you identify this PR has adopted to minimize the
performance impact of this refactor?</p>
  </li>
  <li>
    <p><code class="language-plaintext highlighter-rouge">SpendBlock()</code> takes a <code class="language-plaintext highlighter-rouge">CBlock block</code>, <code class="language-plaintext highlighter-rouge">CBlockIndex pindex</code> and <code class="language-plaintext highlighter-rouge">uint256 block_hash</code> parameter,
all referencing the block being spent. Why do we need 3 parameters to do that?</p>
  </li>
  <li>
    <p><code class="language-plaintext highlighter-rouge">CCoinsViewCache</code> has two methods <code class="language-plaintext highlighter-rouge">AccessCoin()</code> and <code class="language-plaintext highlighter-rouge">GetCoin</code>() that both return a <code class="language-plaintext highlighter-rouge">Coin</code>-like
type. What is the difference between both methods, and when should which be used?</p>
  </li>
  <li>
    <p>The first commits in this PR refactor <code class="language-plaintext highlighter-rouge">CCoinsViewCache</code> out of the function signature of a couple
of validation functions. Does <code class="language-plaintext highlighter-rouge">CCoinsViewCache</code> hold the entire UTXO set? Why is that (not) a
problem? Does this PR change that behaviour?</p>
  </li>
  <li>
    <p>Why does <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/a7e41326234d3a381fdde0924af74c6561b10798">commit
<code class="language-plaintext highlighter-rouge">a7e4132</code></a>
use explicit template instantiation for <code class="language-plaintext highlighter-rouge">GetP2SHSigOpCount()</code>?</p>
  </li>
  <li>
    <p>Following on the previous question, why is there explicit instantiation of the
<code class="language-plaintext highlighter-rouge">&lt;std::span&lt;std::reference_wrapper&lt;const Coin&gt;&gt;&gt;</code> template when a <code class="language-plaintext highlighter-rouge">std::reference_wrapper&lt;T&gt;</code>
already <a href="https://en.cppreference.com/w/cpp/utility/functional/reference_wrapper#:~:text=but%20they%20are,T%26">implicitly
converts</a>
to <code class="language-plaintext highlighter-rouge">T&amp;</code>?</p>
  </li>
</ol>

<h2 id="meeting-log">Meeting Log</h2>

<table class="log-line" id="l-1"><tr class="log-row"><td class="log-lineno"><a href="#l-1">&nbsp;&nbsp;1</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> #startmeeting</span></td></tr></table>
<table class="log-line" id="l-2"><tr class="log-row"><td class="log-lineno"><a href="#l-2">&nbsp;&nbsp;2</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> stickies-v: Meeting started at 2025-05-14T17:00+0000</span></td></tr></table>
<table class="log-line" id="l-3"><tr class="log-row"><td class="log-lineno"><a href="#l-3">&nbsp;&nbsp;3</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> stickies-v: Current chairs: stickies-v</span></td></tr></table>
<table class="log-line" id="l-4"><tr class="log-row"><td class="log-lineno"><a href="#l-4">&nbsp;&nbsp;4</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> stickies-v: Useful commands: #action #info #idea #link #topic #motion #vote #close #endmeeting</span></td></tr></table>
<table class="log-line" id="l-5"><tr class="log-row"><td class="log-lineno"><a href="#l-5">&nbsp;&nbsp;5</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> stickies-v: See also: <a href="https://hcoop-meetbot.readthedocs.io/en/stable/" target="blank">https://hcoop-meetbot.readthedocs.io/en/stable/</a></span></td></tr></table>
<table class="log-line" id="l-6"><tr class="log-row"><td class="log-lineno"><a href="#l-6">&nbsp;&nbsp;6</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> stickies-v: Participants should now identify themselves with &#39;#here&#39; or with an alias like &#39;#here FirstLast&#39;</span></td></tr></table>
<table class="log-line" id="l-7"><tr class="log-row"><td class="log-lineno"><a href="#l-7">&nbsp;&nbsp;7</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> hey everyone, welcome to the review club!</span></td></tr></table>
<table class="log-line" id="l-8"><tr class="log-row"><td class="log-lineno"><a href="#l-8">&nbsp;&nbsp;8</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:salmon">&lt;stringintech&gt;</span><span class="log-msg"> Hi!</span></td></tr></table>
<table class="log-line" id="l-9"><tr class="log-row"><td class="log-lineno"><a href="#l-9">&nbsp;&nbsp;9</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:teal">&lt;brunoerg&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-10"><tr class="log-row"><td class="log-lineno"><a href="#l-10">&nbsp;10</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> Hi</span></td></tr></table>
<table class="log-line" id="l-11"><tr class="log-row"><td class="log-lineno"><a href="#l-11">&nbsp;11</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> hey</span></td></tr></table>
<table class="log-line" id="l-12"><tr class="log-row"><td class="log-lineno"><a href="#l-12">&nbsp;12</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> yo</span></td></tr></table>
<table class="log-line" id="l-13"><tr class="log-row"><td class="log-lineno"><a href="#l-13">&nbsp;13</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:tomato">&lt;JoaoLeal&gt;</span><span class="log-msg"> Hi</span></td></tr></table>
<table class="log-line" id="l-14"><tr class="log-row"><td class="log-lineno"><a href="#l-14">&nbsp;14</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> today we&#39;ll be covering <a href="https://bitcoincore.reviews/32317" target="blank">https://bitcoincore.reviews/32317</a>, titled &quot;Separate UTXO set access from validation functions&quot;</span></td></tr></table>
<table class="log-line" id="l-15"><tr class="log-row"><td class="log-lineno"><a href="#l-15">&nbsp;15</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:violet">&lt;enochazariah&gt;</span><span class="log-msg"> hello</span></td></tr></table>
<table class="log-line" id="l-16"><tr class="log-row"><td class="log-lineno"><a href="#l-16">&nbsp;16</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> woo!</span></td></tr></table>
<table class="log-line" id="l-17"><tr class="log-row"><td class="log-lineno"><a href="#l-17">&nbsp;17</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> is anyone here for the first time? feel free to say hi, even if you&#39;re just lurking</span></td></tr></table>
<table class="log-line" id="l-18"><tr class="log-row"><td class="log-lineno"><a href="#l-18">&nbsp;18</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> hello!</span></td></tr></table>
<table class="log-line" id="l-19"><tr class="log-row"><td class="log-lineno"><a href="#l-19">&nbsp;19</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> stickies-v: I haven&#39;t participated in a while. Ho hi :)</span></td></tr></table>
<table class="log-line" id="l-20"><tr class="log-row"><td class="log-lineno"><a href="#l-20">&nbsp;20</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> so*</span></td></tr></table>
<table class="log-line" id="l-21"><tr class="log-row"><td class="log-lineno"><a href="#l-21">&nbsp;21</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:brown">&lt;lightlike&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-22"><tr class="log-row"><td class="log-lineno"><a href="#l-22">&nbsp;22</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:goldenrod">&lt;pablomartin_&gt;</span><span class="log-msg"> hello</span></td></tr></table>
<table class="log-line" id="l-23"><tr class="log-row"><td class="log-lineno"><a href="#l-23">&nbsp;23</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> well, welcome back Davidson! are you the floresta davidson, by any chance?</span></td></tr></table>
<table class="log-line" id="l-24"><tr class="log-row"><td class="log-lineno"><a href="#l-24">&nbsp;24</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> Yeap, it&#39;s me</span></td></tr></table>
<table class="log-line" id="l-25"><tr class="log-row"><td class="log-lineno"><a href="#l-25">&nbsp;25</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> oh nice, we&#39;ve got kernel users, contributors, reviewers and enthusiasts all in one meeting!</span></td></tr></table>
<table class="log-line" id="l-26"><tr class="log-row"><td class="log-lineno"><a href="#l-26">&nbsp;26</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> (reviewing IS contributing, of course)</span></td></tr></table>
<table class="log-line" id="l-27"><tr class="log-row"><td class="log-lineno"><a href="#l-27">&nbsp;27</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> did anyone get the chance to review the notes and/or PR (y/n)?</span></td></tr></table>
<table class="log-line" id="l-28"><tr class="log-row"><td class="log-lineno"><a href="#l-28">&nbsp;28</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> y</span></td></tr></table>
<table class="log-line" id="l-29"><tr class="log-row"><td class="log-lineno"><a href="#l-29">&nbsp;29</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:salmon">&lt;stringintech&gt;</span><span class="log-msg"> y</span></td></tr></table>
<table class="log-line" id="l-30"><tr class="log-row"><td class="log-lineno"><a href="#l-30">&nbsp;30</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> y, checked out the notes and an initial code review of the PR</span></td></tr></table>
<table class="log-line" id="l-31"><tr class="log-row"><td class="log-lineno"><a href="#l-31">&nbsp;31</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:teal">&lt;brunoerg&gt;</span><span class="log-msg"> yes</span></td></tr></table>
<table class="log-line" id="l-32"><tr class="log-row"><td class="log-lineno"><a href="#l-32">&nbsp;32</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> yes</span></td></tr></table>
<table class="log-line" id="l-33"><tr class="log-row"><td class="log-lineno"><a href="#l-33">&nbsp;33</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:violet">&lt;enochazariah&gt;</span><span class="log-msg"> yes, checked the code out</span></td></tr></table>
<table class="log-line" id="l-34"><tr class="log-row"><td class="log-lineno"><a href="#l-34">&nbsp;34</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> y :D</span></td></tr></table>
<table class="log-line" id="l-35"><tr class="log-row"><td class="log-lineno"><a href="#l-35">&nbsp;35</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> oh my that&#39;s a lot of prep, excellent</span></td></tr></table>
<table class="log-line" id="l-36"><tr class="log-row"><td class="log-lineno"><a href="#l-36">&nbsp;36</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> let&#39;s dive right into the questions, we&#39;ll start off with the more conceptual ones and then progress into code questions. as always, review club is async so feel free to continue conversation on previous questions when we move on, or raise any other questions you have!</span></td></tr></table>
<table class="log-line" id="l-37"><tr class="log-row"><td class="log-lineno"><a href="#l-37">&nbsp;37</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> 2. Why is carving out the new SpendBlock() function from ConnectBlock() helpful for this PR? How would you compare the purpose of the two functions?</span></td></tr></table>
<table class="log-line" id="l-38"><tr class="log-row"><td class="log-lineno"><a href="#l-38">&nbsp;38</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> it will remove all UTXO set interactions from ConnectBlock which makes ConnectBlock much more modular. SpendBlock encapsulates all the UTXO interactions that are needed when connecting new block</span></td></tr></table>
<table class="log-line" id="l-39"><tr class="log-row"><td class="log-lineno"><a href="#l-39">&nbsp;39</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> carving it out is helpful because using ConnectBlock no longer requires the utxo set. So you can do a lot of block validation without a utxo set</span></td></tr></table>
<table class="log-line" id="l-40"><tr class="log-row"><td class="log-lineno"><a href="#l-40">&nbsp;40</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> Before this PR, ConnectBlock also looked utxos up, and therefore needed access to the utxo set. Now, the feching of utxos is defered to the new function. Making ConnectBlock work without access to the utxo set</span></td></tr></table>
<table class="log-line" id="l-41"><tr class="log-row"><td class="log-lineno"><a href="#l-41">&nbsp;41</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> right, not every full node implementation has a UTXO set, so only being able to connect a block by passing UTXO set as a parameter seems rather opinionated for how Core works</span></td></tr></table>
<table class="log-line" id="l-42"><tr class="log-row"><td class="log-lineno"><a href="#l-42">&nbsp;42</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> follow-up question: does the new ConnectBlock allow for stateless validation?</span></td></tr></table>
<table class="log-line" id="l-43"><tr class="log-row"><td class="log-lineno"><a href="#l-43">&nbsp;43</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> do you count blockundo as non-state? if that makes sense</span></td></tr></table>
<table class="log-line" id="l-44"><tr class="log-row"><td class="log-lineno"><a href="#l-44">&nbsp;44</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> yes..? what does stateless validation mean? not needing the statefulness of utxo set?</span></td></tr></table>
<table class="log-line" id="l-45"><tr class="log-row"><td class="log-lineno"><a href="#l-45">&nbsp;45</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> i guess the new Connectblock would still requite some state then?</span></td></tr></table>
<table class="log-line" id="l-46"><tr class="log-row"><td class="log-lineno"><a href="#l-46">&nbsp;46</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> but it&#39;s prevalidated by SpendBlock</span></td></tr></table>
<table class="log-line" id="l-47"><tr class="log-row"><td class="log-lineno"><a href="#l-47">&nbsp;47</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> blockundo is a ConnectBlock parameter, so that does not count as state</span></td></tr></table>
<table class="log-line" id="l-48"><tr class="log-row"><td class="log-lineno"><a href="#l-48">&nbsp;48</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:salmon">&lt;stringintech&gt;</span><span class="log-msg"> I guess using the fJustCheck as true could do this for us?</span></td></tr></table>
<table class="log-line" id="l-49"><tr class="log-row"><td class="log-lineno"><a href="#l-49">&nbsp;49</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> I would say no. Because it still uses a ref to the block tree index.</span></td></tr></table>
<table class="log-line" id="l-50"><tr class="log-row"><td class="log-lineno"><a href="#l-50">&nbsp;50</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> ah ok, so stateless validation would be any state that is not passed in by parameters?</span></td></tr></table>
<table class="log-line" id="l-51"><tr class="log-row"><td class="log-lineno"><a href="#l-51">&nbsp;51</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> what I&#39;m trying to get at is: if someone has a serialized block, and they want to check if it&#39;s valid, can they validate it with a function (similar to) ConnectBlock?</span></td></tr></table>
<table class="log-line" id="l-52"><tr class="log-row"><td class="log-lineno"><a href="#l-52">&nbsp;52</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> so state in this case would be from the Chainstate instance of which ConnectBlock is a method</span></td></tr></table>
<table class="log-line" id="l-53"><tr class="log-row"><td class="log-lineno"><a href="#l-53">&nbsp;53</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> there is still extra state require, for example they still need the deployment bits</span></td></tr></table>
<table class="log-line" id="l-54"><tr class="log-row"><td class="log-lineno"><a href="#l-54">&nbsp;54</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> those pesky deployment bits</span></td></tr></table>
<table class="log-line" id="l-55"><tr class="log-row"><td class="log-lineno"><a href="#l-55">&nbsp;55</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> Davidson: yeah ConnectBlock has side-effects (as clearly implied by the name too) in that it e.g. updates the chainstate, and the block index</span></td></tr></table>
<table class="log-line" id="l-56"><tr class="log-row"><td class="log-lineno"><a href="#l-56">&nbsp;56</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> i thought SpendBlock updates the chainstate?</span></td></tr></table>
<table class="log-line" id="l-57"><tr class="log-row"><td class="log-lineno"><a href="#l-57">&nbsp;57</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> unless i&#39;m mistaking what the chainstate is here...</span></td></tr></table>
<table class="log-line" id="l-58"><tr class="log-row"><td class="log-lineno"><a href="#l-58">&nbsp;58</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> oh sorry yes that&#39;s confusing naming 🙈</span></td></tr></table>
<table class="log-line" id="l-59"><tr class="log-row"><td class="log-lineno"><a href="#l-59">&nbsp;59</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> I guess you meant members of the Chainstate class?</span></td></tr></table>
<table class="log-line" id="l-60"><tr class="log-row"><td class="log-lineno"><a href="#l-60">&nbsp;60</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> i was thinking about connecting the block to the chaintip (i.e. state of the Chain) but now i&#39;m not actually sure if that&#39;s ahppening in ConnectBlock</span></td></tr></table>
<table class="log-line" id="l-61"><tr class="log-row"><td class="log-lineno"><a href="#l-61">&nbsp;61</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> you&#39;re right marcofleon that ConnectBlock does not update the UTXO set, commonly called the chainstate</span></td></tr></table>
<table class="log-line" id="l-62"><tr class="log-row"><td class="log-lineno"><a href="#l-62">&nbsp;62</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> ah, yes, that is moved out of ConnectBlock in the commit &quot;    validation: Move SetBestBlock out of ConnectBlocky</span></td></tr></table>
<table class="log-line" id="l-63"><tr class="log-row"><td class="log-lineno"><a href="#l-63">&nbsp;63</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> ah right!</span></td></tr></table>
<table class="log-line" id="l-64"><tr class="log-row"><td class="log-lineno"><a href="#l-64">&nbsp;64</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> 3. 3. Do you see another benefit of this decoupling, besides allowing kernel usage without a UTXO set?</span></td></tr></table>
<table class="log-line" id="l-65"><tr class="log-row"><td class="log-lineno"><a href="#l-65">&nbsp;65</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> maybe easier testing</span></td></tr></table>
<table class="log-line" id="l-66"><tr class="log-row"><td class="log-lineno"><a href="#l-66">&nbsp;66</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> I would say it&#39;s cleaner. Since you have a clear separation of concerns</span></td></tr></table>
<table class="log-line" id="l-67"><tr class="log-row"><td class="log-lineno"><a href="#l-67">&nbsp;67</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:violet">&lt;enochazariah&gt;</span><span class="log-msg"> i see modularity as another benefit of decoupling</span></td></tr></table>
<table class="log-line" id="l-68"><tr class="log-row"><td class="log-lineno"><a href="#l-68">&nbsp;68</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> by splitting up parts of validation into separate functions</span></td></tr></table>
<table class="log-line" id="l-69"><tr class="log-row"><td class="log-lineno"><a href="#l-69">&nbsp;69</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> yeah improved testability was the main benefit i was thinking of, reusability/modularity might be a win too even though the potential there is probably a bit more limited since there&#39;s only so many places these functions can be used</span></td></tr></table>
<table class="log-line" id="l-70"><tr class="log-row"><td class="log-lineno"><a href="#l-70">&nbsp;70</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> it also helps with code maintainability as there is separation of concerns</span></td></tr></table>
<table class="log-line" id="l-71"><tr class="log-row"><td class="log-lineno"><a href="#l-71">&nbsp;71</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> anything else?</span></td></tr></table>
<table class="log-line" id="l-72"><tr class="log-row"><td class="log-lineno"><a href="#l-72">&nbsp;72</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> Makes it easier to validate blocks in parallel (e.g. swift-sync)</span></td></tr></table>
<table class="log-line" id="l-73"><tr class="log-row"><td class="log-lineno"><a href="#l-73">&nbsp;73</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> yes! but isn&#39;t that a direct effect of the &quot;allowing kernel usage without a UTXO set&quot; bit?</span></td></tr></table>
<table class="log-line" id="l-74"><tr class="log-row"><td class="log-lineno"><a href="#l-74">&nbsp;74</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> yeah, I think so</span></td></tr></table>
<table class="log-line" id="l-75"><tr class="log-row"><td class="log-lineno"><a href="#l-75">&nbsp;75</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> TheCharlatan observed a few other minor improvements:</span></td></tr></table>
<table class="log-line" id="l-76"><tr class="log-row"><td class="log-lineno"><a href="#l-76">&nbsp;76</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> reducing the amount of UTXO set lookups (by just doing it once at the beginning) can have minimal performance improvements</span></td></tr></table>
<table class="log-line" id="l-77"><tr class="log-row"><td class="log-lineno"><a href="#l-77">&nbsp;77</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> and then from a maintainability / code clarity perspective: explicitly passing objects (coins) through a callstack is easier to reason about and has less thread safety issues etc than having each frame do its own map lookup</span></td></tr></table>
<table class="log-line" id="l-78"><tr class="log-row"><td class="log-lineno"><a href="#l-78">&nbsp;78</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> 4. Especially during IBD, transaction validation must be fast. Are there any changes where you have concerns about performance?</span></td></tr></table>
<table class="log-line" id="l-79"><tr class="log-row"><td class="log-lineno"><a href="#l-79">&nbsp;79</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> maybe iterating over the txs in the block twice now? doesn&#39;t seem like a big deal though</span></td></tr></table>
<table class="log-line" id="l-80"><tr class="log-row"><td class="log-lineno"><a href="#l-80">&nbsp;80</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> Or if you don&#39;t have any concerns: Which measures can you identify this PR has adopted to minimize the performance impact of this refactor?</span></td></tr></table>
<table class="log-line" id="l-81"><tr class="log-row"><td class="log-lineno"><a href="#l-81">&nbsp;81</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> there are a few additional vector allocations, where instead of retrieving elements one-by-one, references to elements are filled into a vector and then passed by spans.</span></td></tr></table>
<table class="log-line" id="l-82"><tr class="log-row"><td class="log-lineno"><a href="#l-82">&nbsp;82</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> I didn&#39;t see anything extraordinary. Maybe use a little bit more memory?</span></td></tr></table>
<table class="log-line" id="l-83"><tr class="log-row"><td class="log-lineno"><a href="#l-83">&nbsp;83</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> TheCharlatan: oh you were faster than me :D</span></td></tr></table>
<table class="log-line" id="l-84"><tr class="log-row"><td class="log-lineno"><a href="#l-84">&nbsp;84</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> heh :D</span></td></tr></table>
<table class="log-line" id="l-85"><tr class="log-row"><td class="log-lineno"><a href="#l-85">&nbsp;85</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> yeah vector allocations was the main thing I could see too. This PR relies quite heavily on passing references rather than copying, so the overhead there should be quite minimal</span></td></tr></table>
<table class="log-line" id="l-86"><tr class="log-row"><td class="log-lineno"><a href="#l-86">&nbsp;86</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> of course, these references can introduce lifetime risks, so that might be something to consider in your review</span></td></tr></table>
<table class="log-line" id="l-87"><tr class="log-row"><td class="log-lineno"><a href="#l-87">&nbsp;87</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:brown">&lt;lightlike&gt;</span><span class="log-msg"> not so important for the question, but I don&#39;t agree with the &quot;especially&quot; in the question : In my opinion, validation / block propagation being fast is much more important at the tip than during IBD, which is a one-time thing.</span></td></tr></table>
<table class="log-line" id="l-88"><tr class="log-row"><td class="log-lineno"><a href="#l-88">&nbsp;88</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> stickies-v: I assume buildinga spam&lt;T&gt; from a vector&lt;T&gt; is almost free? (Rust bro here :D )</span></td></tr></table>
<table class="log-line" id="l-89"><tr class="log-row"><td class="log-lineno"><a href="#l-89">&nbsp;89</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> lightlike: oh, interesting! yeah, i agree that at the tip performance is also crucial, and it&#39;s maybe a bit meaningless to compare which is more important - could have phrased that better, sorry!</span></td></tr></table>
<table class="log-line" id="l-90"><tr class="log-row"><td class="log-lineno"><a href="#l-90">&nbsp;90</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> I did have  a question about why we pass block_hash as a parameter to ConnectBlock when block.GetHash() is still called when asserting Assume(block.GetHash() == block_hash)</span></td></tr></table>
<table class="log-line" id="l-91"><tr class="log-row"><td class="log-lineno"><a href="#l-91">&nbsp;91</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> Davidson: yes, I&#39;m not enough of a C++ expert to give you the sound answer, but my understanding is that a span allows to iterate over the container with almost no overhead, like a view</span></td></tr></table>
<table class="log-line" id="l-92"><tr class="log-row"><td class="log-lineno"><a href="#l-92">&nbsp;92</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> monlovesmango: I believe this is the topic for question number 5, no?</span></td></tr></table>
<table class="log-line" id="l-93"><tr class="log-row"><td class="log-lineno"><a href="#l-93">&nbsp;93</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> it is indeed!</span></td></tr></table>
<table class="log-line" id="l-94"><tr class="log-row"><td class="log-lineno"><a href="#l-94">&nbsp;94</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> stickies-v: nice, so it&#39;s basically one vec allocation per block with this block&#39;s coins. And then we pass refs to that vec</span></td></tr></table>
<table class="log-line" id="l-95"><tr class="log-row"><td class="log-lineno"><a href="#l-95">&nbsp;95</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> is block_hash just sort of used as sanity check in those Spendblock assertions?</span></td></tr></table>
<table class="log-line" id="l-96"><tr class="log-row"><td class="log-lineno"><a href="#l-96">&nbsp;96</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> marcofleon: yes :)</span></td></tr></table>
<table class="log-line" id="l-97"><tr class="log-row"><td class="log-lineno"><a href="#l-97">&nbsp;97</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> 5. `SpendBlock()` takes a `CBlock block`, `CBlockIndex pindex` and `uint256 block_hash` parameter, all referencing the block being spent. Why do we need 3 parameters to do that?</span></td></tr></table>
<table class="log-line" id="l-98"><tr class="log-row"><td class="log-lineno"><a href="#l-98">&nbsp;98</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> Davidson: haha oops</span></td></tr></table>
<table class="log-line" id="l-99"><tr class="log-row"><td class="log-lineno"><a href="#l-99">&nbsp;99</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> the CBlock contains the actual txs that are used to check against and update the utxo set so gotta have that</span></td></tr></table>
<table class="log-line" id="l-100"><tr class="log-row"><td class="log-lineno"><a href="#l-100">100</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> So, mostly sanity check...? I&#39;ve seen that the pindex arg also gets used to figure out if our ChainState represents the previous block&#39;s state, so we need this one</span></td></tr></table>
<table class="log-line" id="l-101"><tr class="log-row"><td class="log-lineno"><a href="#l-101">101</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> monlovesmango: `Assume` statements are only compiled into debug builds, so this check should not incur any overhead on non-debug builds</span></td></tr></table>
<table class="log-line" id="l-102"><tr class="log-row"><td class="log-lineno"><a href="#l-102">102</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> otherwise, indeed it would be a bit silly to pass `block_hash` as a performance optimization. good spot!</span></td></tr></table>
<table class="log-line" id="l-103"><tr class="log-row"><td class="log-lineno"><a href="#l-103">103</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> I assumed the block_hash parameter was for performance reasons, so that we don&#39;t have to re-hash</span></td></tr></table>
<table class="log-line" id="l-104"><tr class="log-row"><td class="log-lineno"><a href="#l-104">104</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> stickies-v: ok!! that makes a lot more sense :)</span></td></tr></table>
<table class="log-line" id="l-105"><tr class="log-row"><td class="log-lineno"><a href="#l-105">105</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> also good to know that about `Assume` statements</span></td></tr></table>
<table class="log-line" id="l-106"><tr class="log-row"><td class="log-lineno"><a href="#l-106">106</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> pindex also used for the height to cehck against bip30 stuff</span></td></tr></table>
<table class="log-line" id="l-107"><tr class="log-row"><td class="log-lineno"><a href="#l-107">107</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> and for UpdateCoins</span></td></tr></table>
<table class="log-line" id="l-108"><tr class="log-row"><td class="log-lineno"><a href="#l-108">108</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> isn&#39;t bip30 stuff now in SpendBlock?</span></td></tr></table>
<table class="log-line" id="l-109"><tr class="log-row"><td class="log-lineno"><a href="#l-109">109</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> monlovesmango: yes, the question is about `SpendBlock`</span></td></tr></table>
<table class="log-line" id="l-110"><tr class="log-row"><td class="log-lineno"><a href="#l-110">110</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> omg ignore sorry..</span></td></tr></table>
<table class="log-line" id="l-111"><tr class="log-row"><td class="log-lineno"><a href="#l-111">111</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> &quot;bip30 stuff&quot; is my best summarizing of that whole chunk of code/text</span></td></tr></table>
<table class="log-line" id="l-112"><tr class="log-row"><td class="log-lineno"><a href="#l-112">112</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> but why do we need to pass `pindex`? Can&#39;t it be retrieved from `block`?</span></td></tr></table>
<table class="log-line" id="l-113"><tr class="log-row"><td class="log-lineno"><a href="#l-113">113</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> (and if it can, should it?)</span></td></tr></table>
<table class="log-line" id="l-114"><tr class="log-row"><td class="log-lineno"><a href="#l-114">114</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> You mean the prevblock? I think it&#39;s better to get the prevblock straight from pindex to make sure we actually building on tip?</span></td></tr></table>
<table class="log-line" id="l-115"><tr class="log-row"><td class="log-lineno"><a href="#l-115">115</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> We&#39;re almost at time, so gonna launch the next/last question already</span></td></tr></table>
<table class="log-line" id="l-116"><tr class="log-row"><td class="log-lineno"><a href="#l-116">116</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> 7. The first commits in this PR refactor `CCoinsViewCache` out of the function signature of a couple of validation functions. Does `CCoinsViewCache` hold the entire UTXO set? Why is that (not) a problem? Does this PR change that behaviour?</span></td></tr></table>
<table class="log-line" id="l-117"><tr class="log-row"><td class="log-lineno"><a href="#l-117">117</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:salmon">&lt;stringintech&gt;</span><span class="log-msg"> I guess we need another disk access for that which is not good to do? (previous question)</span></td></tr></table>
<table class="log-line" id="l-118"><tr class="log-row"><td class="log-lineno"><a href="#l-118">118</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> Davidson: no, I mean dropping the `pindex` argument from the `SpendBlock` fn signature, and just letting `SpendBlock` get a `CBlockIndex` from `block`</span></td></tr></table>
<table class="log-line" id="l-119"><tr class="log-row"><td class="log-lineno"><a href="#l-119">119</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> stringintech: I don&#39;t think we need disk access for that, the entire block index (`BlockManager::m_block_index`) is kept in-memory, it is relatively small</span></td></tr></table>
<table class="log-line" id="l-120"><tr class="log-row"><td class="log-lineno"><a href="#l-120">120</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> Davidson, that is a good reason, but we could also assert that beforehand. Other than that, looking up the block index with a block&#39;s hash does incur bit of a performance penalty.</span></td></tr></table>
<table class="log-line" id="l-121"><tr class="log-row"><td class="log-lineno"><a href="#l-121">121</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:salmon">&lt;stringintech&gt;</span><span class="log-msg"> stickies-v: oh!! thanks.</span></td></tr></table>
<table class="log-line" id="l-122"><tr class="log-row"><td class="log-lineno"><a href="#l-122">122</a></td><td class="log-time">18:02 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> TheCharlatan: sure, it&#39;s a lookup, but it&#39;s a map - do you think that&#39;s going to be measurable?</span></td></tr></table>
<table class="log-line" id="l-123"><tr class="log-row"><td class="log-lineno"><a href="#l-123">123</a></td><td class="log-time">18:04 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> I doubt it would be. I think I implemented it that way more because we already have it available at its call sites.</span></td></tr></table>
<table class="log-line" id="l-124"><tr class="log-row"><td class="log-lineno"><a href="#l-124">124</a></td><td class="log-time">18:04 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> stickies-v: Oh, I didn&#39;t know you could do that :&#39;)</span></td></tr></table>
<table class="log-line" id="l-125"><tr class="log-row"><td class="log-lineno"><a href="#l-125">125</a></td><td class="log-time">18:04 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> anyway, we&#39;re past end time for today, so I&#39;m going to wrap it up here, but as always feel free to share thoughts or follow-up questions - i&#39;ll be around for a while longer!</span></td></tr></table>
<table class="log-line" id="l-126"><tr class="log-row"><td class="log-lineno"><a href="#l-126">126</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> thanks for joining the discussion today everyone, and thanks TheCharlatan for authoring the PR!</span></td></tr></table>
<table class="log-line" id="l-127"><tr class="log-row"><td class="log-lineno"><a href="#l-127">127</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> yeah wait how are we getting a CBlockindex from a CBlock?</span></td></tr></table>
<table class="log-line" id="l-128"><tr class="log-row"><td class="log-lineno"><a href="#l-128">128</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> #endmeeting</span></td></tr></table>
<table class="log-line" id="l-129"><tr class="log-row"><td class="log-lineno"><a href="#l-129">129</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> stickies-v: Meeting ended at 2025-05-14T18:05+0000</span></td></tr></table>
<table class="log-line" id="l-130"><tr class="log-row"><td class="log-lineno"><a href="#l-130">130</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> stickies-v: Raw log: <a href="https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-05-14_17_00.log.json" target="blank">https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-05-14_17_00.log.json</a></span></td></tr></table>
<table class="log-line" id="l-131"><tr class="log-row"><td class="log-lineno"><a href="#l-131">131</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> stickies-v: Formatted log: <a href="https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-05-14_17_00.log.html" target="blank">https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-05-14_17_00.log.html</a></span></td></tr></table>
<table class="log-line" id="l-132"><tr class="log-row"><td class="log-lineno"><a href="#l-132">132</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> stickies-v: Minutes: <a href="https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-05-14_17_00.html" target="blank">https://achow101.com/ircmeetings/2025/bitcoin-core-pr-reviews.2025-05-14_17_00.html</a></span></td></tr></table>
<table class="log-line" id="l-133"><tr class="log-row"><td class="log-lineno"><a href="#l-133">133</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> just by getting the hash and then looking it up?</span></td></tr></table>
<table class="log-line" id="l-134"><tr class="log-row"><td class="log-lineno"><a href="#l-134">134</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> yes </span></td></tr></table>
<table class="log-line" id="l-135"><tr class="log-row"><td class="log-lineno"><a href="#l-135">135</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> yeah, `BlockManager::m_block_index` is an unordered_map keyed by block hash</span></td></tr></table>
<table class="log-line" id="l-136"><tr class="log-row"><td class="log-lineno"><a href="#l-136">136</a></td><td class="log-time">18:05 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> thanks for hosting stickies-v!</span></td></tr></table>
<table class="log-line" id="l-137"><tr class="log-row"><td class="log-lineno"><a href="#l-137">137</a></td><td class="log-time">18:06 </td><td><span class="log-nick" style="color:magenta">&lt;Davidson&gt;</span><span class="log-msg"> thanks everyone!</span></td></tr></table>
<table class="log-line" id="l-138"><tr class="log-row"><td class="log-lineno"><a href="#l-138">138</a></td><td class="log-time">18:06 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> got it, thanks</span></td></tr></table>
<table class="log-line" id="l-139"><tr class="log-row"><td class="log-lineno"><a href="#l-139">139</a></td><td class="log-time">18:06 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> thanks stickies and Charlatan!</span></td></tr></table>
<table class="log-line" id="l-140"><tr class="log-row"><td class="log-lineno"><a href="#l-140">140</a></td><td class="log-time">18:06 </td><td><span class="log-nick" style="color:salmon">&lt;stringintech&gt;</span><span class="log-msg"> Thank you everyone</span></td></tr></table>
<table class="log-line" id="l-141"><tr class="log-row"><td class="log-lineno"><a href="#l-141">141</a></td><td class="log-time">18:07 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> thanks for hosting stickies-v and TheCharlatan !!</span></td></tr></table>
<table class="log-line" id="l-142"><tr class="log-row"><td class="log-lineno"><a href="#l-142">142</a></td><td class="log-time">18:07 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> this question: CCoinsViewCache has two methods AccessCoin() and GetCoin() that both return a Coin-like type. What is the difference between both methods, and when should which be used?</span></td></tr></table>
<table class="log-line" id="l-143"><tr class="log-row"><td class="log-lineno"><a href="#l-143">143</a></td><td class="log-time">18:07 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> I&#39;d like to know when they should be used?</span></td></tr></table>
<table class="log-line" id="l-144"><tr class="log-row"><td class="log-lineno"><a href="#l-144">144</a></td><td class="log-time">18:08 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> I can see the differences in return value</span></td></tr></table>
<table class="log-line" id="l-145"><tr class="log-row"><td class="log-lineno"><a href="#l-145">145</a></td><td class="log-time">18:08 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> and what happens if the coin isn&#39;t found or not spent</span></td></tr></table>
<table class="log-line" id="l-146"><tr class="log-row"><td class="log-lineno"><a href="#l-146">146</a></td><td class="log-time">18:10 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> yeah there are 2 main differences between those 2 functions:</span></td></tr></table>
<table class="log-line" id="l-147"><tr class="log-row"><td class="log-lineno"><a href="#l-147">147</a></td><td class="log-time">18:11 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> I guess if you&#39;re not gonna modify the coin or store it, use Access?</span></td></tr></table>
<table class="log-line" id="l-148"><tr class="log-row"><td class="log-lineno"><a href="#l-148">148</a></td><td class="log-time">18:11 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> `GetCoin` ensures it only returns a `Coin` if it&#39;s not spent, whereas `AccessCoin` does not do that</span></td></tr></table>
<table class="log-line" id="l-149"><tr class="log-row"><td class="log-lineno"><a href="#l-149">149</a></td><td class="log-time">18:11 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> second: `GetCoin` returns a copy, whereas `AccessCoin` returns a reference to the `Coin` in `cacheCoins`</span></td></tr></table>
<table class="log-line" id="l-150"><tr class="log-row"><td class="log-lineno"><a href="#l-150">150</a></td><td class="log-time">18:12 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> so `AccessCoin` is naturally going to be more performant, but at the cost of introducing lifetime risk, you can end up with a dangling reference if you&#39;re not careful</span></td></tr></table>
<table class="log-line" id="l-151"><tr class="log-row"><td class="log-lineno"><a href="#l-151">151</a></td><td class="log-time">18:13 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> neither is going to allow you to modify the coin, `AccessCoin` returns a `const` reference</span></td></tr></table>
<table class="log-line" id="l-152"><tr class="log-row"><td class="log-lineno"><a href="#l-152">152</a></td><td class="log-time">18:13 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> yes, their lifetime is only valid for as long as the cache is not mutated in between, so you should not use it if you plan on doing any other calls to the coins in between.</span></td></tr></table>
<table class="log-line" id="l-153"><tr class="log-row"><td class="log-lineno"><a href="#l-153">153</a></td><td class="log-time">18:14 </td><td><span class="log-nick" style="color:steelblue">&lt;monlovesmango&gt;</span><span class="log-msg"> marcofleon: thanks for asking that I was also interested in that answer</span></td></tr></table>
<table class="log-line" id="l-154"><tr class="log-row"><td class="log-lineno"><a href="#l-154">154</a></td><td class="log-time">18:15 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> perfect, yeah I see it now. thanks for going through that</span></td></tr></table>
<table class="log-line" id="l-155"><tr class="log-row"><td class="log-lineno"><a href="#l-155">155</a></td><td class="log-time">18:15 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> monlovesmango: no problem :) it was a good question, had to know</span></td></tr></table>
<table class="log-line" id="l-156"><tr class="log-row"><td class="log-lineno"><a href="#l-156">156</a></td><td class="log-time">18:15 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> TheCharlatan: I think for unordered_map the references should remain valid as long as not that specific member is erased, though</span></td></tr></table>
<table class="log-line" id="l-157"><tr class="log-row"><td class="log-lineno"><a href="#l-157">157</a></td><td class="log-time">18:16 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> &quot;References and pointers to either key or data stored in the container are only invalidated by erasing that element, even when the corresponding iterator is invalidated.&quot; from <a href="https://en.cppreference.com/w/cpp/container/unordered_map" target="blank">https://en.cppreference.com/w/cpp/container/unordered_map</a></span></td></tr></table>
<table class="log-line" id="l-158"><tr class="log-row"><td class="log-lineno"><a href="#l-158">158</a></td><td class="log-time">18:18 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> Mmh, right. I guess we could be erasing though when we spend, right?</span></td></tr></table>
<table class="log-line" id="l-159"><tr class="log-row"><td class="log-lineno"><a href="#l-159">159</a></td><td class="log-time">18:18 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> yeah, i think so</span></td></tr></table>
<table class="log-line" id="l-160"><tr class="log-row"><td class="log-lineno"><a href="#l-160">160</a></td><td class="log-time">18:20 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> and i actually had a question on the `IsSpent` check in `GetCoin` - I think in normal operation that should always be false except for when we haven&#39;t flushed yet, right?</span></td></tr></table>
<table class="log-line" id="l-161"><tr class="log-row"><td class="log-lineno"><a href="#l-161">161</a></td><td class="log-time">18:22 </td><td><span class="log-nick" style="color:darkcyan">&lt;TheCharlatan&gt;</span><span class="log-msg"> mmh, good question, I&#39;ll have to check again</span></td></tr></table>
<table class="log-line" id="l-162"><tr class="log-row"><td class="log-lineno"><a href="#l-162">162</a></td><td class="log-time">18:52 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> TheCharlatan: little nit,  but the name ConnectBlock doesn&#39;t match what it&#39;s doing in the PR. I think it just does validation now (minus utxo set check)</span></td></tr></table>
<table class="log-line" id="l-163"><tr class="log-row"><td class="log-lineno"><a href="#l-163">163</a></td><td class="log-time">18:52 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> especially because setbestblock got moved as well</span></td></tr></table>
<table class="log-line" id="l-164"><tr class="log-row"><td class="log-lineno"><a href="#l-164">164</a></td><td class="log-time">18:53 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;marcofleon&gt;</span><span class="log-msg"> maybe i&#39;ll come up with a briliant new function name tomorrow. I&#39;ll keep you posted</span></td></tr></table>
<table class="log-line" id="l-165"><tr class="log-row"><td class="log-lineno"><a href="#l-165">165</a></td><td class="log-time">18:59 </td><td><span class="log-nick" style="color:slateblue">&lt;stickies-v&gt;</span><span class="log-msg"> it doesn&#39;t just do validation though, it also updates the block index (bumping validity)</span></td></tr></table>]]></content><author><name>TheCharlatan</name></author><summary type="html"><![CDATA[Notes]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bitcoincore.reviews/assets/img/twitter_card.png" /><media:content medium="image" url="https://bitcoincore.reviews/assets/img/twitter_card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Add bitcoin wrapper executable</title><link href="https://bitcoincore.reviews/31375" rel="alternate" type="text/html" title="Add bitcoin wrapper executable" /><published>2025-05-07T00:00:00+00:00</published><updated>2025-05-07T00:00:00+00:00</updated><id>https://bitcoincore.reviews/#31375</id><content type="html" xml:base="https://bitcoincore.reviews/31375"><![CDATA[<h2 id="notes">Notes</h2>

<h3 id="motivation--context">Motivation &amp; context</h3>
<ul>
  <li>For years Bitcoin Core has shipped <strong>five</strong> separate user‑facing binaries.
The upcoming <em>multiprocess</em> work would add at least two more (<code class="language-plaintext highlighter-rouge">bitcoin‑node</code>,
<code class="language-plaintext highlighter-rouge">bitcoin‑gui</code>). Reviewers feared an explosion of filenames
and user <a href="https://github.com/bitcoin/bitcoin/issues/31827">confusion</a>.</li>
  <li>
    <p>The PR introduces a <strong>single command‑line front‑end</strong> called <strong><code class="language-plaintext highlighter-rouge">bitcoin</code></strong>
that does <em>no</em> consensus or wallet work itself – it simply chooses and
<code class="language-plaintext highlighter-rouge">exec()</code>’s the appropriate helper binary:</p>

    <table>
      <thead>
        <tr>
          <th><code class="language-plaintext highlighter-rouge">bitcoin</code> sub‑command</th>
          <th>Traditional binary</th>
          <th>Multiprocess binary (<code class="language-plaintext highlighter-rouge">-m</code>)</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><code class="language-plaintext highlighter-rouge">bitcoin gui …</code></td>
          <td><code class="language-plaintext highlighter-rouge">bitcoin‑qt</code></td>
          <td><code class="language-plaintext highlighter-rouge">bitcoin‑gui</code></td>
        </tr>
        <tr>
          <td><code class="language-plaintext highlighter-rouge">bitcoin daemon …</code></td>
          <td><code class="language-plaintext highlighter-rouge">bitcoind</code></td>
          <td><code class="language-plaintext highlighter-rouge">bitcoin‑node</code></td>
        </tr>
        <tr>
          <td><code class="language-plaintext highlighter-rouge">bitcoin rpc …</code></td>
          <td><code class="language-plaintext highlighter-rouge">bitcoin‑cli -named …</code></td>
          <td><code class="language-plaintext highlighter-rouge">bitcoin‑cli -named …</code></td>
        </tr>
        <tr>
          <td><code class="language-plaintext highlighter-rouge">bitcoin wallet …</code></td>
          <td><code class="language-plaintext highlighter-rouge">bitcoin‑wallet</code></td>
          <td><code class="language-plaintext highlighter-rouge">bitcoin-wallet</code></td>
        </tr>
        <tr>
          <td><code class="language-plaintext highlighter-rouge">bitcoin tx …</code></td>
          <td><code class="language-plaintext highlighter-rouge">bitcoin‑tx</code></td>
          <td><code class="language-plaintext highlighter-rouge">bitcoin-tx</code></td>
        </tr>
      </tbody>
    </table>

    <p>The <code class="language-plaintext highlighter-rouge">bitcoin</code> wrapper therefore accomplishes the “side‑binaries + unified entry point”
idea discussed in <a href="https://github.com/bitcoin/bitcoin/issues/30983">issue #30983</a>.</p>
  </li>
</ul>

<h3 id="new-util-helpers">New util helpers</h3>
<ul>
  <li><strong><code class="language-plaintext highlighter-rouge">util::ExecVp()</code></strong> – thin, cross‑platform <code class="language-plaintext highlighter-rouge">execvp</code> replacement.
    <ul>
      <li>POSIX: directly forwards to <code class="language-plaintext highlighter-rouge">execvp</code>.</li>
      <li>Windows: builds a <em>quoted &amp; escaped</em> command line that
<code class="language-plaintext highlighter-rouge">CommandLineToArgvW</code> in the child process will parse identically to POSIX
argv rules.</li>
      <li>Escaping rules follow the MSVCRT specification: backslashes are doubled only
when they precede a quote, and every internal quote is back‑slash‑escaped.</li>
    </ul>
  </li>
  <li><strong><code class="language-plaintext highlighter-rouge">util::GetExePath()</code></strong> – attempts to resolve <code class="language-plaintext highlighter-rouge">argv[0]</code> into the executable
file path.
    <ul>
      <li>On <em>Unix</em>: uses either the literal <code class="language-plaintext highlighter-rouge">argv[0]</code> (if it contains a slash) <strong>or</strong>
searches each element of <code class="language-plaintext highlighter-rouge">$PATH</code> until a regular file is found.</li>
      <li>On Windows: uses <code class="language-plaintext highlighter-rouge">GetModuleFileNameW(nullptr, …)</code>.</li>
    </ul>
  </li>
</ul>

<h3 id="wrapper-lookup-logic-execcommand">Wrapper lookup logic (<code class="language-plaintext highlighter-rouge">ExecCommand</code>)</h3>
<ol>
  <li>Determine the directory of the wrapper itself (resolves symlinks).</li>
  <li>Try possible candidate paths for the target binary, in descending priority:
    <ul>
      <li><em>libexec dir</em> – <code class="language-plaintext highlighter-rouge">${prefix}/libexec/&lt;target&gt;</code> if wrapper is in <code class="language-plaintext highlighter-rouge">${prefix}/bin/</code></li>
      <li>Windows installer “daemon” sub‑dir <code class="language-plaintext highlighter-rouge">${wrapper_dir}/daemon/&lt;target&gt;</code></li>
      <li><em>Sibling</em> – <code class="language-plaintext highlighter-rouge">${wrapper_dir}/&lt;target&gt;</code></li>
      <li>Finally, rely on the <strong>system PATH</strong> <em>only</em> if the wrapper itself was
invoked via PATH search (mitigates accidentally running an old system
<code class="language-plaintext highlighter-rouge">bitcoind</code> while testing a local build).</li>
    </ul>
  </li>
  <li>Call <code class="language-plaintext highlighter-rouge">util::ExecVp()</code> with each candidate, moving onto the next candidate
if it returns <code class="language-plaintext highlighter-rouge">ENOENT</code> (“No such file or directory”) and raising an exception
if a different error is returned or if there is no next candidate.</li>
</ol>

<h3 id="buildsystem--test-changes">Build‑system &amp; test changes</h3>
<ul>
  <li>CMake option <strong><code class="language-plaintext highlighter-rouge">BUILD_BITCOIN_BIN</code></strong> (ON by default) builds/installs the
wrapper.</li>
  <li>Functional test framework understands <code class="language-plaintext highlighter-rouge">BITCOIN_CMD="bitcoin -m"</code> so the
entire suite can be driven through the new CLI.</li>
  <li>CI jobs for the multiprocess build now export that variable.</li>
  <li>Static‑analysis suppression: the wrapper intentionally contains <em>no</em> FORTIFY
functions; <code class="language-plaintext highlighter-rouge">security-check.py</code> is taught to ignore it.</li>
</ul>

<h3 id="documentation-updates">Documentation updates</h3>
<p>Numerous docs now mention that <code class="language-plaintext highlighter-rouge">bitcoin rpc</code>, <code class="language-plaintext highlighter-rouge">bitcoin daemon</code>, etc. are
synonyms for the traditional commands, improving discoverability for new
users while remaining fully backwards‑compatible.</p>

<hr />

<h2 id="questions">Questions</h2>

<ol>
  <li>
    <p>Did you review the PR? <a href="https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#peer-review">Concept ACK, approach ACK, tested ACK, or NACK</a>? What was your review approach?</p>
  </li>
  <li>
    <p><strong>Review approach</strong> – did you test the wrapper?  Did you try both
monolithic (<code class="language-plaintext highlighter-rouge">bitcoin daemon</code>) and multiprocess (<code class="language-plaintext highlighter-rouge">bitcoin -m daemon</code>)
modes? (requires <code class="language-plaintext highlighter-rouge">-DENABLE_IPC=ON</code> cmake option). Attempt to
run one of the <code class="language-plaintext highlighter-rouge">strace</code> or <code class="language-plaintext highlighter-rouge">dtrace</code> tracing commands suggested in <code class="language-plaintext highlighter-rouge">bitcoin.cpp</code>?
Any cross‑platform checks?</p>
  </li>
  <li>
    <p>From <a href="https://github.com/bitcoin/bitcoin/issues/30983">issue #30983</a>, four
packaging strategies were listed.
<em>Which specific drawbacks of the</em> “side‑binaries” <em>approach does this PR
address?</em></p>
  </li>
  <li>
    <p>In <code class="language-plaintext highlighter-rouge">util::ExecVp()</code> (Windows branch) why is a <strong>second</strong> <code class="language-plaintext highlighter-rouge">std::vector</code>
<code class="language-plaintext highlighter-rouge">escaped_args</code> needed instead of modifying <code class="language-plaintext highlighter-rouge">argv</code> in‑place?</p>
  </li>
  <li>
    <p>Walk through the escaping algorithm in <code class="language-plaintext highlighter-rouge">util::ExecVp</code> for the argument
<code class="language-plaintext highlighter-rouge">C:\Program Files\Bitcoin\bitcoin-qt</code>.
<em>What exact string is passed to <code class="language-plaintext highlighter-rouge">_execvp()</code>?</em></p>
  </li>
  <li>
    <p><code class="language-plaintext highlighter-rouge">GetExePath()</code> does <strong>not</strong> use <code class="language-plaintext highlighter-rouge">readlink("/proc/self/exe")</code> on Linux even
though it would be more direct.  What advantages does the current
implementation have?  What corner cases might it miss?</p>
  </li>
  <li>
    <p>In <code class="language-plaintext highlighter-rouge">ExecCommand</code>, explain the purpose of the <code class="language-plaintext highlighter-rouge">fallback_os_search</code> Boolean.
Under what circumstances is it better to avoid letting the OS search for
the binary on the PATH?</p>
  </li>
  <li>
    <p>The wrapper searches <code class="language-plaintext highlighter-rouge">${prefix}/libexec</code> <strong>only when it detects that it is
running from an installed <code class="language-plaintext highlighter-rouge">bin/</code> directory</strong>.  Why not always search
<code class="language-plaintext highlighter-rouge">libexec</code>?</p>
  </li>
  <li>
    <p>The functional test layer now conditionally prepends <code class="language-plaintext highlighter-rouge">bitcoin -m</code> to every
command.  How does this interact with <em>backwards‑compatibility testing</em>
where older releases are run in the same test suite?</p>
  </li>
  <li>
    <p>The PR adds an exemption in <code class="language-plaintext highlighter-rouge">security-check.py</code> because the wrapper contains no
fortified glibc calls.
<em>Why</em> does it not contain them, and would adding a trivial <code class="language-plaintext highlighter-rouge">printf</code> to
<code class="language-plaintext highlighter-rouge">bitcoin.cpp</code> break reproducible builds under the current rules?</p>
  </li>
  <li>
    <p>Discuss an alternative design: linking a <em>static</em> table of sub‑commands to
absolute paths at <strong>build</strong> time instead of computing them at <strong>run</strong>
time.  What trade‑offs (deployment, relocatability, reproducibility)
influenced the chosen design?</p>
  </li>
  <li>
    <p>Suppose a user installs only <code class="language-plaintext highlighter-rouge">bitcoin</code> (wrapper) and <em>forgets</em> to install
<code class="language-plaintext highlighter-rouge">bitcoin-cli</code>.  Describe the failure mode when they run <code class="language-plaintext highlighter-rouge">bitcoin rpc
getblockcount</code>.  Would it be better for the wrapper to pre‑check the
availability of the target binary?</p>
  </li>
  <li>
    <p>(Forward‑looking) Once <code class="language-plaintext highlighter-rouge">bitcoin-gui</code> actually spawns <code class="language-plaintext highlighter-rouge">bitcoin-node</code>
automatically (after <a href="http://github.com/bitcoin/bitcoin/pull/10102">#10102</a>
lands), what additional command‑line options or UX changes might the wrapper
need?</p>
  </li>
  <li>
    <p>Typing <code class="language-plaintext highlighter-rouge">bitcoin --version</code> prints wrapper metadata, <em>not</em> <code class="language-plaintext highlighter-rouge">bitcoind</code>’s or <code class="language-plaintext highlighter-rouge">bitcoin‑qt</code>’s.
<em>Is that the right UX?</em>
Propose a mechanism for the wrapper to forward <code class="language-plaintext highlighter-rouge">--version</code> and <code class="language-plaintext highlighter-rouge">--help</code> to the underlying sub‑command when one is specified (e.g. <code class="language-plaintext highlighter-rouge">bitcoin --version daemon</code>).</p>
  </li>
  <li>
    <p>The wrapper is agnostic to options such as <code class="language-plaintext highlighter-rouge">-ipcbind</code> passed down to <code class="language-plaintext highlighter-rouge">bitcoin‑node</code>.
<em>Should the wrapper eventually enforce a policy (e.g. refuse to forward <code class="language-plaintext highlighter-rouge">-ipcconnect</code> unless <code class="language-plaintext highlighter-rouge">-m</code> is given)?</em>
What might go wrong if a user mixes monolithic binaries with IPC flags?</p>
  </li>
  <li>
    <p><code class="language-plaintext highlighter-rouge">BITCOIN_CMD="bitcoin -m"</code> is parsed with <code class="language-plaintext highlighter-rouge">shlex</code>; spaces inside quotes are preserved.
Should the framework use an explicit list instead of shell parsing?</p>
  </li>
  <li>
    <p>Would it ever make sense to ship <strong>only</strong> the wrapper in <code class="language-plaintext highlighter-rouge">bin/</code> and relocate
all other executables to <code class="language-plaintext highlighter-rouge">libexec/</code> to tidy PATH?</p>
  </li>
</ol>

<h2 id="meeting-log">Meeting Log</h2>

<table class="log-line" id="l-1"><tr class="log-row"><td class="log-lineno"><a href="#l-1">&nbsp;&nbsp;1</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> #startmeeting</span></td></tr></table>
<table class="log-line" id="l-2"><tr class="log-row"><td class="log-lineno"><a href="#l-2">&nbsp;&nbsp;2</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:salmon">&lt;corebot&gt;</span><span class="log-msg"> ryanofsky: Meeting started at 2025-05-07T17:00+0000</span></td></tr></table>
<table class="log-line" id="l-3"><tr class="log-row"><td class="log-lineno"><a href="#l-3">&nbsp;&nbsp;3</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:salmon">&lt;corebot&gt;</span><span class="log-msg"> ryanofsky: Current chairs: ryanofsky</span></td></tr></table>
<table class="log-line" id="l-4"><tr class="log-row"><td class="log-lineno"><a href="#l-4">&nbsp;&nbsp;4</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:salmon">&lt;corebot&gt;</span><span class="log-msg"> ryanofsky: Useful commands: #action #info #idea #link #topic #motion #vote #close #endmeeting</span></td></tr></table>
<table class="log-line" id="l-5"><tr class="log-row"><td class="log-lineno"><a href="#l-5">&nbsp;&nbsp;5</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:salmon">&lt;corebot&gt;</span><span class="log-msg"> ryanofsky: See also: <a href="https://hcoop-meetbot.readthedocs.io/en/stable/" target="blank">https://hcoop-meetbot.readthedocs.io/en/stable/</a></span></td></tr></table>
<table class="log-line" id="l-6"><tr class="log-row"><td class="log-lineno"><a href="#l-6">&nbsp;&nbsp;6</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:salmon">&lt;corebot&gt;</span><span class="log-msg"> ryanofsky: Participants should now identify themselves with &#39;#here&#39; or with an alias like &#39;#here FirstLast&#39;</span></td></tr></table>
<table class="log-line" id="l-7"><tr class="log-row"><td class="log-lineno"><a href="#l-7">&nbsp;&nbsp;7</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-8"><tr class="log-row"><td class="log-lineno"><a href="#l-8">&nbsp;&nbsp;8</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-9"><tr class="log-row"><td class="log-lineno"><a href="#l-9">&nbsp;&nbsp;9</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-10"><tr class="log-row"><td class="log-lineno"><a href="#l-10">&nbsp;10</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-11"><tr class="log-row"><td class="log-lineno"><a href="#l-11">&nbsp;11</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;kevkevin&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-12"><tr class="log-row"><td class="log-lineno"><a href="#l-12">&nbsp;12</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:tomato">&lt;emzy&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-13"><tr class="log-row"><td class="log-lineno"><a href="#l-13">&nbsp;13</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Welcome to the bitcoin review consortium! Today up for discussion is <a href="https://bitcoincore.reviews/31375" target="blank">https://bitcoincore.reviews/31375</a> #31375</span></td></tr></table>
<table class="log-line" id="l-14"><tr class="log-row"><td class="log-lineno"><a href="#l-14">&nbsp;14</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:salmon">&lt;corebot&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/issues/31375" target="blank">https://github.com/bitcoin/bitcoin/issues/31375</a> | multiprocess: Add bitcoin wrapper executable by ryanofsky · Pull Request #31375 · bitcoin/bitcoin · GitHub</span></td></tr></table>
<table class="log-line" id="l-15"><tr class="log-row"><td class="log-lineno"><a href="#l-15">&nbsp;15</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> I&#39;ll squash the first two questions and ask if anybody looked at the code or tested the new command? What was your approach? Any feedback or questions you have before we begin?</span></td></tr></table>
<table class="log-line" id="l-16"><tr class="log-row"><td class="log-lineno"><a href="#l-16">&nbsp;16</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:violet">&lt;pseudoramdom&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-17"><tr class="log-row"><td class="log-lineno"><a href="#l-17">&nbsp;17</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> hey</span></td></tr></table>
<table class="log-line" id="l-18"><tr class="log-row"><td class="log-lineno"><a href="#l-18">&nbsp;18</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> feels like it&#39;s a good change even without multiprocess</span></td></tr></table>
<table class="log-line" id="l-19"><tr class="log-row"><td class="log-lineno"><a href="#l-19">&nbsp;19</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> I read the notes, reviewed the notes, tested the functionality it run smoothly, and performed a light code review recently.</span></td></tr></table>
<table class="log-line" id="l-20"><tr class="log-row"><td class="log-lineno"><a href="#l-20">&nbsp;20</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> concept ack, looked through some of the code and did very light testing</span></td></tr></table>
<table class="log-line" id="l-21"><tr class="log-row"><td class="log-lineno"><a href="#l-21">&nbsp;21</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> just in general to increase discoverability</span></td></tr></table>
<table class="log-line" id="l-22"><tr class="log-row"><td class="log-lineno"><a href="#l-22">&nbsp;22</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> looked at most of the code and spun up a signet node in both mono and multi mode, all felt very ergonomic!</span></td></tr></table>
<table class="log-line" id="l-23"><tr class="log-row"><td class="log-lineno"><a href="#l-23">&nbsp;23</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> we must add tons of parsing logic to allow for `bitcoin -mh` though, forcing me to type `bitcoin -m -h` is unacceptable</span></td></tr></table>
<table class="log-line" id="l-24"><tr class="log-row"><td class="log-lineno"><a href="#l-24">&nbsp;24</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;kevkevin&gt;</span><span class="log-msg"> very briefly looked through the PR</span></td></tr></table>
<table class="log-line" id="l-25"><tr class="log-row"><td class="log-lineno"><a href="#l-25">&nbsp;25</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:brown">&lt;brunoer__&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-26"><tr class="log-row"><td class="log-lineno"><a href="#l-26">&nbsp;26</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Q: how will this wrapper approach fixes the ambiguity of the wallet command after <a href="https://github.com/bitcoin/bitcoin/pull/10102" target="blank">https://github.com/bitcoin/bitcoin/pull/10102</a> what will happen to current bitcoin-wallet executable</span></td></tr></table>
<table class="log-line" id="l-27"><tr class="log-row"><td class="log-lineno"><a href="#l-27">&nbsp;27</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> stickies-v, that seems like a good thing to note for a future improvement</span></td></tr></table>
<table class="log-line" id="l-28"><tr class="log-row"><td class="log-lineno"><a href="#l-28">&nbsp;28</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:violet">&lt;pseudoramdom&gt;</span><span class="log-msg"> liking the new subcommand ergonomics. Is this only when multiprocess is enabled? </span></td></tr></table>
<table class="log-line" id="l-29"><tr class="log-row"><td class="log-lineno"><a href="#l-29">&nbsp;29</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:tomato">&lt;emzy&gt;</span><span class="log-msg"> I found out the &quot;bitcoin util&quot; also works. But is not listet at &quot;bitcoin --help&quot;</span></td></tr></table>
<table class="log-line" id="l-30"><tr class="log-row"><td class="log-lineno"><a href="#l-30">&nbsp;30</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> abubakarsadiq, current code in #10102 just adds new IPC functionality to current executable. Different directions could be taken though. I don&#39;t think it shoudl matter too much to users if they are using the wrapper</span></td></tr></table>
<table class="log-line" id="l-31"><tr class="log-row"><td class="log-lineno"><a href="#l-31">&nbsp;31</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:salmon">&lt;corebot&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/issues/10102" target="blank">https://github.com/bitcoin/bitcoin/issues/10102</a> | Multiprocess bitcoin by ryanofsky · Pull Request #10102 · bitcoin/bitcoin · GitHub</span></td></tr></table>
<table class="log-line" id="l-32"><tr class="log-row"><td class="log-lineno"><a href="#l-32">&nbsp;32</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> emzy: needs &quot;bitcoin -h -a&quot; to show I think.</span></td></tr></table>
<table class="log-line" id="l-33"><tr class="log-row"><td class="log-lineno"><a href="#l-33">&nbsp;33</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> pseudoramdom, in current PR new binary is not tied to IPC / multiprocess options, it&#39;s available regardless</span></td></tr></table>
<table class="log-line" id="l-34"><tr class="log-row"><td class="log-lineno"><a href="#l-34">&nbsp;34</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> oh when I built it with -DENABLE_IPC=ON the counter was going to 101%</span></td></tr></table>
<table class="log-line" id="l-35"><tr class="log-row"><td class="log-lineno"><a href="#l-35">&nbsp;35</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> ah, no it doesn&#39;t show util even then.</span></td></tr></table>
<table class="log-line" id="l-36"><tr class="log-row"><td class="log-lineno"><a href="#l-36">&nbsp;36</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:tomato">&lt;emzy&gt;</span><span class="log-msg"> hodlinator: that shows more but also no util</span></td></tr></table>
<table class="log-line" id="l-37"><tr class="log-row"><td class="log-lineno"><a href="#l-37">&nbsp;37</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> emzy, good find, I didn&#39;t know that. intention was to punt on bitcoin-util and not support it for now</span></td></tr></table>
<table class="log-line" id="l-38"><tr class="log-row"><td class="log-lineno"><a href="#l-38">&nbsp;38</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> i think it might be better to support `bitcoin grind` directly instead of requiring `bitcoin util grind` but that requires argsmanager changes</span></td></tr></table>
<table class="log-line" id="l-39"><tr class="log-row"><td class="log-lineno"><a href="#l-39">&nbsp;39</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> monlovesmango, i&#39;ve definitely seen that cmake 101% progress thing, not sure what causes it</span></td></tr></table>
<table class="log-line" id="l-40"><tr class="log-row"><td class="log-lineno"><a href="#l-40">&nbsp;40</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> next question from the list is: 3. From issue #30983, four packaging strategies were listed. Which specific drawbacks of the “side‑binaries” approach does this PR address?</span></td></tr></table>
<table class="log-line" id="l-41"><tr class="log-row"><td class="log-lineno"><a href="#l-41">&nbsp;41</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:salmon">&lt;corebot&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/issues/30983" target="blank">https://github.com/bitcoin/bitcoin/issues/30983</a> | RFC: Multiprocess binaries and packaging options · Issue #30983 · bitcoin/bitcoin · GitHub</span></td></tr></table>
<table class="log-line" id="l-42"><tr class="log-row"><td class="log-lineno"><a href="#l-42">&nbsp;42</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> there&#39;s only one con listed for the side-binaries approach so i&#39;m gonna go with #1 of 1: confusing</span></td></tr></table>
<table class="log-line" id="l-43"><tr class="log-row"><td class="log-lineno"><a href="#l-43">&nbsp;43</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:salmon">&lt;corebot&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/issues/1" target="blank">https://github.com/bitcoin/bitcoin/issues/1</a> | JSON-RPC support for mobile devices (&quot;ultra-lightweight&quot; clients) · Issue #1 · bitcoin/bitcoin · GitHub</span></td></tr></table>
<table class="log-line" id="l-44"><tr class="log-row"><td class="log-lineno"><a href="#l-44">&nbsp;44</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> remove the need for adding more binaries for the user to choose from?</span></td></tr></table>
<table class="log-line" id="l-45"><tr class="log-row"><td class="log-lineno"><a href="#l-45">&nbsp;45</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> I think having multiple binaries in a single release. Instead of requiring users to call individual binaries,  the binaries will be placed in the `libexec` directory and wrapped under the bitcoin command. users dont have to deal with the new binaries they should just know the commands</span></td></tr></table>
<table class="log-line" id="l-46"><tr class="log-row"><td class="log-lineno"><a href="#l-46">&nbsp;46</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> it&#39;s easier for the user to find what they need when they can go through a single binary that helps them find others</span></td></tr></table>
<table class="log-line" id="l-47"><tr class="log-row"><td class="log-lineno"><a href="#l-47">&nbsp;47</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> yeah exactly, there&#39;s only one thing listed there and the main goal is to avoid confusion if multiprocess support is added</span></td></tr></table>
<table class="log-line" id="l-48"><tr class="log-row"><td class="log-lineno"><a href="#l-48">&nbsp;48</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Another thing it provides is forward compatability. Wrapper lets us rename binaries, consolidate them, replace them without changing external interface.</span></td></tr></table>
<table class="log-line" id="l-49"><tr class="log-row"><td class="log-lineno"><a href="#l-49">&nbsp;49</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> 4. In util::ExecVp() (Windows branch) why is a second std::vector escaped_args needed instead of modifying argv in‑place?</span></td></tr></table>
<table class="log-line" id="l-50"><tr class="log-row"><td class="log-lineno"><a href="#l-50">&nbsp;50</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> and maybe in the future we can add some fuzzy search too for when you&#39;re not quite sure exactly what it was clled?</span></td></tr></table>
<table class="log-line" id="l-51"><tr class="log-row"><td class="log-lineno"><a href="#l-51">&nbsp;51</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @ryanofsky is it okay to update an array while iterating through it?</span></td></tr></table>
<table class="log-line" id="l-52"><tr class="log-row"><td class="log-lineno"><a href="#l-52">&nbsp;52</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> It can be ok to update an array but in this case the array members are const `char *const argv[]`</span></td></tr></table>
<table class="log-line" id="l-53"><tr class="log-row"><td class="log-lineno"><a href="#l-53">&nbsp;53</a></td><td class="log-time">17:14 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> relevant code is <a href="https://github.com/bitcoin/bitcoin/commit/9ac787c7a85c3d2ff407bf149b982fc347537b12" target="blank">https://github.com/bitcoin/bitcoin/commit/9ac787c7a85c3d2ff407bf149b982fc347537b12</a></span></td></tr></table>
<table class="log-line" id="l-54"><tr class="log-row"><td class="log-lineno"><a href="#l-54">&nbsp;54</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> 5.  Walk through the escaping algorithm in util::ExecVp for the argument C:\Program Files\Bitcoin\bitcoin-qt. What exact string is passed to _execvp()?</span></td></tr></table>
<table class="log-line" id="l-55"><tr class="log-row"><td class="log-lineno"><a href="#l-55">&nbsp;55</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> 1. The algorithm first checks if the argument contains spaces, tabs, or quotes. </span></td></tr></table>
<table class="log-line" id="l-56"><tr class="log-row"><td class="log-lineno"><a href="#l-56">&nbsp;56</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> 2. Quotes are added at the beginning and end of the argument.</span></td></tr></table>
<table class="log-line" id="l-57"><tr class="log-row"><td class="log-lineno"><a href="#l-57">&nbsp;57</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> 3. Backslashes (\) followed by quotes are doubled to ensure proper parsing.</span></td></tr></table>
<table class="log-line" id="l-58"><tr class="log-row"><td class="log-lineno"><a href="#l-58">&nbsp;58</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> 4. Any standalone quotes are escaped with a backslash.The resulting string passed to _execvp() is:&quot;C:\\Program Files\\Bitcoin\\bitcoin-qt&quot;</span></td></tr></table>
<table class="log-line" id="l-59"><tr class="log-row"><td class="log-lineno"><a href="#l-59">&nbsp;59</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> stickies-v, added your CLI improvement suggestions to the list in the description</span></td></tr></table>
<table class="log-line" id="l-60"><tr class="log-row"><td class="log-lineno"><a href="#l-60">&nbsp;60</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Yes that&#39;s close but backslashes only need to be escaped if followed by quotes. So in the example the only change made is to add quotes around the argument. Backslashes don&#39;t need to be escaped there</span></td></tr></table>
<table class="log-line" id="l-61"><tr class="log-row"><td class="log-lineno"><a href="#l-61">&nbsp;61</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> is there any possibility single quotes are used? or is there validation upstream?</span></td></tr></table>
<table class="log-line" id="l-62"><tr class="log-row"><td class="log-lineno"><a href="#l-62">&nbsp;62</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> I see thanks</span></td></tr></table>
<table class="log-line" id="l-63"><tr class="log-row"><td class="log-lineno"><a href="#l-63">&nbsp;63</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> monlovesmango, in general this depends on your shell. Single quotes are allowed there</span></td></tr></table>
<table class="log-line" id="l-64"><tr class="log-row"><td class="log-lineno"><a href="#l-64">&nbsp;64</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> The only escaping this PR is doing is on windows where you have escape the argv[] array in a quirky way that the microsoft C runtime expects</span></td></tr></table>
<table class="log-line" id="l-65"><tr class="log-row"><td class="log-lineno"><a href="#l-65">&nbsp;65</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> otherwise the argv passed to execvp will not match the argv received by the program which is executed</span></td></tr></table>
<table class="log-line" id="l-66"><tr class="log-row"><td class="log-lineno"><a href="#l-66">&nbsp;66</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> I guess my question is do single quotes need to be handled?</span></td></tr></table>
<table class="log-line" id="l-67"><tr class="log-row"><td class="log-lineno"><a href="#l-67">&nbsp;67</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> monlovesmango, nope just because the windows internal argv parsing doesn&#39;t care about them</span></td></tr></table>
<table class="log-line" id="l-68"><tr class="log-row"><td class="log-lineno"><a href="#l-68">&nbsp;68</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> ryanofsky: makes sense</span></td></tr></table>
<table class="log-line" id="l-69"><tr class="log-row"><td class="log-lineno"><a href="#l-69">&nbsp;69</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> thanks</span></td></tr></table>
<table class="log-line" id="l-70"><tr class="log-row"><td class="log-lineno"><a href="#l-70">&nbsp;70</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> No problem!</span></td></tr></table>
<table class="log-line" id="l-71"><tr class="log-row"><td class="log-lineno"><a href="#l-71">&nbsp;71</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> 6. GetExePath() does not use readlink(&quot;/proc/self/exe&quot;) on Linux even though it would be more direct. What advantages does the current implementation have? What corner cases might it miss?</span></td></tr></table>
<table class="log-line" id="l-72"><tr class="log-row"><td class="log-lineno"><a href="#l-72">&nbsp;72</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> We may be running on another non-windows system that doesn&#39;t have proc-fs?</span></td></tr></table>
<table class="log-line" id="l-73"><tr class="log-row"><td class="log-lineno"><a href="#l-73">&nbsp;73</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Yeah I think that&#39;s the only possible advantage, otherwise /proc/self/exe would probably be more reliable and direct</span></td></tr></table>
<table class="log-line" id="l-74"><tr class="log-row"><td class="log-lineno"><a href="#l-74">&nbsp;74</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> I&#39;m not sure what situation is on macos or bsds</span></td></tr></table>
<table class="log-line" id="l-75"><tr class="log-row"><td class="log-lineno"><a href="#l-75">&nbsp;75</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> In ExecCommand, explain the purpose of the fallback_os_search Boolean. Under what circumstances is it better to avoid letting the OS search for the binary on the PATH?</span></td></tr></table>
<table class="log-line" id="l-76"><tr class="log-row"><td class="log-lineno"><a href="#l-76">&nbsp;76</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> ^^^ That was question 7</span></td></tr></table>
<table class="log-line" id="l-77"><tr class="log-row"><td class="log-lineno"><a href="#l-77">&nbsp;77</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Link to relevant commit: <a href="https://github.com/bitcoin/bitcoin/commit/f2c003c927557f97dafa263e6cbb90a4e3421842" target="blank">https://github.com/bitcoin/bitcoin/commit/f2c003c927557f97dafa263e6cbb90a4e3421842</a></span></td></tr></table>
<table class="log-line" id="l-78"><tr class="log-row"><td class="log-lineno"><a href="#l-78">&nbsp;78</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> It might be that one hasn&#39;t built all target executables in one&#39;s local build?</span></td></tr></table>
<table class="log-line" id="l-79"><tr class="log-row"><td class="log-lineno"><a href="#l-79">&nbsp;79</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> hodlinator, yeah this behavior was just added to avoid confusing developers</span></td></tr></table>
<table class="log-line" id="l-80"><tr class="log-row"><td class="log-lineno"><a href="#l-80">&nbsp;80</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> When the wrapper executable is invoked using a specific path to prevent unintentionally use of a binary in PATH instead of the intended local binary. </span></td></tr></table>
<table class="log-line" id="l-81"><tr class="log-row"><td class="log-lineno"><a href="#l-81">&nbsp;81</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> if executiable is invoked from path we don&#39;t want to fall back to operating system</span></td></tr></table>
<table class="log-line" id="l-82"><tr class="log-row"><td class="log-lineno"><a href="#l-82">&nbsp;82</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> i think generally the wrapper and the individual binaries are all going to be shipped and compiled together, so searching locally is more robust?</span></td></tr></table>
<table class="log-line" id="l-83"><tr class="log-row"><td class="log-lineno"><a href="#l-83">&nbsp;83</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> stickies-v, that seems like a good point. maybe it would make sense to avoid searching PATH altogether</span></td></tr></table>
<table class="log-line" id="l-84"><tr class="log-row"><td class="log-lineno"><a href="#l-84">&nbsp;84</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> I think when I first implemented it, I didn&#39;t want to rely on GetExePath working perfectly, and wanted to take advantage of OS native ability find binaries</span></td></tr></table>
<table class="log-line" id="l-85"><tr class="log-row"><td class="log-lineno"><a href="#l-85">&nbsp;85</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> but then Sjors pointed out searching PATH could be confusing for developers if they didnt&#39; build everythign, so narrowed the use of PATH. but could make sense to drop it altogether</span></td></tr></table>
<table class="log-line" id="l-86"><tr class="log-row"><td class="log-lineno"><a href="#l-86">&nbsp;86</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> not the same thing, but i stopped searching the system path with py-bitcoinkernel because it was leading to too much confusion and errors, so i allowed providing an explicit path env var instead which is hard to abuse</span></td></tr></table>
<table class="log-line" id="l-87"><tr class="log-row"><td class="log-lineno"><a href="#l-87">&nbsp;87</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:tomato">&lt;emzy&gt;</span><span class="log-msg"> I think using &quot;bitcoin rpc --version&quot; is helpful to figure out what you actualy running. Would help to also show the path of the binary.</span></td></tr></table>
<table class="log-line" id="l-88"><tr class="log-row"><td class="log-lineno"><a href="#l-88">&nbsp;88</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Yeah I think main reason for using system path is I&#39;d like wrapper to &quot;just work&quot; and avoid being unreliable</span></td></tr></table>
<table class="log-line" id="l-89"><tr class="log-row"><td class="log-lineno"><a href="#l-89">&nbsp;89</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> Agree it may be a bit too magical.</span></td></tr></table>
<table class="log-line" id="l-90"><tr class="log-row"><td class="log-lineno"><a href="#l-90">&nbsp;90</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> &quot;bitcoin rpc --version doesn&#39;t seem to show paths when I try, but could make sense to add a verbose / debug option maybe to show paths?</span></td></tr></table>
<table class="log-line" id="l-91"><tr class="log-row"><td class="log-lineno"><a href="#l-91">&nbsp;91</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> 8.  The wrapper searches ${prefix}/libexec only when it detects that it is running from an installed bin/ directory. Why not always search libexec?</span></td></tr></table>
<table class="log-line" id="l-92"><tr class="log-row"><td class="log-lineno"><a href="#l-92">&nbsp;92</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> This is the same commit <a href="https://github.com/bitcoin/bitcoin/commit/f2c003c927557f97dafa263e6cbb90a4e3421842" target="blank">https://github.com/bitcoin/bitcoin/commit/f2c003c927557f97dafa263e6cbb90a4e3421842</a> line 189</span></td></tr></table>
<table class="log-line" id="l-93"><tr class="log-row"><td class="log-lineno"><a href="#l-93">&nbsp;93</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> My answer to this was that wrapper should be conservative about what paths it tries to execute, and encourage standard PREFIX/{bin,libexec} layouts, not encourage packagers to create nonstandard layouts or work when binaries arranged in unexpected ways.</span></td></tr></table>
<table class="log-line" id="l-94"><tr class="log-row"><td class="log-lineno"><a href="#l-94">&nbsp;94</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> 9. The functional test layer now conditionally prepends bitcoin -m to every command. How does this interact with backwards‑compatibility testing where older releases are run in the same test suite?</span></td></tr></table>
<table class="log-line" id="l-95"><tr class="log-row"><td class="log-lineno"><a href="#l-95">&nbsp;95</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> oh, is this because bitcoin core can also be shipped through package managers? because with our own build system we know it&#39;ll always be stored in the bin,libexec dirs?</span></td></tr></table>
<table class="log-line" id="l-96"><tr class="log-row"><td class="log-lineno"><a href="#l-96">&nbsp;96</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> Re 9: <a href="https://github.com/bitcoin/bitcoin/pull/31375/commits/ccacae70ed050f37f5d00362152ba31036818691" target="blank">https://github.com/bitcoin/bitcoin/pull/31375/commits/ccacae70ed050f37f5d00362152ba31036818691</a></span></td></tr></table>
<table class="log-line" id="l-97"><tr class="log-row"><td class="log-lineno"><a href="#l-97">&nbsp;97</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> stickies-v, yeah the code isn&#39;t just trying to be conservative abotu what it executes. It will execute binaries in paths explicitly listed on PATH and in places that seem to match expected layout, but avoid executing things in novel situations</span></td></tr></table>
<table class="log-line" id="l-98"><tr class="log-row"><td class="log-lineno"><a href="#l-98">&nbsp;98</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> that sounds like a good approach to me, and not something i realized we had to think of</span></td></tr></table>
<table class="log-line" id="l-99"><tr class="log-row"><td class="log-lineno"><a href="#l-99">&nbsp;99</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Re 9: The Binaries._argv method in commit hodlinator linked to <a href="https://github.com/bitcoin/bitcoin/commit/ccacae70ed050f37f5d00362152ba31036818691" target="blank">https://github.com/bitcoin/bitcoin/commit/ccacae70ed050f37f5d00362152ba31036818691</a> will ignore the wrapper executable entirely when testing previous releases because bin_dir will be set in that case</span></td></tr></table>
<table class="log-line" id="l-100"><tr class="log-row"><td class="log-lineno"><a href="#l-100">100</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> In future if bitcoin wrapper executable becomes part of previous releases and we want to test it, this code will need to be updated.</span></td></tr></table>
<table class="log-line" id="l-101"><tr class="log-row"><td class="log-lineno"><a href="#l-101">101</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> so on the one hand we need to be conservative in what we execute, but on the other hand there may be package managers that (for some reason, idk) are unable to store binaries in the {bin,libexec} dirs?</span></td></tr></table>
<table class="log-line" id="l-102"><tr class="log-row"><td class="log-lineno"><a href="#l-102">102</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> stickies-v, I don&#39;t think we need to be conservative, I just thought it would be a good starting point. I don&#39;t think package manager will need to choose divergent layouts probably, but we can find out and adapt</span></td></tr></table>
<table class="log-line" id="l-103"><tr class="log-row"><td class="log-lineno"><a href="#l-103">103</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> 👍</span></td></tr></table>
<table class="log-line" id="l-104"><tr class="log-row"><td class="log-lineno"><a href="#l-104">104</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> So a test must explicitly call add_nodes() and pass in old versions, which will result in the old binaries being resolved.. and this resolution-logic will need to be updated to support the wrapper in the future.</span></td></tr></table>
<table class="log-line" id="l-105"><tr class="log-row"><td class="log-lineno"><a href="#l-105">105</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Note: we won&#39;t have time to get to all questions listed so if any in particular someone wants to talk about (or some specific topic) feel free to suggest</span></td></tr></table>
<table class="log-line" id="l-106"><tr class="log-row"><td class="log-lineno"><a href="#l-106">106</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:tomato">&lt;emzy&gt;</span><span class="log-msg"> I&#39;m in general concerned about searching for binaries to execute. There are many possible security problems. Better have it hardcoded to one path as libexec.</span></td></tr></table>
<table class="log-line" id="l-107"><tr class="log-row"><td class="log-lineno"><a href="#l-107">107</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> hodlinator, yes that sounds right. Test framework code right now just assumes all previous releases don&#39;t have a wrapper binary to call. So if we want to write new tests calling wrapper binaries in old releases something like that needs to change</span></td></tr></table>
<table class="log-line" id="l-108"><tr class="log-row"><td class="log-lineno"><a href="#l-108">108</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> emzy, I think that is what current PR does. It hardcodes to libexec and uses the operating systems normal mechanism to search the PATH</span></td></tr></table>
<table class="log-line" id="l-109"><tr class="log-row"><td class="log-lineno"><a href="#l-109">109</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> Being flexible with PATH might enable attackers to put malicious binaries there to be resolved?</span></td></tr></table>
<table class="log-line" id="l-110"><tr class="log-row"><td class="log-lineno"><a href="#l-110">110</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:tomato">&lt;emzy&gt;</span><span class="log-msg"> The user/attacker can change the PATH.</span></td></tr></table>
<table class="log-line" id="l-111"><tr class="log-row"><td class="log-lineno"><a href="#l-111">111</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:steelblue">&lt;stickies-v&gt;</span><span class="log-msg"> I was wondering why on windows we search the &quot;daemon&quot; dir - that&#39;s unrelated to our &quot;bitcoin daemon&quot; bin, right? Is this just a windows convention?</span></td></tr></table>
<table class="log-line" id="l-112"><tr class="log-row"><td class="log-lineno"><a href="#l-112">112</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:tomato">&lt;emzy&gt;</span><span class="log-msg"> At first glance that&#39;s not a problem. But whow knows. </span></td></tr></table>
<table class="log-line" id="l-113"><tr class="log-row"><td class="log-lineno"><a href="#l-113">113</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> emzy: if the attacker can change the PATH; he can do worse than just putting malicious binaries no?</span></td></tr></table>
<table class="log-line" id="l-114"><tr class="log-row"><td class="log-lineno"><a href="#l-114">114</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> stickies-v, yeah not sure why that directory exists on windows, it just seems to be a quick of the installer</span></td></tr></table>
<table class="log-line" id="l-115"><tr class="log-row"><td class="log-lineno"><a href="#l-115">115</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> abubakarsadiq, yeah I think that&#39;s the general think that makes me not worried about executing binaries on the PATH. but maybe we could be conservative and never do that, it&#39;s reasonable thing to consider</span></td></tr></table>
<table class="log-line" id="l-116"><tr class="log-row"><td class="log-lineno"><a href="#l-116">116</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:magenta">&lt;hodlinator&gt;</span><span class="log-msg"> yeah, better to add it later if needed.</span></td></tr></table>
<table class="log-line" id="l-117"><tr class="log-row"><td class="log-lineno"><a href="#l-117">117</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> 10. The PR adds an exemption in security-check.py because the wrapper contains no fortified glibc calls. Why does it not contain them, and would adding a trivial printf to bitcoin.cpp break reproducible builds under the current rules?</span></td></tr></table>
<table class="log-line" id="l-118"><tr class="log-row"><td class="log-lineno"><a href="#l-118">118</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:tomato">&lt;emzy&gt;</span><span class="log-msg"> abubakarsadiq: That&#39;s right. It needs some combination. Like some software allows to change (only) PATH. Looks like no problem at first.</span></td></tr></table>
<table class="log-line" id="l-119"><tr class="log-row"><td class="log-lineno"><a href="#l-119">119</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> I think that&#39;ll be the last question</span></td></tr></table>
<table class="log-line" id="l-120"><tr class="log-row"><td class="log-lineno"><a href="#l-120">120</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> yep unanswered yet :)</span></td></tr></table>
<table class="log-line" id="l-121"><tr class="log-row"><td class="log-lineno"><a href="#l-121">121</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> I think the answer adding is adding new calls should not break the build. If we add new calls they should be fortified based on build options.</span></td></tr></table>
<table class="log-line" id="l-122"><tr class="log-row"><td class="log-lineno"><a href="#l-122">122</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:tomato">&lt;emzy&gt;</span><span class="log-msg"> I worked in IT security. So I&#39;m always (too) concerned. ;)</span></td></tr></table>
<table class="log-line" id="l-123"><tr class="log-row"><td class="log-lineno"><a href="#l-123">123</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> emzy: most of the times it&#39;s a good thing to.</span></td></tr></table>
<table class="log-line" id="l-124"><tr class="log-row"><td class="log-lineno"><a href="#l-124">124</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Adding new calls should just allow the security-check.py exception to be removed. The exception is needed because it is checking for fortified symbols but the wrapper binary is so simple it doesn&#39;t contain any</span></td></tr></table>
<table class="log-line" id="l-125"><tr class="log-row"><td class="log-lineno"><a href="#l-125">125</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Yeah it&#39;s good to be looking at security very closely in this realm</span></td></tr></table>
<table class="log-line" id="l-126"><tr class="log-row"><td class="log-lineno"><a href="#l-126">126</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> Thanks everybody for participating!</span></td></tr></table>
<table class="log-line" id="l-127"><tr class="log-row"><td class="log-lineno"><a href="#l-127">127</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:peru">&lt;ryanofsky&gt;</span><span class="log-msg"> #endmeeting</span></td></tr></table>]]></content><author><name>ryanofsky</name></author><summary type="html"><![CDATA[Notes]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bitcoincore.reviews/assets/img/twitter_card.png" /><media:content medium="image" url="https://bitcoincore.reviews/assets/img/twitter_card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Add checkBlock() to Mining interface</title><link href="https://bitcoincore.reviews/31981" rel="alternate" type="text/html" title="Add checkBlock() to Mining interface" /><published>2025-04-30T00:00:00+00:00</published><updated>2025-04-30T00:00:00+00:00</updated><id>https://bitcoincore.reviews/#31981</id><content type="html" xml:base="https://bitcoincore.reviews/31981"><![CDATA[<h2 id="notes">Notes</h2>

<h3 id="background">Background</h3>

<p><a href="https://github.com/stratum-mining/sv2-spec/tree/main">StratumV2 (Sv2)</a> protocol defines various roles, one of which is the Template Provider (TP), explained in the <a href="https://github.com/stratum-mining/sv2-spec/blob/main/07-Template-Distribution-Protocol.md">template distribution</a> section of the spec. The TP pushes block template updates to miners whenever the chain tip is updated or when mempool fees have increased sufficiently.</p>

<p>Rather than implementing the TP role in Bitcoin Core, the work done in <a href="https://github.com/bitcoin/bitcoin/issues/31098">#31098</a> allows third-party processes to interface with bitcoind through interprocess communication (IPC). The IPC interface, introduced as part of the <a href="https://github.com/bitcoin/bitcoin/issues/28722">multiprocess</a> project, is work-in-progress too.</p>

<p>Bitcoin Core now exposes a mining interface through two classes <code class="language-plaintext highlighter-rouge">BlockTemplate</code> and <code class="language-plaintext highlighter-rouge">Mining</code> which provide key methods needed by the <a href="https://github.com/stratum-mining/sv2-spec/blob/main/07-Template-Distribution-Protocol.md">Sv2 TP client</a>, enabling projects like <a href="https://github.com/Sjors/bitcoin/pull/49">Sjors’ TP client</a> to receive block template updates via the interface.</p>

<h3 id="pr-overview">PR Overview</h3>
<ul>
  <li>
    <p>PR <a href="https://github.com/bitcoin/bitcoin/pull/31981">#31981</a> adds a new method to the mining interface called <code class="language-plaintext highlighter-rouge">checkBlock</code> that checks the validity of a block template. This check is equivalent to the one done in <a href="https://github.com/bitcoin/bitcoin/blob/9efe5466885862bc1fb830524f7ce23e785fcac0/src/rpc/mining.cpp#L724-L750"><code class="language-plaintext highlighter-rouge">getblocktemplate</code> RPC in proposal mode</a>.</p>
  </li>
  <li>
    <p>The method responsible for checking whether a block template is valid in Bitcoin core is <a href="https://github.com/bitcoin/bitcoin/blob/9efe5466885862bc1fb830524f7ce23e785fcac0/src/validation.h#L387"><code class="language-plaintext highlighter-rouge">TestBlockValidity</code></a>.</p>
  </li>
</ul>

<h3 id="motivation">Motivation</h3>

<ul>
  <li>Using the IPC interface to check block validity is more performant than the <code class="language-plaintext highlighter-rouge">getblocktemplate</code> RPC, as it avoids serializing up to 4 MB of transaction data as JSON.</li>
</ul>

<h2 id="questions">Questions</h2>

<ol>
  <li>
    <p>Did you review the PR? <a href="https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#peer-review">Concept ACK, approach ACK, tested ACK, or NACK</a>? What was your review approach?</p>
  </li>
  <li>
    <p>Does an Sv2 TP client have to implement the new <code class="language-plaintext highlighter-rouge">checkBlock</code> method in the mining interface (yes/no)?</p>
  </li>
  <li>
    <p>Can you list some checks performed on the block in <code class="language-plaintext highlighter-rouge">getblocktemplate</code> proposal mode? Does that include checking for a valid proof of work for the block template?</p>
  </li>
  <li>
    <p>Apart from performance reasons mentioned in the PR description, are there any reasons an Sv2 TP client would want to use IPC instead of RPC?</p>
  </li>
  <li>
    <p>What is the key difference between contextual and context-free checks in the block template validity checks?</p>
  </li>
  <li>
    <p>Is there a change in behavior for <code class="language-plaintext highlighter-rouge">TestBlockValidity</code> after this PR, or is it a pure refactor? If yes, what’s the change?</p>
  </li>
  <li>
    <p>One of the reasons for locking <code class="language-plaintext highlighter-rouge">cs_main</code> in <code class="language-plaintext highlighter-rouge">TestBlockValidity</code> is to prevent <code class="language-plaintext highlighter-rouge">CheckBlock</code> race conditions. Can you describe a scenario when that might happen?</p>
  </li>
  <li>
    <p>In <a href="https://github.com/bitcoin-core-review-club/bitcoin/blob/1d029c23a143f1b9110377967a7c4a20ee75058d/src/validation.cpp#L4662">commit 1d029c23</a>, why do we assert that <code class="language-plaintext highlighter-rouge">fChecked</code> should return false? Is this a potential issue?</p>
  </li>
  <li>
    <p>In this <a href="https://github.com/bitcoin/bitcoin/blob/9efe5466885862bc1fb830524f7ce23e785fcac0/src/validation.cpp#L4078"><code class="language-plaintext highlighter-rouge">CheckBlock</code></a> size check, which size rule are we checking? Is it an overestimate check? Which size check is missing there?</p>
  </li>
  <li>
    <p>In <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/cca5993b26e6223af31fe1ef5bf8a319cb87cf93">commit cca5993b</a>, can you clarify the note that serialization of <code class="language-plaintext highlighter-rouge">BlockValidationState</code> is “fragile”?</p>
  </li>
</ol>

<h2 id="meeting-log">Meeting Log</h2>

<table class="log-line" id="l-1"><tr class="log-row"><td class="log-lineno"><a href="#l-1">&nbsp;&nbsp;1</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> #startmeeting </span></td></tr></table>
<table class="log-line" id="l-2"><tr class="log-row"><td class="log-lineno"><a href="#l-2">&nbsp;&nbsp;2</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;corebot&gt;</span><span class="log-msg"> abubakarsadiq: Meeting started at 2025-04-30T17:00+0000</span></td></tr></table>
<table class="log-line" id="l-3"><tr class="log-row"><td class="log-lineno"><a href="#l-3">&nbsp;&nbsp;3</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;corebot&gt;</span><span class="log-msg"> abubakarsadiq: Current chairs: abubakarsadiq</span></td></tr></table>
<table class="log-line" id="l-4"><tr class="log-row"><td class="log-lineno"><a href="#l-4">&nbsp;&nbsp;4</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;corebot&gt;</span><span class="log-msg"> abubakarsadiq: Useful commands: #action #info #idea #link #topic #motion #vote #close #endmeeting</span></td></tr></table>
<table class="log-line" id="l-5"><tr class="log-row"><td class="log-lineno"><a href="#l-5">&nbsp;&nbsp;5</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;corebot&gt;</span><span class="log-msg"> abubakarsadiq: See also: <a href="https://hcoop-meetbot.readthedocs.io/en/stable/" target="blank">https://hcoop-meetbot.readthedocs.io/en/stable/</a></span></td></tr></table>
<table class="log-line" id="l-6"><tr class="log-row"><td class="log-lineno"><a href="#l-6">&nbsp;&nbsp;6</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;corebot&gt;</span><span class="log-msg"> abubakarsadiq: Participants should now identify themselves with &#39;#here&#39; or with an alias like &#39;#here FirstLast&#39;</span></td></tr></table>
<table class="log-line" id="l-7"><tr class="log-row"><td class="log-lineno"><a href="#l-7">&nbsp;&nbsp;7</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> Hi</span></td></tr></table>
<table class="log-line" id="l-8"><tr class="log-row"><td class="log-lineno"><a href="#l-8">&nbsp;&nbsp;8</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> Hi</span></td></tr></table>
<table class="log-line" id="l-9"><tr class="log-row"><td class="log-lineno"><a href="#l-9">&nbsp;&nbsp;9</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> hi hi</span></td></tr></table>
<table class="log-line" id="l-10"><tr class="log-row"><td class="log-lineno"><a href="#l-10">&nbsp;10</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> hey</span></td></tr></table>
<table class="log-line" id="l-11"><tr class="log-row"><td class="log-lineno"><a href="#l-11">&nbsp;11</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:brown">&lt;Guest16&gt;</span><span class="log-msg"> hi</span></td></tr></table>
<table class="log-line" id="l-12"><tr class="log-row"><td class="log-lineno"><a href="#l-12">&nbsp;12</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> welcome to this week review club session \o/</span></td></tr></table>
<table class="log-line" id="l-13"><tr class="log-row"><td class="log-lineno"><a href="#l-13">&nbsp;13</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> We will take a loot at #31981</span></td></tr></table>
<table class="log-line" id="l-14"><tr class="log-row"><td class="log-lineno"><a href="#l-14">&nbsp;14</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;corebot&gt;</span><span class="log-msg"> <a href="https://github.com/bitcoin/bitcoin/issues/31981" target="blank">https://github.com/bitcoin/bitcoin/issues/31981</a> | Add checkBlock() to Mining interface by Sjors · Pull Request #31981 · bitcoin/bitcoin · GitHub</span></td></tr></table>
<table class="log-line" id="l-15"><tr class="log-row"><td class="log-lineno"><a href="#l-15">&nbsp;15</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> The notes and question are available <a href="https://bitcoincore.reviews/31981" target="blank">https://bitcoincore.reviews/31981</a></span></td></tr></table>
<table class="log-line" id="l-16"><tr class="log-row"><td class="log-lineno"><a href="#l-16">&nbsp;16</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Did you review the PR or read the notes? Concept ACK, approach ACK, tested ACK, or NACK? What was your review approach?</span></td></tr></table>
<table class="log-line" id="l-17"><tr class="log-row"><td class="log-lineno"><a href="#l-17">&nbsp;17</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> reviewed some of the PR, read the notes. concept ACK</span></td></tr></table>
<table class="log-line" id="l-18"><tr class="log-row"><td class="log-lineno"><a href="#l-18">&nbsp;18</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:goldenrod">&lt;enochazariah&gt;</span><span class="log-msg"> reviewed the PR partially, and read the notes as well. Conecpt ACK</span></td></tr></table>
<table class="log-line" id="l-19"><tr class="log-row"><td class="log-lineno"><a href="#l-19">&nbsp;19</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> concept ACK, approach ACK. Worked through the questions</span></td></tr></table>
<table class="log-line" id="l-20"><tr class="log-row"><td class="log-lineno"><a href="#l-20">&nbsp;20</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> nice</span></td></tr></table>
<table class="log-line" id="l-21"><tr class="log-row"><td class="log-lineno"><a href="#l-21">&nbsp;21</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> I reviewed the pr commits, and made some experimental changes concept ACK, with questions about the approach</span></td></tr></table>
<table class="log-line" id="l-22"><tr class="log-row"><td class="log-lineno"><a href="#l-22">&nbsp;22</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Lets jump into the conceptual questions then.</span></td></tr></table>
<table class="log-line" id="l-23"><tr class="log-row"><td class="log-lineno"><a href="#l-23">&nbsp;23</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Does an Sv2 TP client have to implement the new checkBlock method in the mining interface (yes/no)?</span></td></tr></table>
<table class="log-line" id="l-24"><tr class="log-row"><td class="log-lineno"><a href="#l-24">&nbsp;24</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> no</span></td></tr></table>
<table class="log-line" id="l-25"><tr class="log-row"><td class="log-lineno"><a href="#l-25">&nbsp;25</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> no</span></td></tr></table>
<table class="log-line" id="l-26"><tr class="log-row"><td class="log-lineno"><a href="#l-26">&nbsp;26</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> I&#39;m a bit confused by the terminology here. The PR description mentions “pools” may want to verify templates using checkBlock IPC (or getblocktemplate proposal mode). The question asks if “Sv2 TP clients” need to implement this method. Are “pools” and “Sv2 TP clients” the same thing here? I haven&#39;t gone through the Sv2 documentation</span></td></tr></table>
<table class="log-line" id="l-27"><tr class="log-row"><td class="log-lineno"><a href="#l-27">&nbsp;27</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> yet, so I might be missing something obvious.</span></td></tr></table>
<table class="log-line" id="l-28"><tr class="log-row"><td class="log-lineno"><a href="#l-28">&nbsp;28</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> its the Sv2 TP server that has to implement it right?</span></td></tr></table>
<table class="log-line" id="l-29"><tr class="log-row"><td class="log-lineno"><a href="#l-29">&nbsp;29</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> It can still utilize the method provided by Bitcoin Core via IPC</span></td></tr></table>
<table class="log-line" id="l-30"><tr class="log-row"><td class="log-lineno"><a href="#l-30">&nbsp;30</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> yes sebastianvstaa: monlovesmango</span></td></tr></table>
<table class="log-line" id="l-31"><tr class="log-row"><td class="log-lineno"><a href="#l-31">&nbsp;31</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> TP does not need the checkBlock  method, I think it&#39;s the Sv2 server</span></td></tr></table>
<table class="log-line" id="l-32"><tr class="log-row"><td class="log-lineno"><a href="#l-32">&nbsp;32</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Question 2: Can you list some checks performed on the block in getblocktemplate proposal mode? Does that include checking for a valid proof of work for the block template?</span></td></tr></table>
<table class="log-line" id="l-33"><tr class="log-row"><td class="log-lineno"><a href="#l-33">&nbsp;33</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> it seems to check for duplicate and duplicate-invalid blocks</span></td></tr></table>
<table class="log-line" id="l-34"><tr class="log-row"><td class="log-lineno"><a href="#l-34">&nbsp;34</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> block size limit, duplicate transactions</span></td></tr></table>
<table class="log-line" id="l-35"><tr class="log-row"><td class="log-lineno"><a href="#l-35">&nbsp;35</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> POW is not checked</span></td></tr></table>
<table class="log-line" id="l-36"><tr class="log-row"><td class="log-lineno"><a href="#l-36">&nbsp;36</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> Context-free checks like merle root, duplicate txs, block size, …</span></td></tr></table>
<table class="log-line" id="l-37"><tr class="log-row"><td class="log-lineno"><a href="#l-37">&nbsp;37</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> Contextual checks like block time, tx finality, whether block witness data has been tempered with, block weight, …</span></td></tr></table>
<table class="log-line" id="l-38"><tr class="log-row"><td class="log-lineno"><a href="#l-38">&nbsp;38</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> And no valid PoW is checked cause the goal would be start solving the block once the checkBlock passes in getblocktemplate proposal mode.</span></td></tr></table>
<table class="log-line" id="l-39"><tr class="log-row"><td class="log-lineno"><a href="#l-39">&nbsp;39</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> yes, no PoW</span></td></tr></table>
<table class="log-line" id="l-40"><tr class="log-row"><td class="log-lineno"><a href="#l-40">&nbsp;40</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> The idea is to check validity before you spend resources on mining</span></td></tr></table>
<table class="log-line" id="l-41"><tr class="log-row"><td class="log-lineno"><a href="#l-41">&nbsp;41</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> stringintech: very thorough and helpful answer :)</span></td></tr></table>
<table class="log-line" id="l-42"><tr class="log-row"><td class="log-lineno"><a href="#l-42">&nbsp;42</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @stringintech yeah</span></td></tr></table>
<table class="log-line" id="l-43"><tr class="log-row"><td class="log-lineno"><a href="#l-43">&nbsp;43</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> sebastianvstaa: I am not sure if that is correct cc @sjors</span></td></tr></table>
<table class="log-line" id="l-44"><tr class="log-row"><td class="log-lineno"><a href="#l-44">&nbsp;44</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> abubakarsadiq what statement exactly?</span></td></tr></table>
<table class="log-line" id="l-45"><tr class="log-row"><td class="log-lineno"><a href="#l-45">&nbsp;45</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> check validity before mining?</span></td></tr></table>
<table class="log-line" id="l-46"><tr class="log-row"><td class="log-lineno"><a href="#l-46">&nbsp;46</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> your statement &quot;The idea is to check validity before you spend resources on mining&quot;</span></td></tr></table>
<table class="log-line" id="l-47"><tr class="log-row"><td class="log-lineno"><a href="#l-47">&nbsp;47</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> monlovesmango: 🙌🏻</span></td></tr></table>
<table class="log-line" id="l-48"><tr class="log-row"><td class="log-lineno"><a href="#l-48">&nbsp;48</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> what else would you do without PoW?</span></td></tr></table>
<table class="log-line" id="l-49"><tr class="log-row"><td class="log-lineno"><a href="#l-49">&nbsp;49</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> follow-up question why is POW not checked, but we check that the nBits are valid?</span></td></tr></table>
<table class="log-line" id="l-50"><tr class="log-row"><td class="log-lineno"><a href="#l-50">&nbsp;50</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> The next question is</span></td></tr></table>
<table class="log-line" id="l-51"><tr class="log-row"><td class="log-lineno"><a href="#l-51">&nbsp;51</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> 4. Apart from performance reasons mentioned in the PR description, are there any reasons an Sv2 TP client would want to use IPC instead of RPC?</span></td></tr></table>
<table class="log-line" id="l-52"><tr class="log-row"><td class="log-lineno"><a href="#l-52">&nbsp;52</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> Not sure but if clients are already using IPC for mining related functions implementing block verification this way too would be easier.</span></td></tr></table>
<table class="log-line" id="l-53"><tr class="log-row"><td class="log-lineno"><a href="#l-53">&nbsp;53</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> Better integration with the other components in the multiprocess project?</span></td></tr></table>
<table class="log-line" id="l-54"><tr class="log-row"><td class="log-lineno"><a href="#l-54">&nbsp;54</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> is IPC multi threaded? RPC seems to be single threaded, but maybe i&#39;m wrong on that</span></td></tr></table>
<table class="log-line" id="l-55"><tr class="log-row"><td class="log-lineno"><a href="#l-55">&nbsp;55</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> sorry for the delay</span></td></tr></table>
<table class="log-line" id="l-56"><tr class="log-row"><td class="log-lineno"><a href="#l-56">&nbsp;56</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> does IPC expose a port to listen?</span></td></tr></table>
<table class="log-line" id="l-57"><tr class="log-row"><td class="log-lineno"><a href="#l-57">&nbsp;57</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> I think another reason apart from performance I read is that  RPC is poll-based. An Sv2 TP client prefers push-based communication or long-polling, as seen in the waitNext implementation.</span></td></tr></table>
<table class="log-line" id="l-58"><tr class="log-row"><td class="log-lineno"><a href="#l-58">&nbsp;58</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> monlovesmangonot at the moment</span></td></tr></table>
<table class="log-line" id="l-59"><tr class="log-row"><td class="log-lineno"><a href="#l-59">&nbsp;59</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> monlovesmango: not at the moment</span></td></tr></table>
<table class="log-line" id="l-60"><tr class="log-row"><td class="log-lineno"><a href="#l-60">&nbsp;60</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> It listens on a Unix socket</span></td></tr></table>
<table class="log-line" id="l-61"><tr class="log-row"><td class="log-lineno"><a href="#l-61">&nbsp;61</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> Or maybe TPC port support as also been added.</span></td></tr></table>
<table class="log-line" id="l-62"><tr class="log-row"><td class="log-lineno"><a href="#l-62">&nbsp;62</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> stringintech: a pool in stratum v2 is just a pool like now.</span></td></tr></table>
<table class="log-line" id="l-63"><tr class="log-row"><td class="log-lineno"><a href="#l-63">&nbsp;63</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> yay sjors is here!</span></td></tr></table>
<table class="log-line" id="l-64"><tr class="log-row"><td class="log-lineno"><a href="#l-64">&nbsp;64</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> But in Stratum v2 the pool needs to verify that the individual miner is not sending them a fake block.</span></td></tr></table>
<table class="log-line" id="l-65"><tr class="log-row"><td class="log-lineno"><a href="#l-65">&nbsp;65</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> is Unix socket more secure than TPC port? I have no idea why else IPC would be advantageous, just trying to ask questions</span></td></tr></table>
<table class="log-line" id="l-66"><tr class="log-row"><td class="log-lineno"><a href="#l-66">&nbsp;66</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> So the way they could do that currently is to use the getblocktemplate RPC in &quot;proposal&quot; mode, and basically just give it a serialized hex block.</span></td></tr></table>
<table class="log-line" id="l-67"><tr class="log-row"><td class="log-lineno"><a href="#l-67">&nbsp;67</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> monlovesmango: I don&#39;t think the reason is security</span></td></tr></table>
<table class="log-line" id="l-68"><tr class="log-row"><td class="log-lineno"><a href="#l-68">&nbsp;68</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> It&#39;s just that Russ Ryanofsky, who&#39;s been working on multiprocess IPC for many years, added that</span></td></tr></table>
<table class="log-line" id="l-69"><tr class="log-row"><td class="log-lineno"><a href="#l-69">&nbsp;69</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> The next question</span></td></tr></table>
<table class="log-line" id="l-70"><tr class="log-row"><td class="log-lineno"><a href="#l-70">&nbsp;70</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> 5. What is the key difference between contextual and context-free checks in the block template validity checks?</span></td></tr></table>
<table class="log-line" id="l-71"><tr class="log-row"><td class="log-lineno"><a href="#l-71">&nbsp;71</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> It might be a bit more performant.</span></td></tr></table>
<table class="log-line" id="l-72"><tr class="log-row"><td class="log-lineno"><a href="#l-72">&nbsp;72</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:chocolate">&lt;sjors47&gt;</span><span class="log-msg"> Continuing as myself under Sjors[m]</span></td></tr></table>
<table class="log-line" id="l-73"><tr class="log-row"><td class="log-lineno"><a href="#l-73">&nbsp;73</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> If that works</span></td></tr></table>
<table class="log-line" id="l-74"><tr class="log-row"><td class="log-lineno"><a href="#l-74">&nbsp;74</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> It works!</span></td></tr></table>
<table class="log-line" id="l-75"><tr class="log-row"><td class="log-lineno"><a href="#l-75">&nbsp;75</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> contextual check references previous block headers</span></td></tr></table>
<table class="log-line" id="l-76"><tr class="log-row"><td class="log-lineno"><a href="#l-76">&nbsp;76</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> From a high level, the no context checks in CheckBlock don&#39;t have a view of the chainstate, and the contextual checks do</span></td></tr></table>
<table class="log-line" id="l-77"><tr class="log-row"><td class="log-lineno"><a href="#l-77">&nbsp;77</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> context free: can be done without knowledge of blockchain current state</span></td></tr></table>
<table class="log-line" id="l-78"><tr class="log-row"><td class="log-lineno"><a href="#l-78">&nbsp;78</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:coral">&lt;santos&gt;</span><span class="log-msg"> monlovesmango:  Local IPC channels often have lower overhead than TCP and are easy to secure via OS‐provided permissions, but they don’t give you the same out-of-the-box, cryptographic authentication (or optional TLS encryption) that you get if you run over TCP.</span></td></tr></table>
<table class="log-line" id="l-79"><tr class="log-row"><td class="log-lineno"><a href="#l-79">&nbsp;79</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> yep dzxzg</span></td></tr></table>
<table class="log-line" id="l-80"><tr class="log-row"><td class="log-lineno"><a href="#l-80">&nbsp;80</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> correct sebastianvstaa</span></td></tr></table>
<table class="log-line" id="l-81"><tr class="log-row"><td class="log-lineno"><a href="#l-81">&nbsp;81</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> santos: I see thanks!</span></td></tr></table>
<table class="log-line" id="l-82"><tr class="log-row"><td class="log-lineno"><a href="#l-82">&nbsp;82</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> Sjors[m] thanks! the PR description made sense to me; just got a bit lost with Sv2 terminology...</span></td></tr></table>
<table class="log-line" id="l-83"><tr class="log-row"><td class="log-lineno"><a href="#l-83">&nbsp;83</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> is IPC able to process multiple requests at the same time? RPC can&#39;t do that right?</span></td></tr></table>
<table class="log-line" id="l-84"><tr class="log-row"><td class="log-lineno"><a href="#l-84">&nbsp;84</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> stringintech: I don&#39;t have the full log before I entered, so feel free to ask a followup question if I missed somethign</span></td></tr></table>
<table class="log-line" id="l-85"><tr class="log-row"><td class="log-lineno"><a href="#l-85">&nbsp;85</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @sjors question why is POW not checked by the pool, but we check that the nBits are valid?</span></td></tr></table>
<table class="log-line" id="l-86"><tr class="log-row"><td class="log-lineno"><a href="#l-86">&nbsp;86</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> POW ␝is␏ checked by the pool</span></td></tr></table>
<table class="log-line" id="l-87"><tr class="log-row"><td class="log-lineno"><a href="#l-87">&nbsp;87</a></td><td class="log-time">17:23 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> I dropped that check from the earlier version.</span></td></tr></table>
<table class="log-line" id="l-88"><tr class="log-row"><td class="log-lineno"><a href="#l-88">&nbsp;88</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> One bit of context...</span></td></tr></table>
<table class="log-line" id="l-89"><tr class="log-row"><td class="log-lineno"><a href="#l-89">&nbsp;89</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> nBits represents the &quot;real&quot; work that will be in the final block</span></td></tr></table>
<table class="log-line" id="l-90"><tr class="log-row"><td class="log-lineno"><a href="#l-90">&nbsp;90</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> Shares however use a lower amount of work.</span></td></tr></table>
<table class="log-line" id="l-91"><tr class="log-row"><td class="log-lineno"><a href="#l-91">&nbsp;91</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> ohh yeah I locally have the previous version of the PR</span></td></tr></table>
<table class="log-line" id="l-92"><tr class="log-row"><td class="log-lineno"><a href="#l-92">&nbsp;92</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> So the nBits value won&#39;t mach the actual work.</span></td></tr></table>
<table class="log-line" id="l-93"><tr class="log-row"><td class="log-lineno"><a href="#l-93">&nbsp;93</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> Bitcoin Core simply ignores that when checking the template, it doesn&#39;t check the actual work, it only checks the promise of work.</span></td></tr></table>
<table class="log-line" id="l-94"><tr class="log-row"><td class="log-lineno"><a href="#l-94">&nbsp;94</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> So the pool needs to check the actual work in the share and pay rewards accordingly.</span></td></tr></table>
<table class="log-line" id="l-95"><tr class="log-row"><td class="log-lineno"><a href="#l-95">&nbsp;95</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> so the POW is checked by the pool outside of bitcoin core?</span></td></tr></table>
<table class="log-line" id="l-96"><tr class="log-row"><td class="log-lineno"><a href="#l-96">&nbsp;96</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> And the share has enough work for the whole network to accept it, then it immediately gets broadcast (and you get your share payment).</span></td></tr></table>
<table class="log-line" id="l-97"><tr class="log-row"><td class="log-lineno"><a href="#l-97">&nbsp;97</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> monlovesmango: yes</span></td></tr></table>
<table class="log-line" id="l-98"><tr class="log-row"><td class="log-lineno"><a href="#l-98">&nbsp;98</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> One way to describe a &quot;share&quot; would be as a weak block.</span></td></tr></table>
<table class="log-line" id="l-99"><tr class="log-row"><td class="log-lineno"><a href="#l-99">&nbsp;99</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> (extremely weak)</span></td></tr></table>
<table class="log-line" id="l-100"><tr class="log-row"><td class="log-lineno"><a href="#l-100">100</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> thanks @sjors</span></td></tr></table>
<table class="log-line" id="l-101"><tr class="log-row"><td class="log-lineno"><a href="#l-101">101</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> santos: you can even do a unix socket of SSH quite easily</span></td></tr></table>
<table class="log-line" id="l-102"><tr class="log-row"><td class="log-lineno"><a href="#l-102">102</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> * over</span></td></tr></table>
<table class="log-line" id="l-103"><tr class="log-row"><td class="log-lineno"><a href="#l-103">103</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> next question</span></td></tr></table>
<table class="log-line" id="l-104"><tr class="log-row"><td class="log-lineno"><a href="#l-104">104</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Is there a change in behavior for TestBlockValidity after this PR, or is it a pure refactor? If yes, what’s the change?</span></td></tr></table>
<table class="log-line" id="l-105"><tr class="log-row"><td class="log-lineno"><a href="#l-105">105</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> yes. Returns a boolean value and a string instead in BlockVAlidationState object</span></td></tr></table>
<table class="log-line" id="l-106"><tr class="log-row"><td class="log-lineno"><a href="#l-106">106</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:violet">&lt;sebastianvstaa&gt;</span><span class="log-msg"> but I wonder why? Why a string instead of a state enum? Seems cumbersome</span></td></tr></table>
<table class="log-line" id="l-107"><tr class="log-row"><td class="log-lineno"><a href="#l-107">107</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> It also no longer logs block invalidity reasons as errors</span></td></tr></table>
<table class="log-line" id="l-108"><tr class="log-row"><td class="log-lineno"><a href="#l-108">108</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> I thought it always returned bool?</span></td></tr></table>
<table class="log-line" id="l-109"><tr class="log-row"><td class="log-lineno"><a href="#l-109">109</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> i noticed two main changes; the error handling and the CheckBlock (a context-free check) which is called before the contextual header check.</span></td></tr></table>
<table class="log-line" id="l-110"><tr class="log-row"><td class="log-lineno"><a href="#l-110">110</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> and i guess the second one could be considered a behavioral change.</span></td></tr></table>
<table class="log-line" id="l-111"><tr class="log-row"><td class="log-lineno"><a href="#l-111">111</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> BlockVAlidationState required a bunch of custom code to serialize over IPC</span></td></tr></table>
<table class="log-line" id="l-112"><tr class="log-row"><td class="log-lineno"><a href="#l-112">112</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @sebastianvstaa: Is that a behavior change?</span></td></tr></table>
<table class="log-line" id="l-113"><tr class="log-row"><td class="log-lineno"><a href="#l-113">113</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> I think it&#39;s the same return values we get previously just in another as boolean and strings now</span></td></tr></table>
<table class="log-line" id="l-114"><tr class="log-row"><td class="log-lineno"><a href="#l-114">114</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:coral">&lt;santos&gt;</span><span class="log-msg"> context-free checks (CheckBlock) are done first now</span></td></tr></table>
<table class="log-line" id="l-115"><tr class="log-row"><td class="log-lineno"><a href="#l-115">115</a></td><td class="log-time">17:29 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> monlovesmango: <a href="https://github.com/bitcoin/bitcoin/blob/14b8dfb2bd5e2ca2b7c0c9a7f7d50e1e60adf75c/src/rpc/mining.cpp#L725-L766" target="blank">https://github.com/bitcoin/bitcoin/blob/14b8dfb2bd5e2ca2b7c0c9a7f7d50e1e60adf75c/src/rpc/mining.cpp#L725-L766</a></span></td></tr></table>
<table class="log-line" id="l-116"><tr class="log-row"><td class="log-lineno"><a href="#l-116">116</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @sjors this brings us to another question  In commit cca5993b, can you clarify the note that serialization of BlockValidationState is “fragile”?</span></td></tr></table>
<table class="log-line" id="l-117"><tr class="log-row"><td class="log-lineno"><a href="#l-117">117</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> I didn&#39;t write that note :-)</span></td></tr></table>
<table class="log-line" id="l-118"><tr class="log-row"><td class="log-lineno"><a href="#l-118">118</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> I just saw it as an excuse to delete it.</span></td></tr></table>
<table class="log-line" id="l-119"><tr class="log-row"><td class="log-lineno"><a href="#l-119">119</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> :D</span></td></tr></table>
<table class="log-line" id="l-120"><tr class="log-row"><td class="log-lineno"><a href="#l-120">120</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> For historical background how this PR came about...</span></td></tr></table>
<table class="log-line" id="l-121"><tr class="log-row"><td class="log-lineno"><a href="#l-121">121</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> I initially didn&#39;t know about the proposal mode</span></td></tr></table>
<table class="log-line" id="l-122"><tr class="log-row"><td class="log-lineno"><a href="#l-122">122</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> So I ended up implementing all these checks and then realize it was duplicate work</span></td></tr></table>
<table class="log-line" id="l-123"><tr class="log-row"><td class="log-lineno"><a href="#l-123">123</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> yeah I could not answer that as well maybe @ryanofsky can help here.</span></td></tr></table>
<table class="log-line" id="l-124"><tr class="log-row"><td class="log-lineno"><a href="#l-124">124</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> So then I gradually changed my implementation to be closer to the original.</span></td></tr></table>
<table class="log-line" id="l-125"><tr class="log-row"><td class="log-lineno"><a href="#l-125">125</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> So may be that my initial design just used a boolean return with a string message.</span></td></tr></table>
<table class="log-line" id="l-126"><tr class="log-row"><td class="log-lineno"><a href="#l-126">126</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> I&#39;m not too familiar with the IPC interface, but is serialization of complex C++ types a problem in general?</span></td></tr></table>
<table class="log-line" id="l-127"><tr class="log-row"><td class="log-lineno"><a href="#l-127">127</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> But it had the benefit of not needing that BlockValidationState struct, so I kept it.</span></td></tr></table>
<table class="log-line" id="l-128"><tr class="log-row"><td class="log-lineno"><a href="#l-128">128</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> The next question is</span></td></tr></table>
<table class="log-line" id="l-129"><tr class="log-row"><td class="log-lineno"><a href="#l-129">129</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> One of the reasons for locking `cs_main` in `TestBlockValidity` is to prevent `CheckBlock` race conditions. Can you describe a scenario when that might happen?</span></td></tr></table>
<table class="log-line" id="l-130"><tr class="log-row"><td class="log-lineno"><a href="#l-130">130</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> dzxzg: not sure about &quot;complex&quot; but basically every type has its own serialization logic.</span></td></tr></table>
<table class="log-line" id="l-131"><tr class="log-row"><td class="log-lineno"><a href="#l-131">131</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> With some &quot;universal&quot; things like byte spans.</span></td></tr></table>
<table class="log-line" id="l-132"><tr class="log-row"><td class="log-lineno"><a href="#l-132">132</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> So anything that can be serialzed on the p2p network can be handled in a similar way with no extra IPC code.</span></td></tr></table>
<table class="log-line" id="l-133"><tr class="log-row"><td class="log-lineno"><a href="#l-133">133</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> But BlockValidationState is an internal type, so there&#39;s no serialization for it.</span></td></tr></table>
<table class="log-line" id="l-134"><tr class="log-row"><td class="log-lineno"><a href="#l-134">134</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> if checkblock is called for multiple blocks?</span></td></tr></table>
<table class="log-line" id="l-135"><tr class="log-row"><td class="log-lineno"><a href="#l-135">135</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> See this commit for how it was serialized: <a href="https://github.com/bitcoin/bitcoin/pull/31981/commits/9822bd64d26ca056c0fe44e5e2b3e1f38e6021ef" target="blank">https://github.com/bitcoin/bitcoin/pull/31981/commits/9822bd64d26ca056c0fe44e5e2b3e1f38e6021ef</a></span></td></tr></table>
<table class="log-line" id="l-136"><tr class="log-row"><td class="log-lineno"><a href="#l-136">136</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> monlovesmango: one block at a time</span></td></tr></table>
<table class="log-line" id="l-137"><tr class="log-row"><td class="log-lineno"><a href="#l-137">137</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> But potentially extremely frequently.</span></td></tr></table>
<table class="log-line" id="l-138"><tr class="log-row"><td class="log-lineno"><a href="#l-138">138</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> aren&#39;t we working with a fresh instance of a block each time we get into TestBlockValidity?</span></td></tr></table>
<table class="log-line" id="l-139"><tr class="log-row"><td class="log-lineno"><a href="#l-139">139</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> So the main reason for the refactor is to drop the `CustomBuildMessage()` logic for BlockValidationState</span></td></tr></table>
<table class="log-line" id="l-140"><tr class="log-row"><td class="log-lineno"><a href="#l-140">140</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> Let&#39;s say you&#39;re a pool and there&#39;s 10000 miners that are each proposing a new block every 1 second... and you want to check them all...</span></td></tr></table>
<table class="log-line" id="l-141"><tr class="log-row"><td class="log-lineno"><a href="#l-141">141</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> That would probably crash the node :-)</span></td></tr></table>
<table class="log-line" id="l-142"><tr class="log-row"><td class="log-lineno"><a href="#l-142">142</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> But you spin up multiple nodes to distribute the checking work.</span></td></tr></table>
<table class="log-line" id="l-143"><tr class="log-row"><td class="log-lineno"><a href="#l-143">143</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @monlovesmango: what do you mean by &quot;called for multiple blocks? &quot;</span></td></tr></table>
<table class="log-line" id="l-144"><tr class="log-row"><td class="log-lineno"><a href="#l-144">144</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> stringintech: yes</span></td></tr></table>
<table class="log-line" id="l-145"><tr class="log-row"><td class="log-lineno"><a href="#l-145">145</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> that checkblock is called for different block candidates that are found very close in time</span></td></tr></table>
<table class="log-line" id="l-146"><tr class="log-row"><td class="log-lineno"><a href="#l-146">146</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @sjors is it possible we receive the same block from the P2P network and are trying to validate and update its state, while simultaneously calling getblocktemplate in proposal mode with same block. that would cause a race no?</span></td></tr></table>
<table class="log-line" id="l-147"><tr class="log-row"><td class="log-lineno"><a href="#l-147">147</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> Sjors[m]: So we only need to slow things down here (implicitly create a queue)?</span></td></tr></table>
<table class="log-line" id="l-148"><tr class="log-row"><td class="log-lineno"><a href="#l-148">148</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> abubakarsadiq: yes all that can happen at the same time</span></td></tr></table>
<table class="log-line" id="l-149"><tr class="log-row"><td class="log-lineno"><a href="#l-149">149</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> Even without this feature, I ran into the problem with Stratum v2 that we braodcast our own blocks now.</span></td></tr></table>
<table class="log-line" id="l-150"><tr class="log-row"><td class="log-lineno"><a href="#l-150">150</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> At the same time the pool is also broadcasting it</span></td></tr></table>
<table class="log-line" id="l-151"><tr class="log-row"><td class="log-lineno"><a href="#l-151">151</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> So you can have a race where we receive a block over p2p (coming from the pool) and we&#39;re publishing one ourselves.</span></td></tr></table>
<table class="log-line" id="l-152"><tr class="log-row"><td class="log-lineno"><a href="#l-152">152</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> I believe I took care of those races.</span></td></tr></table>
<table class="log-line" id="l-153"><tr class="log-row"><td class="log-lineno"><a href="#l-153">153</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> monlovesmango: I don&#39;t think that will cause a race since they are not identical blocks, even if they are identical correct me if I am wrong @sjors. `TestBlockValidity` does not save the block so a race will not happen no?</span></td></tr></table>
<table class="log-line" id="l-154"><tr class="log-row"><td class="log-lineno"><a href="#l-154">154</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> Now with checkBlock we never broadcast it.</span></td></tr></table>
<table class="log-line" id="l-155"><tr class="log-row"><td class="log-lineno"><a href="#l-155">155</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> abubakarsadiq: gotcha, thanks</span></td></tr></table>
<table class="log-line" id="l-156"><tr class="log-row"><td class="log-lineno"><a href="#l-156">156</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> Why does the PR move responsibility for locking cs_main from the caller to testblockvalidity</span></td></tr></table>
<table class="log-line" id="l-157"><tr class="log-row"><td class="log-lineno"><a href="#l-157">157</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:coral">&lt;santos&gt;</span><span class="log-msg"> So now is checkBlock() called when the node receiver a new block or when the pool receives a new block template proposal ? Is this correct ?</span></td></tr></table>
<table class="log-line" id="l-158"><tr class="log-row"><td class="log-lineno"><a href="#l-158">158</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> when called via getblocktemplate in proposal mode</span></td></tr></table>
<table class="log-line" id="l-159"><tr class="log-row"><td class="log-lineno"><a href="#l-159">159</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> The blocking of cs_main however is of course not good for the pool if they&#39;re trying to stay up to date.</span></td></tr></table>
<table class="log-line" id="l-160"><tr class="log-row"><td class="log-lineno"><a href="#l-160">160</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> So probably they should run these checks on different nodes than they use for contructing their own (default) block.</span></td></tr></table>
<table class="log-line" id="l-161"><tr class="log-row"><td class="log-lineno"><a href="#l-161">161</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Lets move to the next question</span></td></tr></table>
<table class="log-line" id="l-162"><tr class="log-row"><td class="log-lineno"><a href="#l-162">162</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> In commit 1d029c23, why do we assert that `fChecked` should return `false`? Is this a potential issue?</span></td></tr></table>
<table class="log-line" id="l-163"><tr class="log-row"><td class="log-lineno"><a href="#l-163">163</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> abubakarsadiq: I thought so (regarding your explaination race condition for identical blocks) but i noticed in the code that may be worried about a race condition on fChecked flag; which i could not understand why.</span></td></tr></table>
<table class="log-line" id="l-164"><tr class="log-row"><td class="log-lineno"><a href="#l-164">164</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> santos: when the pool receives a block _proposal_</span></td></tr></table>
<table class="log-line" id="l-165"><tr class="log-row"><td class="log-lineno"><a href="#l-165">165</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Note: this is in an earlier version of the PR</span></td></tr></table>
<table class="log-line" id="l-166"><tr class="log-row"><td class="log-lineno"><a href="#l-166">166</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> I was going to say, I dropped some of those checks.</span></td></tr></table>
<table class="log-line" id="l-167"><tr class="log-row"><td class="log-lineno"><a href="#l-167">167</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> stringintech: I mentioned that will not be an issue for identical blocks when called via the RPC because we dont save the state.</span></td></tr></table>
<table class="log-line" id="l-168"><tr class="log-row"><td class="log-lineno"><a href="#l-168">168</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> yeah @sjors to answer the question myself I was a bit confused by the assertion. I believe it is an issue we should return instead. We might attempt to check a block that we already received via P2P and stored it&#39;s state.</span></td></tr></table>
<table class="log-line" id="l-169"><tr class="log-row"><td class="log-lineno"><a href="#l-169">169</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> Mmm, one of the first checks if fChecked</span></td></tr></table>
<table class="log-line" id="l-170"><tr class="log-row"><td class="log-lineno"><a href="#l-170">170</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> block.hashPrevBlock != *Assert(tip-&gt;phashBlock)</span></td></tr></table>
<table class="log-line" id="l-171"><tr class="log-row"><td class="log-lineno"><a href="#l-171">171</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> And we&#39;ve locked m_chainman by then</span></td></tr></table>
<table class="log-line" id="l-172"><tr class="log-row"><td class="log-lineno"><a href="#l-172">172</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> abubakarsadiq: yes i understand that. which is why i didnt get why we are worried about the fChecked race condition (not sure if i read this in the code comments or commit description or ...)</span></td></tr></table>
<table class="log-line" id="l-173"><tr class="log-row"><td class="log-lineno"><a href="#l-173">173</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> This assertion ` Assert(!block.fChecked);`</span></td></tr></table>
<table class="log-line" id="l-174"><tr class="log-row"><td class="log-lineno"><a href="#l-174">174</a></td><td class="log-time">17:46 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> I initially wrote some assert and assume statement to sanity check my own changes.</span></td></tr></table>
<table class="log-line" id="l-175"><tr class="log-row"><td class="log-lineno"><a href="#l-175">175</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> But this was a few months ago, so I don&#39;t remember either why that particular assert.</span></td></tr></table>
<table class="log-line" id="l-176"><tr class="log-row"><td class="log-lineno"><a href="#l-176">176</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> And it&#39;s gone now.</span></td></tr></table>
<table class="log-line" id="l-177"><tr class="log-row"><td class="log-lineno"><a href="#l-177">177</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> It seems like avoiding BlockValidationState is a nice win for the IPC interface, but it would be nice for internal users of `TestBlockValidity` to have the enum... I wonder  the refactor would be simpler if testblockvalidity remained mostly as is and you placed a little wrapper around TestBlockValidity, that returns a bool and modifies the passed</span></td></tr></table>
<table class="log-line" id="l-178"><tr class="log-row"><td class="log-lineno"><a href="#l-178">178</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> It is in this commit <a href="https://github.com/bitcoin-core-review-club/bitcoin/blob/1d029c23a143f1b9110377967a7c4a20ee75058d/src/validation.cpp#L4662" target="blank">https://github.com/bitcoin-core-review-club/bitcoin/blob/1d029c23a143f1b9110377967a7c4a20ee75058d/src/validation.cpp#L4662</a></span></td></tr></table>
<table class="log-line" id="l-179"><tr class="log-row"><td class="log-lineno"><a href="#l-179">179</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> in strings,</span></td></tr></table>
<table class="log-line" id="l-180"><tr class="log-row"><td class="log-lineno"><a href="#l-180">180</a></td><td class="log-time">17:48 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> so can someone summarize what race condition we are trying to prevent when locking `cs_main` in `TestBlockValidity`?</span></td></tr></table>
<table class="log-line" id="l-181"><tr class="log-row"><td class="log-lineno"><a href="#l-181">181</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> monlovesmango: 👍</span></td></tr></table>
<table class="log-line" id="l-182"><tr class="log-row"><td class="log-lineno"><a href="#l-182">182</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Final Question In this  <a href="https://github.com/bitcoin/bitcoin/blob/9efe5466885862bc1fb830524f7ce23e785fcac0/src/validation.cpp#L4078" target="blank">https://github.com/bitcoin/bitcoin/blob/9efe5466885862bc1fb830524f7ce23e785fcac0/src/validation.cpp#L4078</a> `CheckBlock` size check, which size rule are we checking? Is it an overestimate check? Which size check is missing there?</span></td></tr></table>
<table class="log-line" id="l-183"><tr class="log-row"><td class="log-lineno"><a href="#l-183">183</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> I understand the lock is needed to prevent tip from updating, but want to understand the race condition element too</span></td></tr></table>
<table class="log-line" id="l-184"><tr class="log-row"><td class="log-lineno"><a href="#l-184">184</a></td><td class="log-time">17:50 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> dzxzg: what will be the benefit of that, how will the enum be useful, is not the same as the boolean output?</span></td></tr></table>
<table class="log-line" id="l-185"><tr class="log-row"><td class="log-lineno"><a href="#l-185">185</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> abubakarsadiq: Witness data is excluded when performing the check, but later in ContextualCheckBlock we consider it (block weight check).</span></td></tr></table>
<table class="log-line" id="l-186"><tr class="log-row"><td class="log-lineno"><a href="#l-186">186</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> I didn&#39;t quite undertand the size check logic, but looks like validating there are txs, and that it doesn&#39;t exceed max block size</span></td></tr></table>
<table class="log-line" id="l-187"><tr class="log-row"><td class="log-lineno"><a href="#l-187">187</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> stringintech: we also do weight check there but why is it not enough?</span></td></tr></table>
<table class="log-line" id="l-188"><tr class="log-row"><td class="log-lineno"><a href="#l-188">188</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> abubakarsadiq: Every caller of TestBlockValidity cares about two things: Was it valid? If not, what was the reason? That is solved in a precise and reusable way with an enum. It seems to me that only the ipc interface suffers from the awkardness of packing and serializing all of this over the wire.</span></td></tr></table>
<table class="log-line" id="l-189"><tr class="log-row"><td class="log-lineno"><a href="#l-189">189</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> monlovesmango: same also I don’t understand the second check: `block.vtx.size() * WITNESS_SCALE_FACTOR &gt; MAX_BLOCK_WEIGHT`</span></td></tr></table>
<table class="log-line" id="l-190"><tr class="log-row"><td class="log-lineno"><a href="#l-190">190</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> dzxzg: the caller ultimately only gets a BIP22 string</span></td></tr></table>
<table class="log-line" id="l-191"><tr class="log-row"><td class="log-lineno"><a href="#l-191">191</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> This was is the case the getblocktemplate RPC too.</span></td></tr></table>
<table class="log-line" id="l-192"><tr class="log-row"><td class="log-lineno"><a href="#l-192">192</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> Enum is used internally.</span></td></tr></table>
<table class="log-line" id="l-193"><tr class="log-row"><td class="log-lineno"><a href="#l-193">193</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:tomato">&lt;dzxzg&gt;</span><span class="log-msg"> By caller I mean internal users</span></td></tr></table>
<table class="log-line" id="l-194"><tr class="log-row"><td class="log-lineno"><a href="#l-194">194</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> Remember that RPC uses JSON, which is even worse in terms of what you can serialize</span></td></tr></table>
<table class="log-line" id="l-195"><tr class="log-row"><td class="log-lineno"><a href="#l-195">195</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:cadetblue">&lt;stringintech&gt;</span><span class="log-msg"> abubakarsadiq: if you mean why CheckBlock size check is not enough because we are not considering witness data and until we are sure the witness data is not tempered with in ContextualCheckBlock we can not check it?</span></td></tr></table>
<table class="log-line" id="l-196"><tr class="log-row"><td class="log-lineno"><a href="#l-196">196</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> dzxzg: true</span></td></tr></table>
<table class="log-line" id="l-197"><tr class="log-row"><td class="log-lineno"><a href="#l-197">197</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Yeah I think it is an overestimate check for the weight that enable us to fail fast when  the non-witness block weight exceed the maximum block weight.</span></td></tr></table>
<table class="log-line" id="l-198"><tr class="log-row"><td class="log-lineno"><a href="#l-198">198</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> But yeah we do check the witness weight as well</span></td></tr></table>
<table class="log-line" id="l-199"><tr class="log-row"><td class="log-lineno"><a href="#l-199">199</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:darkcyan">&lt;monlovesmango&gt;</span><span class="log-msg"> I can understand not using teh enum if we are actually getting rid of the enum altogether. but if the enum is going to continue to exists it seems better to use the enum for consistency</span></td></tr></table>
<table class="log-line" id="l-200"><tr class="log-row"><td class="log-lineno"><a href="#l-200">200</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> dzxzg: Russ also suggested in his recent review to keep the enum, but I&#39;m not entirely sure why yet: <a href="https://github.com/bitcoin/bitcoin/pull/31981#discussion_r2035713597" target="blank">https://github.com/bitcoin/bitcoin/pull/31981#discussion_r2035713597</a></span></td></tr></table>
<table class="log-line" id="l-201"><tr class="log-row"><td class="log-lineno"><a href="#l-201">201</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:cornflowerblue">&lt;Sjors[m]&gt;</span><span class="log-msg"> So maybe it&#39;ll come back, we&#39;ll see</span></td></tr></table>
<table class="log-line" id="l-202"><tr class="log-row"><td class="log-lineno"><a href="#l-202">202</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:steelblue">&lt;abubakarsadiq&gt;</span><span class="log-msg"> #endmeeting </span></td></tr></table>]]></content><author><name>Sjors</name></author><summary type="html"><![CDATA[Notes]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bitcoincore.reviews/assets/img/twitter_card.png" /><media:content medium="image" url="https://bitcoincore.reviews/assets/img/twitter_card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Cluster mempool: add txgraph diagrams/mining/eviction</title><link href="https://bitcoincore.reviews/31444" rel="alternate" type="text/html" title="Cluster mempool: add txgraph diagrams/mining/eviction" /><published>2025-04-23T00:00:00+00:00</published><updated>2025-04-23T00:00:00+00:00</updated><id>https://bitcoincore.reviews/#31444</id><content type="html" xml:base="https://bitcoincore.reviews/31444"><![CDATA[<h2 id="notes">Notes</h2>

<h3 id="motivations-and-background">Motivations and Background</h3>
<ul>
  <li>Block building (done by the
<a href="https://github.com/bitcoin/bitcoin/blob/cdc32994feadf3f15df3cfac5baae36b4b011462/src/node/miner.h#L145"><code class="language-plaintext highlighter-rouge">BlockAssembler</code></a>)
is the process of selecting ~4MWU worth of mempool transactions while trying to maximize the total fees.</li>
  <li>Non-mining nodes might never use the block builder, but are still interested in comparing the incentive compatibility
of transactions as a metric for whether it is worth keeping: if the mempool exceeds its maximum memory allowance, it
should evict the transactions that are least likely to be mined soon.</li>
  <li>The <a href="https://github.com/bitcoin/bitcoin/blob/cdc32994feadf3f15df3cfac5baae36b4b011462/src/node/miner.cpp#L296">block building algorithm</a>
on master uses ancestor set-based sort to dynamically linearize mempool transactions by including ancestor sets in order of
highest <strong>ancestor score</strong> (minimum between ancestor feerate and individual feerate). As transactions are included,
their descendants’ ancestor scores can change; the <code class="language-plaintext highlighter-rouge">BlockAssembler</code> keeps a copy of mempool entries with their updated
ancestor information in a separate map, which avoids modifying the mempool itself. We covered this algorithm in more
detail in a <a href="/26152">previous meeting</a>.</li>
  <li>Ancestor set-based sorting can be used to linearize the entire mempool to find the “worst” transaction for eviction,
but this algorithm would be too slow to use in practice.</li>
  <li>Instead, eviction runs a similar algorithm with ascending <strong>descendant score</strong> (maximum between descendant
feerate and individual feerate). This also linearizes transactions in an approximate order of least to most likely
to be mined, but the linearization is not exactly opposite to the result of ancestor set-based sorting. This asymmetry
is problematic:
    <ul>
      <li>What if the first transaction selected for eviction is also the transaction that would be selected first for
mining?</li>
      <li>Similarly, what if we have transactions that are “junk” (e.g. fall below the node’s configured <code class="language-plaintext highlighter-rouge">-blockmintxfee</code>
and would thus never be selected for mining) but can’t be kicked out because they have a high descendant score?
  This mempool limitation necessitated the requirement that package transactions be above the minimum relay feerate
(see <a href="https://github.com/bitcoin/bitcoin/pull/26933">PR #26933</a>).</li>
    </ul>
  </li>
  <li>Due to similar limitations, Replace-by-Fee code cannot properly determine whether the proposed replacement(s) are more incentive compatible, so
it uses approximations like individual feerate comparisons. These imperfect heuristics are a major cause of pinning problems and
fee-bumping inefficiencies.</li>
  <li>The <a href="https://github.com/bitcoin/bitcoin/issues/27677#eviction-mining-not-opposite">main motivations</a> for
<a href="https://bitcoinops.org/en/topics/cluster-mempool/">cluster mempool</a> are to address these problems.</li>
</ul>

<h3 id="txgraph">TxGraph</h3>
<ul>
  <li>We have reviewed <code class="language-plaintext highlighter-rouge">TxGraph</code> basic functionality in a previous <a href="/31363">meeting</a>. If <code class="language-plaintext highlighter-rouge">TxGraph</code> is new to you, the host
recommends reading some of those notes and getting a feel for <code class="language-plaintext highlighter-rouge">TxGraph</code> by reviewing <code class="language-plaintext highlighter-rouge">SimTxGraph</code> in the fuzzer, which
has similar functionality but a far simpler design:
    <ul>
      <li>It uses a single <code class="language-plaintext highlighter-rouge">DepGraph</code> to represent all transactions across all clusters, which means it doesn’t need to implement merges or track much information about the set of clusters.</li>
      <li>It implements the staging level by creating a copy of main and deleting either the main or the staging to commit or abort staged changes. This approach is much more memory and CPU-intensive, but doesn’t need to track the differences between the levels.</li>
    </ul>
  </li>
  <li>A cluster mempool essentially keeps the entire mempool linearized at all times (lazily using <code class="language-plaintext highlighter-rouge">TxGraph</code>), which
makes it easy to quickly determine a transaction’s linearization position (including what the highest and lowest
transactions are) and compare the current mempool with a potential one.</li>
  <li><a href="https://github.com/bitcoin/bitcoin/pull/31444">PR #31444</a> adds <code class="language-plaintext highlighter-rouge">TxGraph</code> functionality for these purposes:
    <ul>
      <li><code class="language-plaintext highlighter-rouge">TxGraph</code> adds a chunk index, a total ordering of all chunks in the graph across all clusters. A
<a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/3429e9d79df1336cf1d0a61cb5f9bf028aa860b2#diff-c25ebcc6e4dc9c9bb21462f796fbb470cee3f0ff1e77bfc4033f4e8460f4482cR282"><code class="language-plaintext highlighter-rouge">ChunkOrder</code>
comparator</a>
defines the order in which chunks would be mined.</li>
      <li><code class="language-plaintext highlighter-rouge">BlockBuilder</code> can just iterate through the chunks in order. Also, since a total orderering of all graph entries
exists, we can get the “least likely to be mined” transaction without building a full mempool worth of block
templates: simply take the last chunk in the index.</li>
      <li><code class="language-plaintext highlighter-rouge">TxGraph</code> exposes a <code class="language-plaintext highlighter-rouge">BlockBuilder</code> to iterate over the chunks from best to worst. <code class="language-plaintext highlighter-rouge">BlockBuilder</code> can <code class="language-plaintext highlighter-rouge">Skip</code> chunks (i.e.
if they are too large to fit in the remaining block space), and those chunks’ descendants will be subsequently
skipped as well.</li>
      <li><code class="language-plaintext highlighter-rouge">TxGraph</code> also exposes a <code class="language-plaintext highlighter-rouge">GetWorstMainChunk</code> method to identify the transactions that would be included in a block last.</li>
    </ul>
  </li>
  <li>The PR also adds a <code class="language-plaintext highlighter-rouge">GetMainStagingDiagrams</code> method to make it possible to compare the feerate diagram of the <code class="language-plaintext highlighter-rouge">TxGraph</code>
with and without its staged changes.
    <ul>
      <li><a href="https://delvingbitcoin.org/t/cluster-mempool-rbf-thoughts/156">This Delving post</a> discusses the theory behind
evaluating replacements using feerate diagrams.</li>
      <li>Feerate diagram comparison is already used <a href="https://github.com/bitcoin/bitcoin/blob/06f9ead9f957e74ada6afcbdd391a24bc78f5f8a/src/policy/rbf.cpp#L187-L200">in package RBF</a>. Package RBF is limited to clusters of size 2, which are easy to linearize even without cluster mempool.</li>
    </ul>
  </li>
</ul>

<h2 id="questions">Questions</h2>

<ol>
  <li>Did you review the PR? <a href="https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#peer-review">Concept ACK, approach ACK, tested ACK, or NACK</a>? What was your review approach?</li>
  <li>Why are block building and eviction relevant to each other? Wouldn’t it be easier to evict transactions by the order
they entered the mempool?</li>
  <li>True / false: if all clusters are singletons (have 1 transaction each), <code class="language-plaintext highlighter-rouge">m_main_chunkindex</code> would just be sorting
the transactions by feerate.</li>
  <li>In English, using the approach in this PR, what is the algorithm for selecting transactions in order for block building? And for eviction?</li>
  <li>How would a client of <code class="language-plaintext highlighter-rouge">BlockBuilder</code> use it to build a block? When would <code class="language-plaintext highlighter-rouge">GetCurrentChunk</code>, <code class="language-plaintext highlighter-rouge">Include</code>, and <code class="language-plaintext highlighter-rouge">Skip</code> be called?</li>
  <li>What is the expected lifetime of <code class="language-plaintext highlighter-rouge">BlockBuilder</code> (is it similar to <code class="language-plaintext highlighter-rouge">CTxMemPool</code>’s or very different)?</li>
  <li>Can you create a <code class="language-plaintext highlighter-rouge">BlockBuilder</code> when staging exists? Can you build a block using the <code class="language-plaintext highlighter-rouge">TxGraph</code>’s state with its staged changes?</li>
  <li>Does <code class="language-plaintext highlighter-rouge">BlockBuilder</code> modify <code class="language-plaintext highlighter-rouge">TxGraph</code> (a “yes and no”-style answer is ok)?</li>
  <li>Why does <code class="language-plaintext highlighter-rouge">BlockBuilder</code> need to remember the set of skipped transactions? Why can it be represented as a set of Clusters?</li>
  <li><a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/3429e9d79df1336cf1d0a61cb5f9bf028aa860b2">This commit</a>
adds new fields in data structures that need to point to each other: <code class="language-plaintext highlighter-rouge">Entry</code> now contains an iterator to the
transaction’s <code class="language-plaintext highlighter-rouge">ChunkData</code> in <code class="language-plaintext highlighter-rouge">m_main_chunkindex</code>, and <code class="language-plaintext highlighter-rouge">ChunkData</code> refrence <code class="language-plaintext highlighter-rouge">Entry</code>s by their position in <code class="language-plaintext highlighter-rouge">m_entries</code>. In
your review, how did you check that these pointers are always kept up-to-date?</li>
  <li>Conceptually, what are all the ways that an entry’s chunk index can change?</li>
  <li>In the <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/3429e9d79df1336cf1d0a61cb5f9bf028aa860b2#diff-c25ebcc6e4dc9c9bb21462f796fbb470cee3f0ff1e77bfc4033f4e8460f4482cR288"><code class="language-plaintext highlighter-rouge">ChunkOrder</code> comparator</a>,
when <code class="language-plaintext highlighter-rouge">cmp_feerate != 0</code>, why can it be returned directly without comparing position within the cluster?</li>
  <li><code class="language-plaintext highlighter-rouge">m_main_chunkindex_observers</code> indicates the existence of a<code class="language-plaintext highlighter-rouge">BlockBuilder</code>. Why is it an integer instead of a boolean?</li>
  <li>This
<a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/b363f261b099d44b1e19d73d983f4f84e1e3d5f8#diff-c25ebcc6e4dc9c9bb21462f796fbb470cee3f0ff1e77bfc4033f4e8460f4482cR2394">call</a>
to <code class="language-plaintext highlighter-rouge">GetClusterRefs</code> gets the vector of <code class="language-plaintext highlighter-rouge">Ref</code>s corresponding to the chunk. Why are the arguments <code class="language-plaintext highlighter-rouge">ret.first</code> and
<code class="language-plaintext highlighter-rouge">start_pos = chunk_end_entry.m_main_lin_index + 1 - chunk_data.m_chunk_count</code> correct?</li>
  <li>Continuing from the last question, why is <code class="language-plaintext highlighter-rouge">std::reverse</code> called on the result?</li>
  <li>What is <code class="language-plaintext highlighter-rouge">GetMainStagingDiagrams</code> useful for? Why might we exclude the clusters that are identical in main and staging?</li>
</ol>

<h2 id="meeting-log">Meeting Log</h2>

<table class="log-line" id="l-1"><tr class="log-row"><td class="log-lineno"><a href="#l-1">&nbsp;&nbsp;1</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> #startmeeting </span></td></tr></table>
<table class="log-line" id="l-2"><tr class="log-row"><td class="log-lineno"><a href="#l-2">&nbsp;&nbsp;2</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> glozow: Meeting started at 2025-04-23T17:00+0000</span></td></tr></table>
<table class="log-line" id="l-3"><tr class="log-row"><td class="log-lineno"><a href="#l-3">&nbsp;&nbsp;3</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> glozow: Current chairs: glozow</span></td></tr></table>
<table class="log-line" id="l-4"><tr class="log-row"><td class="log-lineno"><a href="#l-4">&nbsp;&nbsp;4</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> glozow: Useful commands: #action #info #idea #link #topic #motion #vote #close #endmeeting</span></td></tr></table>
<table class="log-line" id="l-5"><tr class="log-row"><td class="log-lineno"><a href="#l-5">&nbsp;&nbsp;5</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> glozow: See also: <a href="https://hcoop-meetbot.readthedocs.io/en/stable/" target="blank">https://hcoop-meetbot.readthedocs.io/en/stable/</a></span></td></tr></table>
<table class="log-line" id="l-6"><tr class="log-row"><td class="log-lineno"><a href="#l-6">&nbsp;&nbsp;6</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:peru">&lt;corebot&gt;</span><span class="log-msg"> glozow: Participants should now identify themselves with &#39;#here&#39; or with an alias like &#39;#here FirstLast&#39;</span></td></tr></table>
<table class="log-line" id="l-7"><tr class="log-row"><td class="log-lineno"><a href="#l-7">&nbsp;&nbsp;7</a></td><td class="log-time">17:00 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> hello!</span></td></tr></table>
<table class="log-line" id="l-8"><tr class="log-row"><td class="log-lineno"><a href="#l-8">&nbsp;&nbsp;8</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Welcome to PR review club! Today is txgraph round 2, notes are available here: <a href="https://bitcoincore.reviews/31444" target="blank">https://bitcoincore.reviews/31444</a></span></td></tr></table>
<table class="log-line" id="l-9"><tr class="log-row"><td class="log-lineno"><a href="#l-9">&nbsp;&nbsp;9</a></td><td class="log-time">17:01 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Did anybody have a chance to review the PR or the notes?</span></td></tr></table>
<table class="log-line" id="l-10"><tr class="log-row"><td class="log-lineno"><a href="#l-10">&nbsp;10</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> I am in the process of reviewing the PR</span></td></tr></table>
<table class="log-line" id="l-11"><tr class="log-row"><td class="log-lineno"><a href="#l-11">&nbsp;11</a></td><td class="log-time">17:02 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> I did review the best that I could</span></td></tr></table>
<table class="log-line" id="l-12"><tr class="log-row"><td class="log-lineno"><a href="#l-12">&nbsp;12</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Nice! What is your review approach/</span></td></tr></table>
<table class="log-line" id="l-13"><tr class="log-row"><td class="log-lineno"><a href="#l-13">&nbsp;13</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> ?*</span></td></tr></table>
<table class="log-line" id="l-14"><tr class="log-row"><td class="log-lineno"><a href="#l-14">&nbsp;14</a></td><td class="log-time">17:03 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> read PR review club notes, read through pr desc, read/skimmed through the commits, tried to answer pr review club questions</span></td></tr></table>
<table class="log-line" id="l-15"><tr class="log-row"><td class="log-lineno"><a href="#l-15">&nbsp;15</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> I like the approach, I am reviewing it commit by commit and running the fuzz test locally with modifications</span></td></tr></table>
<table class="log-line" id="l-16"><tr class="log-row"><td class="log-lineno"><a href="#l-16">&nbsp;16</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> Hi! First time here. Did glance over the PR and the notes. Getting caught up on Cluster Mempool</span></td></tr></table>
<table class="log-line" id="l-17"><tr class="log-row"><td class="log-lineno"><a href="#l-17">&nbsp;17</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> pseudoramdom: welcome!</span></td></tr></table>
<table class="log-line" id="l-18"><tr class="log-row"><td class="log-lineno"><a href="#l-18">&nbsp;18</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> pseudoramdom: welcome to the (review) club!</span></td></tr></table>
<table class="log-line" id="l-19"><tr class="log-row"><td class="log-lineno"><a href="#l-19">&nbsp;19</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Let&#39;s start with the questions</span></td></tr></table>
<table class="log-line" id="l-20"><tr class="log-row"><td class="log-lineno"><a href="#l-20">&nbsp;20</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> oh yeah I also am runnign fuzz tests but it is taking forever and this is my first time so not sure what i&#39;m doing</span></td></tr></table>
<table class="log-line" id="l-21"><tr class="log-row"><td class="log-lineno"><a href="#l-21">&nbsp;21</a></td><td class="log-time">17:04 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Why are block building and eviction relevant to each other? Wouldn’t it be easier to evict transactions by the order they entered the mempool?</span></td></tr></table>
<table class="log-line" id="l-22"><tr class="log-row"><td class="log-lineno"><a href="#l-22">&nbsp;22</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Feel free to ask any of your own questions, whenever you like</span></td></tr></table>
<table class="log-line" id="l-23"><tr class="log-row"><td class="log-lineno"><a href="#l-23">&nbsp;23</a></td><td class="log-time">17:05 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: just in case you&#39;re not aware - running fuzz tests generally runs indefinitely; it keeps trying to make randomized changes to the input, and seeing if those trigger code coverage change and (even better) assertion failures</span></td></tr></table>
<table class="log-line" id="l-24"><tr class="log-row"><td class="log-lineno"><a href="#l-24">&nbsp;24</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> they are both looking for the same data (ording of tx clusters by fee rate), just opposite goals. one wants the top fee rates, the other the lowest fee rate.</span></td></tr></table>
<table class="log-line" id="l-25"><tr class="log-row"><td class="log-lineno"><a href="#l-25">&nbsp;25</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> glozow: you would want to evict the worst transaction in the mempool, i.e the one very unlikely to be mined soon.</span></td></tr></table>
<table class="log-line" id="l-26"><tr class="log-row"><td class="log-lineno"><a href="#l-26">&nbsp;26</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> As such when you use the order they enter mempool you will likely evict a transaction that might be mined in the next block.</span></td></tr></table>
<table class="log-line" id="l-27"><tr class="log-row"><td class="log-lineno"><a href="#l-27">&nbsp;27</a></td><td class="log-time">17:06 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> it would be easier to evict by order they entered, but this can also evict your highest paying tx</span></td></tr></table>
<table class="log-line" id="l-28"><tr class="log-row"><td class="log-lineno"><a href="#l-28">&nbsp;28</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> Does block building and eviction need to be opposites? or not necessary?</span></td></tr></table>
<table class="log-line" id="l-29"><tr class="log-row"><td class="log-lineno"><a href="#l-29">&nbsp;29</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: just a tiny nit, it&#39;s not sorting the *clusters* by feerate, but something else</span></td></tr></table>
<table class="log-line" id="l-30"><tr class="log-row"><td class="log-lineno"><a href="#l-30">&nbsp;30</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> sipa: haha ok thank you for letting me know! will have to look into how to run that properly</span></td></tr></table>
<table class="log-line" id="l-31"><tr class="log-row"><td class="log-lineno"><a href="#l-31">&nbsp;31</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> sipa: not clusters, chunks right?</span></td></tr></table>
<table class="log-line" id="l-32"><tr class="log-row"><td class="log-lineno"><a href="#l-32">&nbsp;32</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: bingo</span></td></tr></table>
<table class="log-line" id="l-33"><tr class="log-row"><td class="log-lineno"><a href="#l-33">&nbsp;33</a></td><td class="log-time">17:07 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: abubakarsadiq: yes exactly</span></td></tr></table>
<table class="log-line" id="l-34"><tr class="log-row"><td class="log-lineno"><a href="#l-34">&nbsp;34</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> pseudoramdom: today, they are very much not each other&#39;s opposite; the question is why we&#39;d like them to be opposities</span></td></tr></table>
<table class="log-line" id="l-35"><tr class="log-row"><td class="log-lineno"><a href="#l-35">&nbsp;35</a></td><td class="log-time">17:08 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> to be fair, today, eviction is an approximation of the opposite of block building, just not an accurate one</span></td></tr></table>
<table class="log-line" id="l-36"><tr class="log-row"><td class="log-lineno"><a href="#l-36">&nbsp;36</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> glozow: right, that&#39;s phrased more clearly</span></td></tr></table>
<table class="log-line" id="l-37"><tr class="log-row"><td class="log-lineno"><a href="#l-37">&nbsp;37</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> True / false: if all clusters are singletons (have 1 transaction each), m_main_chunkindex would just be sorting the transactions by feerate</span></td></tr></table>
<table class="log-line" id="l-38"><tr class="log-row"><td class="log-lineno"><a href="#l-38">&nbsp;38</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> I want to say true</span></td></tr></table>
<table class="log-line" id="l-39"><tr class="log-row"><td class="log-lineno"><a href="#l-39">&nbsp;39</a></td><td class="log-time">17:09 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> True :)</span></td></tr></table>
<table class="log-line" id="l-40"><tr class="log-row"><td class="log-lineno"><a href="#l-40">&nbsp;40</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> I see. Yeah, it makes sense to have them accurately ordered. Block building can select the &quot;best&quot; end of the list. And eviction removes from the &quot;worst&quot; end</span></td></tr></table>
<table class="log-line" id="l-41"><tr class="log-row"><td class="log-lineno"><a href="#l-41">&nbsp;41</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Great :) can you explain why true?</span></td></tr></table>
<table class="log-line" id="l-42"><tr class="log-row"><td class="log-lineno"><a href="#l-42">&nbsp;42</a></td><td class="log-time">17:10 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> If there is tie it it will compare the sequence of the clusters (individual tx)</span></td></tr></table>
<table class="log-line" id="l-43"><tr class="log-row"><td class="log-lineno"><a href="#l-43">&nbsp;43</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> if all clusters are singletons, then each cluster will have one chunk, and the linearization orders by chunk fee rate</span></td></tr></table>
<table class="log-line" id="l-44"><tr class="log-row"><td class="log-lineno"><a href="#l-44">&nbsp;44</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> Bonus question: imagine two singleton clusters, with the same feerate, but they have different vsize. What can you say about their order?</span></td></tr></table>
<table class="log-line" id="l-45"><tr class="log-row"><td class="log-lineno"><a href="#l-45">&nbsp;45</a></td><td class="log-time">17:11 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> for the people following at home, we are looking at <a href="https://github.com/bitcoin-core-review-club/bitcoin/blob/27a0c93abb7e70b93214eb857e2046f848139e68/src/txgraph.cpp#L290-L306" target="blank">https://github.com/bitcoin-core-review-club/bitcoin/blob/27a0c93abb7e70b93214eb857e2046f848139e68/src/txgraph.cpp#L290-L306</a></span></td></tr></table>
<table class="log-line" id="l-46"><tr class="log-row"><td class="log-lineno"><a href="#l-46">&nbsp;46</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> sipa: thats a tie?</span></td></tr></table>
<table class="log-line" id="l-47"><tr class="log-row"><td class="log-lineno"><a href="#l-47">&nbsp;47</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: depends on your perspective :p</span></td></tr></table>
<table class="log-line" id="l-48"><tr class="log-row"><td class="log-lineno"><a href="#l-48">&nbsp;48</a></td><td class="log-time">17:12 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: yes!</span></td></tr></table>
<table class="log-line" id="l-49"><tr class="log-row"><td class="log-lineno"><a href="#l-49">&nbsp;49</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> We have two comparators yes.</span></td></tr></table>
<table class="log-line" id="l-50"><tr class="log-row"><td class="log-lineno"><a href="#l-50">&nbsp;50</a></td><td class="log-time">17:13 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> m_sequence?</span></td></tr></table>
<table class="log-line" id="l-51"><tr class="log-row"><td class="log-lineno"><a href="#l-51">&nbsp;51</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> sipa: I think the one with higher vsize will come first in the order since the sorting uses the &gt; operator not `FeeRateCompare`?</span></td></tr></table>
<table class="log-line" id="l-52"><tr class="log-row"><td class="log-lineno"><a href="#l-52">&nbsp;52</a></td><td class="log-time">17:15 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: no it uses FeeRateCompare, sorry - I thought it didn&#39;t, so this was a very trick question</span></td></tr></table>
<table class="log-line" id="l-53"><tr class="log-row"><td class="log-lineno"><a href="#l-53">&nbsp;53</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> they&#39;ll be sorted by cluster creation order (m_sequence)</span></td></tr></table>
<table class="log-line" id="l-54"><tr class="log-row"><td class="log-lineno"><a href="#l-54">&nbsp;54</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;Murch[m]&gt;</span><span class="log-msg"> monlovesmango: You can just interrupt fuzz tests any time, or you can set a `max_total_time` or `runs` limit. You can ping me later if you want</span></td></tr></table>
<table class="log-line" id="l-55"><tr class="log-row"><td class="log-lineno"><a href="#l-55">&nbsp;55</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> does `FeeRateCompare` return 0 for same feerate different vsize?</span></td></tr></table>
<table class="log-line" id="l-56"><tr class="log-row"><td class="log-lineno"><a href="#l-56">&nbsp;56</a></td><td class="log-time">17:16 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> I suppose yes</span></td></tr></table>
<table class="log-line" id="l-57"><tr class="log-row"><td class="log-lineno"><a href="#l-57">&nbsp;57</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> glozow: yes, FeeFrac::operator&lt;=&gt; (and derived operator&lt;, ... etc) treat equal feerate objects as sorted by increasing size</span></td></tr></table>
<table class="log-line" id="l-58"><tr class="log-row"><td class="log-lineno"><a href="#l-58">&nbsp;58</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> So it tie-breaks by sequence</span></td></tr></table>
<table class="log-line" id="l-59"><tr class="log-row"><td class="log-lineno"><a href="#l-59">&nbsp;59</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> ah, I&#39;ve mentioned that as well above. and changed my mind :)</span></td></tr></table>
<table class="log-line" id="l-60"><tr class="log-row"><td class="log-lineno"><a href="#l-60">&nbsp;60</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> but FeeRateCompare specifically just compares the feerate itself</span></td></tr></table>
<table class="log-line" id="l-61"><tr class="log-row"><td class="log-lineno"><a href="#l-61">&nbsp;61</a></td><td class="log-time">17:17 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> Murch: ok sounds good thank you!</span></td></tr></table>
<table class="log-line" id="l-62"><tr class="log-row"><td class="log-lineno"><a href="#l-62">&nbsp;62</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> here: <a href="https://github.com/bitcoin-core-review-club/bitcoin/blob/27a0c93abb7e70b93214eb857e2046f848139e68/src/util/feefrac.h#L113" target="blank">https://github.com/bitcoin-core-review-club/bitcoin/blob/27a0c93abb7e70b93214eb857e2046f848139e68/src/util/feefrac.h#L113</a></span></td></tr></table>
<table class="log-line" id="l-63"><tr class="log-row"><td class="log-lineno"><a href="#l-63">&nbsp;63</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Next question</span></td></tr></table>
<table class="log-line" id="l-64"><tr class="log-row"><td class="log-lineno"><a href="#l-64">&nbsp;64</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;Murch[m]&gt;</span><span class="log-msg"> (or rather, we can discuss here in this channel after the meeting, I think others might also chime in or want to read it)</span></td></tr></table>
<table class="log-line" id="l-65"><tr class="log-row"><td class="log-lineno"><a href="#l-65">&nbsp;65</a></td><td class="log-time">17:18 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> In English, using the approach in this PR, what is the algorithm for selecting transactions in order for block building? And for eviction?</span></td></tr></table>
<table class="log-line" id="l-66"><tr class="log-row"><td class="log-lineno"><a href="#l-66">&nbsp;66</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @monlovesmango: I run the fuzz test to verify my understand that if I make modification to a commit I expect an assertion I added to be triggered which always do.</span></td></tr></table>
<table class="log-line" id="l-67"><tr class="log-row"><td class="log-lineno"><a href="#l-67">&nbsp;67</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> You can discuss here, it&#39;s about the PR</span></td></tr></table>
<table class="log-line" id="l-68"><tr class="log-row"><td class="log-lineno"><a href="#l-68">&nbsp;68</a></td><td class="log-time">17:19 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> glozow: I can&#39;t process too much at a time and would rather focus on questions :)</span></td></tr></table>
<table class="log-line" id="l-69"><tr class="log-row"><td class="log-lineno"><a href="#l-69">&nbsp;69</a></td><td class="log-time">17:20 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> abubakarsa: that is a good idea!</span></td></tr></table>
<table class="log-line" id="l-70"><tr class="log-row"><td class="log-lineno"><a href="#l-70">&nbsp;70</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;Murch[m]&gt;</span><span class="log-msg"> glozow: Repeatedly pick from all clusters the chunk with the highest available chunk feerate until the block is full</span></td></tr></table>
<table class="log-line" id="l-71"><tr class="log-row"><td class="log-lineno"><a href="#l-71">&nbsp;71</a></td><td class="log-time">17:21 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> glozow: is your question more about what BlockBuildImpl does internally, or how you imagine high-level code would use BlockBuilder based on its interface?</span></td></tr></table>
<table class="log-line" id="l-72"><tr class="log-row"><td class="log-lineno"><a href="#l-72">&nbsp;72</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> (because the actual block building code isn&#39;t inside this PR)</span></td></tr></table>
<table class="log-line" id="l-73"><tr class="log-row"><td class="log-lineno"><a href="#l-73">&nbsp;73</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> let&#39;s start with: how would higher level code use BlockBuilder?</span></td></tr></table>
<table class="log-line" id="l-74"><tr class="log-row"><td class="log-lineno"><a href="#l-74">&nbsp;74</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> In English?</span></td></tr></table>
<table class="log-line" id="l-75"><tr class="log-row"><td class="log-lineno"><a href="#l-75">&nbsp;75</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> (Oh oops, that&#39;s the next question)</span></td></tr></table>
<table class="log-line" id="l-76"><tr class="log-row"><td class="log-lineno"><a href="#l-76">&nbsp;76</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> @glozow picking chunks in the order of highest to lowest feerate</span></td></tr></table>
<table class="log-line" id="l-77"><tr class="log-row"><td class="log-lineno"><a href="#l-77">&nbsp;77</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:rebeccapurple">&lt;Murch[m]&gt;</span><span class="log-msg"> abubakarsadiq: Hausa would be confusing to most of us :~</span></td></tr></table>
<table class="log-line" id="l-78"><tr class="log-row"><td class="log-lineno"><a href="#l-78">&nbsp;78</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> Murch[m]: :D</span></td></tr></table>
<table class="log-line" id="l-79"><tr class="log-row"><td class="log-lineno"><a href="#l-79">&nbsp;79</a></td><td class="log-time">17:22 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> :P</span></td></tr></table>
<table class="log-line" id="l-80"><tr class="log-row"><td class="log-lineno"><a href="#l-80">&nbsp;80</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> so let&#39;s start with: How would a client of BlockBuilder use it to build a block? When would GetCurrentChunk, Include, and Skip be called?</span></td></tr></table>
<table class="log-line" id="l-81"><tr class="log-row"><td class="log-lineno"><a href="#l-81">&nbsp;81</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> the algorithm for selecting transactions is to group related tx into clusters, and then linearize each cluster into chunks by their fee rate (this part i&#39;m still fuzzy on), and then order all chunks by fee rate, and then pick chunks by decreasing fee rate (skipping chunks from clusters that have had a chunk skipped)</span></td></tr></table>
<table class="log-line" id="l-82"><tr class="log-row"><td class="log-lineno"><a href="#l-82">&nbsp;82</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: yes!</span></td></tr></table>
<table class="log-line" id="l-83"><tr class="log-row"><td class="log-lineno"><a href="#l-83">&nbsp;83</a></td><td class="log-time">17:24 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> eviction is the same but starting from lowest fee rate</span></td></tr></table>
<table class="log-line" id="l-84"><tr class="log-row"><td class="log-lineno"><a href="#l-84">&nbsp;84</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> It&#39;s a linear algorithm that just get the current chunk recommended by block builder and include it when it satisfy a condition  or skip it when it didn&#39;t</span></td></tr></table>
<table class="log-line" id="l-85"><tr class="log-row"><td class="log-lineno"><a href="#l-85">&nbsp;85</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> Not sure why a chunk will be skipped is it because of blockmintxfee?</span></td></tr></table>
<table class="log-line" id="l-86"><tr class="log-row"><td class="log-lineno"><a href="#l-86">&nbsp;86</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> GetCurrentChunk would give the &quot;best&quot; chunk available?</span></td></tr></table>
<table class="log-line" id="l-87"><tr class="log-row"><td class="log-lineno"><a href="#l-87">&nbsp;87</a></td><td class="log-time">17:25 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> i think if the cluster can&#39;t fit in a block?</span></td></tr></table>
<table class="log-line" id="l-88"><tr class="log-row"><td class="log-lineno"><a href="#l-88">&nbsp;88</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> abubakarsadiq; can you think of a nother reason?</span></td></tr></table>
<table class="log-line" id="l-89"><tr class="log-row"><td class="log-lineno"><a href="#l-89">&nbsp;89</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango; yes! but s/cluster/chunk</span></td></tr></table>
<table class="log-line" id="l-90"><tr class="log-row"><td class="log-lineno"><a href="#l-90">&nbsp;90</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> What is the expected lifetime of BlockBuilder (is it similar to CTxMemPool’s or very different)?</span></td></tr></table>
<table class="log-line" id="l-91"><tr class="log-row"><td class="log-lineno"><a href="#l-91">&nbsp;91</a></td><td class="log-time">17:26 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> thanks @monlovesmango</span></td></tr></table>
<table class="log-line" id="l-92"><tr class="log-row"><td class="log-lineno"><a href="#l-92">&nbsp;92</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> oh, but then why does it remember what to skip by cluster?</span></td></tr></table>
<table class="log-line" id="l-93"><tr class="log-row"><td class="log-lineno"><a href="#l-93">&nbsp;93</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: what happens if it doesn&#39;t?</span></td></tr></table>
<table class="log-line" id="l-94"><tr class="log-row"><td class="log-lineno"><a href="#l-94">&nbsp;94</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: once any chunk in a cluster has been skipped, nothing else from the cluster can&#39;t be included anymore, because the later transactions in the cluster may depend on transactions from the skipped chunk</span></td></tr></table>
<table class="log-line" id="l-95"><tr class="log-row"><td class="log-lineno"><a href="#l-95">&nbsp;95</a></td><td class="log-time">17:27 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> oh, sorry, spoiler</span></td></tr></table>
<table class="log-line" id="l-96"><tr class="log-row"><td class="log-lineno"><a href="#l-96">&nbsp;96</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> It is different, you should discard it immediately you are done building a block template.</span></td></tr></table>
<table class="log-line" id="l-97"><tr class="log-row"><td class="log-lineno"><a href="#l-97">&nbsp;97</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> TxGraph mutation methods can&#39;t be triggered  when we have a block builder instance;</span></td></tr></table>
<table class="log-line" id="l-98"><tr class="log-row"><td class="log-lineno"><a href="#l-98">&nbsp;98</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> it will evaluate a chunk fromt he same cluster, which likely has missing dependencies! hah yeah what you said</span></td></tr></table>
<table class="log-line" id="l-99"><tr class="log-row"><td class="log-lineno"><a href="#l-99">&nbsp;99</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> is it necessarily true that nothing else from the cluster can be included/</span></td></tr></table>
<table class="log-line" id="l-100"><tr class="log-row"><td class="log-lineno"><a href="#l-100">100</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> ?* ugh my shift key</span></td></tr></table>
<table class="log-line" id="l-101"><tr class="log-row"><td class="log-lineno"><a href="#l-101">101</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> glozow: you used it correctly for &quot;English&quot;</span></td></tr></table>
<table class="log-line" id="l-102"><tr class="log-row"><td class="log-lineno"><a href="#l-102">102</a></td><td class="log-time">17:28 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> glozow: cool that makes a lot of sense thanks!</span></td></tr></table>
<table class="log-line" id="l-103"><tr class="log-row"><td class="log-lineno"><a href="#l-103">103</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @sipa also if you skip a chunk in a cluster then that cluster linearization is incorrect yeah?</span></td></tr></table>
<table class="log-line" id="l-104"><tr class="log-row"><td class="log-lineno"><a href="#l-104">104</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: maybe</span></td></tr></table>
<table class="log-line" id="l-105"><tr class="log-row"><td class="log-lineno"><a href="#l-105">105</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> expected lifetime of BlockBuilder is short, as you can&#39;t make updates to txgraph if there is an observer right?</span></td></tr></table>
<table class="log-line" id="l-106"><tr class="log-row"><td class="log-lineno"><a href="#l-106">106</a></td><td class="log-time">17:30 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> If you skip something, you could still include its sibling, no?</span></td></tr></table>
<table class="log-line" id="l-107"><tr class="log-row"><td class="log-lineno"><a href="#l-107">107</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> should always be contained within CTxMemPool&#39;s lifetime</span></td></tr></table>
<table class="log-line" id="l-108"><tr class="log-row"><td class="log-lineno"><a href="#l-108">108</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: depends what you mean with correct; it won&#39;t be a linearization for the full cluster anymore as some transactions will clearly be missing, but it may still be a valid linearization for what remains of the cluster after removing the skipped chunk</span></td></tr></table>
<table class="log-line" id="l-109"><tr class="log-row"><td class="log-lineno"><a href="#l-109">109</a></td><td class="log-time">17:31 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> but BlockBuilderImpl (currently) doesn&#39;t try to reason about that because it&#39;s hard, and breaks the abstraction offered by linearizations/chunks</span></td></tr></table>
<table class="log-line" id="l-110"><tr class="log-row"><td class="log-lineno"><a href="#l-110">110</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: yes!</span></td></tr></table>
<table class="log-line" id="l-111"><tr class="log-row"><td class="log-lineno"><a href="#l-111">111</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> so as soon as you skip anything of a cluster, it conservatively assumes nothing more from that cluster can be included</span></td></tr></table>
<table class="log-line" id="l-112"><tr class="log-row"><td class="log-lineno"><a href="#l-112">112</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> then if it is valid and topological even with the skipped chunk, arent miners losing on fees by skipping everything in the cluster?</span></td></tr></table>
<table class="log-line" id="l-113"><tr class="log-row"><td class="log-lineno"><a href="#l-113">113</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Why should `TxGraph` disallow changes while an observer exists?</span></td></tr></table>
<table class="log-line" id="l-114"><tr class="log-row"><td class="log-lineno"><a href="#l-114">114</a></td><td class="log-time">17:32 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: yes, it is neccessarily an approximation, like block building always is</span></td></tr></table>
<table class="log-line" id="l-115"><tr class="log-row"><td class="log-lineno"><a href="#l-115">115</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: even the fact that we&#39;re only considering transactions in just a single order (the linearization) may result in small amounts of lost fees</span></td></tr></table>
<table class="log-line" id="l-116"><tr class="log-row"><td class="log-lineno"><a href="#l-116">116</a></td><td class="log-time">17:33 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> or the fact that it&#39;s an eager algorithm to begin with</span></td></tr></table>
<table class="log-line" id="l-117"><tr class="log-row"><td class="log-lineno"><a href="#l-117">117</a></td><td class="log-time">17:34 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Can you create a BlockBuilder when staging exists? Can you build a block using the TxGraph’s state with its staged changes?</span></td></tr></table>
<table class="log-line" id="l-118"><tr class="log-row"><td class="log-lineno"><a href="#l-118">118</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> bc everytime TxGraph is updated it will need re-linearization, which you don&#39;t want to do while something is actively observing the ordering</span></td></tr></table>
<table class="log-line" id="l-119"><tr class="log-row"><td class="log-lineno"><a href="#l-119">119</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: exactly, it&#39;ll invalidate the chunk ordering that the observer is using</span></td></tr></table>
<table class="log-line" id="l-120"><tr class="log-row"><td class="log-lineno"><a href="#l-120">120</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> Why should `TxGraph` disallow changes while an observer exists? - the ordering mught change, possibility of missing a tx if the underlying graph changed?</span></td></tr></table>
<table class="log-line" id="l-121"><tr class="log-row"><td class="log-lineno"><a href="#l-121">121</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> I think this case will likely happen towards the tail end of the block building process when we are close to the 4M `WU` limit.</span></td></tr></table>
<table class="log-line" id="l-122"><tr class="log-row"><td class="log-lineno"><a href="#l-122">122</a></td><td class="log-time">17:35 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> And also I think majority of tx are single clusters so it is fine?</span></td></tr></table>
<table class="log-line" id="l-123"><tr class="log-row"><td class="log-lineno"><a href="#l-123">123</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> yes I think you can&#39;t create a BlockBuilder when staging exists, but you can&#39;t build a block using staging</span></td></tr></table>
<table class="log-line" id="l-124"><tr class="log-row"><td class="log-lineno"><a href="#l-124">124</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: correct</span></td></tr></table>
<table class="log-line" id="l-125"><tr class="log-row"><td class="log-lineno"><a href="#l-125">125</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> you can* create a BlockBuiler</span></td></tr></table>
<table class="log-line" id="l-126"><tr class="log-row"><td class="log-lineno"><a href="#l-126">126</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> oh, *can*, indeed</span></td></tr></table>
<table class="log-line" id="l-127"><tr class="log-row"><td class="log-lineno"><a href="#l-127">127</a></td><td class="log-time">17:36 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> haha</span></td></tr></table>
<table class="log-line" id="l-128"><tr class="log-row"><td class="log-lineno"><a href="#l-128">128</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @glozow: I think you can create a block builder while we have staging; but the recommended chunks will always be from main</span></td></tr></table>
<table class="log-line" id="l-129"><tr class="log-row"><td class="log-lineno"><a href="#l-129">129</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> yep yep</span></td></tr></table>
<table class="log-line" id="l-130"><tr class="log-row"><td class="log-lineno"><a href="#l-130">130</a></td><td class="log-time">17:37 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> specifically, if you were making changes to main while a block builder exists, what would go wrong (ignoring the fact that it&#39;s not allowed, and might trigger Assume failes)</span></td></tr></table>
<table class="log-line" id="l-131"><tr class="log-row"><td class="log-lineno"><a href="#l-131">131</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> glozow: tell me to shut up if my extra questions make us move too slowly</span></td></tr></table>
<table class="log-line" id="l-132"><tr class="log-row"><td class="log-lineno"><a href="#l-132">132</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> sipa: I would imagine things like double including a tx, or missing txs all together</span></td></tr></table>
<table class="log-line" id="l-133"><tr class="log-row"><td class="log-lineno"><a href="#l-133">133</a></td><td class="log-time">17:38 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> sipa: all good</span></td></tr></table>
<table class="log-line" id="l-134"><tr class="log-row"><td class="log-lineno"><a href="#l-134">134</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> @sipa; I think you will mess up with chunk order and invalidate the chunk index iterators?</span></td></tr></table>
<table class="log-line" id="l-135"><tr class="log-row"><td class="log-lineno"><a href="#l-135">135</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> abubakarsadiq: yep, that&#39;s it</span></td></tr></table>
<table class="log-line" id="l-136"><tr class="log-row"><td class="log-lineno"><a href="#l-136">136</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> the m_current_chunk iterator in BlockBuilderImpl may end up referring to a chunk index entry that no longer exists</span></td></tr></table>
<table class="log-line" id="l-137"><tr class="log-row"><td class="log-lineno"><a href="#l-137">137</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> which would be undefined behavior in C++</span></td></tr></table>
<table class="log-line" id="l-138"><tr class="log-row"><td class="log-lineno"><a href="#l-138">138</a></td><td class="log-time">17:39 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> yeah</span></td></tr></table>
<table class="log-line" id="l-139"><tr class="log-row"><td class="log-lineno"><a href="#l-139">139</a></td><td class="log-time">17:40 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> ok interesting. is there no way that it would point to an inaccurate index, but one that does exist?</span></td></tr></table>
<table class="log-line" id="l-140"><tr class="log-row"><td class="log-lineno"><a href="#l-140">140</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: that is definitely possible, the point of undefined behavior is that it makes the behavior of the entire program undefined</span></td></tr></table>
<table class="log-line" id="l-141"><tr class="log-row"><td class="log-lineno"><a href="#l-141">141</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> so it might do that</span></td></tr></table>
<table class="log-line" id="l-142"><tr class="log-row"><td class="log-lineno"><a href="#l-142">142</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Does `BlockBuilder` modify `TxGraph`?</span></td></tr></table>
<table class="log-line" id="l-143"><tr class="log-row"><td class="log-lineno"><a href="#l-143">143</a></td><td class="log-time">17:41 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> it might also result in sending all your BTC away</span></td></tr></table>
<table class="log-line" id="l-144"><tr class="log-row"><td class="log-lineno"><a href="#l-144">144</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> yep in constructor and destructor, while incrementing and decrementing block builder observer</span></td></tr></table>
<table class="log-line" id="l-145"><tr class="log-row"><td class="log-lineno"><a href="#l-145">145</a></td><td class="log-time">17:42 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> yes, it modifies observer count</span></td></tr></table>
<table class="log-line" id="l-146"><tr class="log-row"><td class="log-lineno"><a href="#l-146">146</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> might it make any other changes in the constructor?</span></td></tr></table>
<table class="log-line" id="l-147"><tr class="log-row"><td class="log-lineno"><a href="#l-147">147</a></td><td class="log-time">17:43 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> peeping at the constructor.......</span></td></tr></table>
<table class="log-line" id="l-148"><tr class="log-row"><td class="log-lineno"><a href="#l-148">148</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> MakeAllAcceptable</span></td></tr></table>
<table class="log-line" id="l-149"><tr class="log-row"><td class="log-lineno"><a href="#l-149">149</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> ✅</span></td></tr></table>
<table class="log-line" id="l-150"><tr class="log-row"><td class="log-lineno"><a href="#l-150">150</a></td><td class="log-time">17:44 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> tada <a href="https://github.com/bitcoin-core-review-club/bitcoin/blob/27a0c93abb7e70b93214eb857e2046f848139e68/src/txgraph.cpp#L2394" target="blank">https://github.com/bitcoin-core-review-club/bitcoin/blob/27a0c93abb7e70b93214eb857e2046f848139e68/src/txgraph.cpp#L2394</a></span></td></tr></table>
<table class="log-line" id="l-151"><tr class="log-row"><td class="log-lineno"><a href="#l-151">151</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> which looks like it does ApplyDependencies, which will mutate txgraph</span></td></tr></table>
<table class="log-line" id="l-152"><tr class="log-row"><td class="log-lineno"><a href="#l-152">152</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> indeed</span></td></tr></table>
<table class="log-line" id="l-153"><tr class="log-row"><td class="log-lineno"><a href="#l-153">153</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> I second :)</span></td></tr></table>
<table class="log-line" id="l-154"><tr class="log-row"><td class="log-lineno"><a href="#l-154">154</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> but it doesn&#39;t make any *observable* changes to the graph, as in, ApplyDependencies would have been called anyway, but possibly later</span></td></tr></table>
<table class="log-line" id="l-155"><tr class="log-row"><td class="log-lineno"><a href="#l-155">155</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> In some ways, &quot;no,&quot; because the observable contents of the graph don&#39;t change - BlockBuilder doesn&#39;t remove transactions for exampl</span></td></tr></table>
<table class="log-line" id="l-156"><tr class="log-row"><td class="log-lineno"><a href="#l-156">156</a></td><td class="log-time">17:45 </td><td><span class="log-nick" style="color:teal">&lt;abubakarsadiq&gt;</span><span class="log-msg"> It might not though when their is nothing to apply</span></td></tr></table>
<table class="log-line" id="l-157"><tr class="log-row"><td class="log-lineno"><a href="#l-157">157</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> We already answered Q9 before, so moving on to Q10</span></td></tr></table>
<table class="log-line" id="l-158"><tr class="log-row"><td class="log-lineno"><a href="#l-158">158</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> looking at this commit <a href="https://github.com/bitcoin-core-review-club/bitcoin/commit/3429e9d79df1336cf1d0a61cb5f9bf028aa860b2" target="blank">https://github.com/bitcoin-core-review-club/bitcoin/commit/3429e9d79df1336cf1d0a61cb5f9bf028aa860b2</a></span></td></tr></table>
<table class="log-line" id="l-159"><tr class="log-row"><td class="log-lineno"><a href="#l-159">159</a></td><td class="log-time">17:47 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> This commit adds new fields in data structures that need to point to each other: Entry now contains an iterator to the transaction’s ChunkData in m_main_chunkindex, and ChunkData refrence Entrys by their position in m_entries. In your review, how did you check that these pointers are always kept up-to-date?</span></td></tr></table>
<table class="log-line" id="l-160"><tr class="log-row"><td class="log-lineno"><a href="#l-160">160</a></td><td class="log-time">17:49 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> wasn&#39;t able to finish trying to answer this question, but I would imagine that you want to check all the places where txgraph mutates (ApplyDependencies and Relinearize)</span></td></tr></table>
<table class="log-line" id="l-161"><tr class="log-row"><td class="log-lineno"><a href="#l-161">161</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Yeah, this is more of a &quot;how do you review stuff?&quot; question. I counted up the pointers and checked that there were assertions for them in `SanityCheck()`</span></td></tr></table>
<table class="log-line" id="l-162"><tr class="log-row"><td class="log-lineno"><a href="#l-162">162</a></td><td class="log-time">17:51 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Conceptually, what are all the ways that an entry’s chunk index can change?</span></td></tr></table>
<table class="log-line" id="l-163"><tr class="log-row"><td class="log-lineno"><a href="#l-163">163</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> when child tx is added/removed?</span></td></tr></table>
<table class="log-line" id="l-164"><tr class="log-row"><td class="log-lineno"><a href="#l-164">164</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> glozow: can you explain more about SanityCheck()?</span></td></tr></table>
<table class="log-line" id="l-165"><tr class="log-row"><td class="log-lineno"><a href="#l-165">165</a></td><td class="log-time">17:52 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> when a tx is added or removed from that entry&#39;s cluster?</span></td></tr></table>
<table class="log-line" id="l-166"><tr class="log-row"><td class="log-lineno"><a href="#l-166">166</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> i guess also if any tx is added/removed from mempool</span></td></tr></table>
<table class="log-line" id="l-167"><tr class="log-row"><td class="log-lineno"><a href="#l-167">167</a></td><td class="log-time">17:53 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> oops, there could be more scenarios - maybe when feerate changes by RBF</span></td></tr></table>
<table class="log-line" id="l-168"><tr class="log-row"><td class="log-lineno"><a href="#l-168">168</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: sure. generally I think that if pointer consistency is checked in `SanityCheck` and the fuzzer is good at finding possible (mis)uses of `TxGraph`, I can feel reasonably confident that `TxGraph` is updating those pointers correctly</span></td></tr></table>
<table class="log-line" id="l-169"><tr class="log-row"><td class="log-lineno"><a href="#l-169">169</a></td><td class="log-time">17:54 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> pseudoramdom: that&#39;s the same thing... chunk feerates are a function of the linearization of a cluster, so anything that changes the linearization can affect it... and that includes RBF, but that is effectively through the cluster changes by adding/removing transactions from it</span></td></tr></table>
<table class="log-line" id="l-170"><tr class="log-row"><td class="log-lineno"><a href="#l-170">170</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> glozow: and as abubakarsadiq already mentioned, to get confidence that the fuzzer is indeed capable of finding such problems, it&#39;s often good to just try introducing a bug you expect SanityCheck (or other assertion) to find, and see if it actually does</span></td></tr></table>
<table class="log-line" id="l-171"><tr class="log-row"><td class="log-lineno"><a href="#l-171">171</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> gotcha yeah, thanks for claryfying. (For a sec I was wondering my messages were not going thr&#39;)</span></td></tr></table>
<table class="log-line" id="l-172"><tr class="log-row"><td class="log-lineno"><a href="#l-172">172</a></td><td class="log-time">17:55 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: pseudoramdom: yeah, any of the mutators can change the chunk index</span></td></tr></table>
<table class="log-line" id="l-173"><tr class="log-row"><td class="log-lineno"><a href="#l-173">173</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> also CommitStaging</span></td></tr></table>
<table class="log-line" id="l-174"><tr class="log-row"><td class="log-lineno"><a href="#l-174">174</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:steelblue">&lt;pseudoramdom&gt;</span><span class="log-msg"> can clusters merge?</span></td></tr></table>
<table class="log-line" id="l-175"><tr class="log-row"><td class="log-lineno"><a href="#l-175">175</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> glozow: interesting thank you!</span></td></tr></table>
<table class="log-line" id="l-176"><tr class="log-row"><td class="log-lineno"><a href="#l-176">176</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> pseudoramdom: yep!</span></td></tr></table>
<table class="log-line" id="l-177"><tr class="log-row"><td class="log-lineno"><a href="#l-177">177</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> pseudoramdom: yes, by adding a dependency between transactions that are in distinct clusters</span></td></tr></table>
<table class="log-line" id="l-178"><tr class="log-row"><td class="log-lineno"><a href="#l-178">178</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> also, invoking the ~Ref destructor can change clusters</span></td></tr></table>
<table class="log-line" id="l-179"><tr class="log-row"><td class="log-lineno"><a href="#l-179">179</a></td><td class="log-time">17:56 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> because it causes the corresponding transaction to be removed</span></td></tr></table>
<table class="log-line" id="l-180"><tr class="log-row"><td class="log-lineno"><a href="#l-180">180</a></td><td class="log-time">17:57 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> In the ChunkOrder comparator, when cmp_feerate != 0, why can it be returned directly without comparing position within the cluster?</span></td></tr></table>
<table class="log-line" id="l-181"><tr class="log-row"><td class="log-lineno"><a href="#l-181">181</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> bc fee rate is the first priority when determining order?</span></td></tr></table>
<table class="log-line" id="l-182"><tr class="log-row"><td class="log-lineno"><a href="#l-182">182</a></td><td class="log-time">17:58 </td><td><span class="log-nick" style="color:salmon">&lt;sipa&gt;</span><span class="log-msg"> monlovesmango: but why is that ok?</span></td></tr></table>
<table class="log-line" id="l-183"><tr class="log-row"><td class="log-lineno"><a href="#l-183">183</a></td><td class="log-time">17:59 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> monlovesmango: but why doesn&#39;t that violate any dependencies?</span></td></tr></table>
<table class="log-line" id="l-184"><tr class="log-row"><td class="log-lineno"><a href="#l-184">184</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> bc we know they are from different clusters?</span></td></tr></table>
<table class="log-line" id="l-185"><tr class="log-row"><td class="log-lineno"><a href="#l-185">185</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:magenta">&lt;monlovesmango&gt;</span><span class="log-msg"> hmm no</span></td></tr></table>
<table class="log-line" id="l-186"><tr class="log-row"><td class="log-lineno"><a href="#l-186">186</a></td><td class="log-time">18:00 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> No, they can be within the same cluster</span></td></tr></table>
<table class="log-line" id="l-187"><tr class="log-row"><td class="log-lineno"><a href="#l-187">187</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> But chunks within a cluster are already in feerate order :)</span></td></tr></table>
<table class="log-line" id="l-188"><tr class="log-row"><td class="log-lineno"><a href="#l-188">188</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> Uh oh, we&#39;re already out of time!</span></td></tr></table>
<table class="log-line" id="l-189"><tr class="log-row"><td class="log-lineno"><a href="#l-189">189</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> We got through a lot today, thanks for coming everybody</span></td></tr></table>
<table class="log-line" id="l-190"><tr class="log-row"><td class="log-lineno"><a href="#l-190">190</a></td><td class="log-time">18:01 </td><td><span class="log-nick" style="color:slateblue">&lt;glozow&gt;</span><span class="log-msg"> #endmeeting </span></td></tr></table>]]></content><author><name>sipa</name></author><summary type="html"><![CDATA[Notes]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://bitcoincore.reviews/assets/img/twitter_card.png" /><media:content medium="image" url="https://bitcoincore.reviews/assets/img/twitter_card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>