Matt Corallo [ARCHIVE] on Nostr: 📅 Original date posted:2021-09-09 📝 Original message:On 9/7/21 09:07, 0xB10C ...
📅 Original date posted:2021-09-09
📝 Original message:On 9/7/21 09:07, 0xB10C via bitcoin-dev wrote:
> Hello,
>
> tl;dr: We want to make reorgs on SigNet a reality and are looking for
> feedback on approach and parameters.
Awesome!
> AJ proposed to allow SigNet users to opt-out of reorgs in case they
> explicitly want to remain unaffected. This can be done by setting a
> to-be-reorged version bit flag on the blocks that won't end up in the
> most work chain. Node operators could choose not to accept to-be-reorged
> SigNet blocks with this flag set via a configuration argument.
Why bother with a version bit? This seems substantially more complicated than the original proposal
that surfaced many times before signet launched to just have a different reorg signing key. Thus,
users who wish to follow reorgs can use a 1-of-2 (or higher multisig) and users who wish to not
follow reorgs would use a 1-of-1 (or higher multisig), simply marking the reorg blocks as invalid
without touching any header bits that non-full clients will ever see.
> The reorg-interval X very much depends on the user's needs. One could
> argue that there should be, for example, three reorgs per day, each 48
> blocks apart. Such a short reorg interval allows developers in all time
> zones to be awake during one or two reorgs per day. Developers don't
> need to wait for, for example, a week until they can test their reorgs
> next. However, too frequent reorgs could hinder other SigNet users.
I see zero reason whatsoever to not simply reorg ~every block, or as often as is practical. If users
opt in to wanting to test with reorgs, they should be able to test with reorgs, not wait a day to
test with reorgs.
> We propose that the reorg depth D is deterministically random between a
> minimum and a maximum based on, e.g., the block hash or the nonce of the
> last block before the reorg. Compared to a local randint() based
> implementation, this allows reorg-handling tests and external tools to
> calculate the expected reorg depth.
>
> # Scenario 1: Race between two chains
>
> For this scenario, at least two nodes and miner scripts need to be
> running. An always-miner A continuously produces blocks and rejects
> blocks with the to-be-reorged version bit flag set. And a race-miner R
> that only mines D blocks at the start of each interval and then waits X
> blocks. A and R both have the same hash rate. Assuming both are well
> connected to the network, it's random which miner will first mine and
> propagate a block. In the end, the A miner chain will always win the race.
>
> # Scenario 2: Chain rollback
>
> This scenario only requires one miner and Bitcoin Core node but also
> works in a multiminer setup. The miners mine D blocks with the
> to-be-reorged version bit flag set at the start of the interval. After
> allowing the block at height X+D to propagate, they invalidate the block
> at height X+1 and start mining on block X again. This time without
> setting the to-be-reorged version bit flag. Non-miner nodes will reorg
> to the new tip at height X+D+1, and the first-seen branch stalls.
Both seem reasonable. I'm honestly not sure what software cases would be hit differently between one
or the other, as long as reorgs happen regularly and at random depth. Nodes should presumably only
ever be following one chain.
> # Questions
>
> 1. How do you currently test your applications reorg handling? Do
> the two discussed scenarios (race and chain rollback) cover your
> needs? Are we missing something you'd find helpful?
>
> 2. How often should reorgs happen on the default SigNet? Should
> there be multiple reorgs a day (e.g., every 48 or 72 blocks
> assuming 144 blocks per day) as your engineers need to be awake?
> Do you favor less frequent reorgs (once per week or month)? Why?
>
> 3. How deep should the reorgs be on average? Do you want to test
> deeper reorgs (10+ blocks) too?
6 is the "standard" confirmation window for mainnet. Its arguably much too low, but for testing
purposes we've gotta pick something, so that seems reasonable?
Matt
Published at
2023-06-07 22:58:49Event JSON
{
"id": "e5e6f2b8dbae0b70e2fb59d43ee314b10621d48c14847ddf821eded82fdc47de",
"pubkey": "cd753aa8fbc112e14ffe9fe09d3630f0eff76ca68e376e004b8e77b687adddba",
"created_at": 1686178729,
"kind": 1,
"tags": [
[
"e",
"82e0f12d7f35467c29cd59e777250289c4cb4554dc58ceaaad44bec4613bd98c",
"",
"root"
],
[
"e",
"572d774af405ed47a1bc95b90e54c4c0f36313aff81aea643ba3bc6c20345a87",
"",
"reply"
],
[
"p",
"937f10fc4f78d8676348562d9d886843fbb351d99d6c96423fe9970819962e19"
]
],
"content": "📅 Original date posted:2021-09-09\n📝 Original message:On 9/7/21 09:07, 0xB10C via bitcoin-dev wrote:\n\u003e Hello,\n\u003e \n\u003e tl;dr: We want to make reorgs on SigNet a reality and are looking for\n\u003e feedback on approach and parameters.\n\nAwesome!\n\n\u003e AJ proposed to allow SigNet users to opt-out of reorgs in case they\n\u003e explicitly want to remain unaffected. This can be done by setting a\n\u003e to-be-reorged version bit flag on the blocks that won't end up in the\n\u003e most work chain. Node operators could choose not to accept to-be-reorged\n\u003e SigNet blocks with this flag set via a configuration argument.\n\nWhy bother with a version bit? This seems substantially more complicated than the original proposal \nthat surfaced many times before signet launched to just have a different reorg signing key. Thus, \nusers who wish to follow reorgs can use a 1-of-2 (or higher multisig) and users who wish to not \nfollow reorgs would use a 1-of-1 (or higher multisig), simply marking the reorg blocks as invalid \nwithout touching any header bits that non-full clients will ever see.\n\n\u003e The reorg-interval X very much depends on the user's needs. One could\n\u003e argue that there should be, for example, three reorgs per day, each 48\n\u003e blocks apart. Such a short reorg interval allows developers in all time\n\u003e zones to be awake during one or two reorgs per day. Developers don't\n\u003e need to wait for, for example, a week until they can test their reorgs\n\u003e next. However, too frequent reorgs could hinder other SigNet users.\n\nI see zero reason whatsoever to not simply reorg ~every block, or as often as is practical. If users \nopt in to wanting to test with reorgs, they should be able to test with reorgs, not wait a day to \ntest with reorgs.\n\n\u003e We propose that the reorg depth D is deterministically random between a\n\u003e minimum and a maximum based on, e.g., the block hash or the nonce of the\n\u003e last block before the reorg. Compared to a local randint() based\n\u003e implementation, this allows reorg-handling tests and external tools to\n\u003e calculate the expected reorg depth.\n\u003e \n\u003e # Scenario 1: Race between two chains\n\u003e \n\u003e For this scenario, at least two nodes and miner scripts need to be\n\u003e running. An always-miner A continuously produces blocks and rejects\n\u003e blocks with the to-be-reorged version bit flag set. And a race-miner R\n\u003e that only mines D blocks at the start of each interval and then waits X\n\u003e blocks. A and R both have the same hash rate. Assuming both are well\n\u003e connected to the network, it's random which miner will first mine and\n\u003e propagate a block. In the end, the A miner chain will always win the race.\n\u003e \n\u003e # Scenario 2: Chain rollback\n\u003e \n\u003e This scenario only requires one miner and Bitcoin Core node but also\n\u003e works in a multiminer setup. The miners mine D blocks with the\n\u003e to-be-reorged version bit flag set at the start of the interval. After\n\u003e allowing the block at height X+D to propagate, they invalidate the block\n\u003e at height X+1 and start mining on block X again. This time without\n\u003e setting the to-be-reorged version bit flag. Non-miner nodes will reorg\n\u003e to the new tip at height X+D+1, and the first-seen branch stalls.\n\nBoth seem reasonable. I'm honestly not sure what software cases would be hit differently between one \nor the other, as long as reorgs happen regularly and at random depth. Nodes should presumably only \never be following one chain.\n\n\u003e # Questions\n\u003e \n\u003e 1. How do you currently test your applications reorg handling? Do\n\u003e the two discussed scenarios (race and chain rollback) cover your\n\u003e needs? Are we missing something you'd find helpful?\n\u003e \n\u003e 2. How often should reorgs happen on the default SigNet? Should\n\u003e there be multiple reorgs a day (e.g., every 48 or 72 blocks\n\u003e assuming 144 blocks per day) as your engineers need to be awake?\n\u003e Do you favor less frequent reorgs (once per week or month)? Why?\n\u003e \n\u003e 3. How deep should the reorgs be on average? Do you want to test\n\u003e deeper reorgs (10+ blocks) too?\n\n6 is the \"standard\" confirmation window for mainnet. Its arguably much too low, but for testing \npurposes we've gotta pick something, so that seems reasonable?\n\nMatt",
"sig": "91aac9ad8493c50c3229183433fa3eb3917411c0ebea6217d4601ded5d4c28814f4018378ad037fc2094df02fe78620ccd53c9ec62b550aef2ca52e60287ad7c"
}