Btc Drak [ARCHIVE] on Nostr: 📅 Original date posted:2015-08-19 📝 Original message:On Wed, Aug 19, 2015 at ...
📅 Original date posted:2015-08-19
📝 Original message:On Wed, Aug 19, 2015 at 2:24 PM, Tier Nolan via bitcoin-dev
<bitcoin-dev at lists.linuxfoundation.org> wrote:
> On Wed, Aug 19, 2015 at 2:15 PM, Btc Drak via bitcoin-dev <bitcoin-dev at lists.linuxfoundation.org> wrote:
>> What problem am I missing if we just mask of the offending bits. For my own project which uses auxpow (and thus has weird nVersion), I also used the bitmasking method to get rid of auxpow version bits before making the standard integer comparisons to deploy BIP66 using IsSuperMajority():
>>
>> if ((block.nVersion & 0xff) >= 4 && CBlockIndex::IsSuperMajority(...)) { //...}
>
> What if version number 257 is used in the future? That would appear to be a version 1 block and fail the test.
To clarify this is the code example for how the same problem occurs
with auxpow bits when running a an IsSuperMajority() softfork and how
it's solved in that instance.
In our case for Bitcoin Core, option 2 we use nVersion=8, apply a
bitmask of 0xdffffff8 thus:
if ((block.nVersion & ~0x20000007) >= 4 &&
CBlockIndex::IsSuperMajority(...)) { //...}
With nVersion=8, but using comparison >=4 allows us to recover the
bit later, assuming we want it (otherwise we use version >=8).
This should, unless I am missing something, be forward compatible with
future softforks. My understanding was if "versionbits softfork" code
is not ready by the time we're ready for the deployment,
IsSuperMajority() would be acceptable; and this is how we could deploy
it in the wake of the XT developers' carelessness.
Published at
2023-06-07 15:48:30Event JSON
{
"id": "4f0ee8babfa882adf30dfce9481dc1ad13c84175f10d7629f767b176d1b2a6f5",
"pubkey": "fdf31024ca0537ed828d895ddc8525f8af023f0dc935a8327a8a496d0d7a9f83",
"created_at": 1686152910,
"kind": 1,
"tags": [
[
"e",
"33b40cb3a6ef196ed3b584cc0c215cff95814683d4b226bd9e9b25b98d4c9443",
"",
"root"
],
[
"e",
"9bbd5a33639f10c030b4c4542eb5888c134d3aedfa5336667fbc9316fb4ca2a8",
"",
"reply"
],
[
"p",
"46986f86b97cc97829a031b03209644d134b939d0163375467f0b1363e0d875e"
]
],
"content": "📅 Original date posted:2015-08-19\n📝 Original message:On Wed, Aug 19, 2015 at 2:24 PM, Tier Nolan via bitcoin-dev\n\u003cbitcoin-dev at lists.linuxfoundation.org\u003e wrote:\n\u003e On Wed, Aug 19, 2015 at 2:15 PM, Btc Drak via bitcoin-dev \u003cbitcoin-dev at lists.linuxfoundation.org\u003e wrote:\n\u003e\u003e What problem am I missing if we just mask of the offending bits. For my own project which uses auxpow (and thus has weird nVersion), I also used the bitmasking method to get rid of auxpow version bits before making the standard integer comparisons to deploy BIP66 using IsSuperMajority():\n\u003e\u003e\n\u003e\u003e if ((block.nVersion \u0026 0xff) \u003e= 4 \u0026\u0026 CBlockIndex::IsSuperMajority(...)) { //...}\n\u003e\n\u003e What if version number 257 is used in the future? That would appear to be a version 1 block and fail the test.\n\nTo clarify this is the code example for how the same problem occurs\nwith auxpow bits when running a an IsSuperMajority() softfork and how\nit's solved in that instance.\n\nIn our case for Bitcoin Core, option 2 we use nVersion=8, apply a\nbitmask of 0xdffffff8 thus:\n\n if ((block.nVersion \u0026 ~0x20000007) \u003e= 4 \u0026\u0026\nCBlockIndex::IsSuperMajority(...)) { //...}\n\nWith nVersion=8, but using comparison \u003e=4 allows us to recover the\nbit later, assuming we want it (otherwise we use version \u003e=8).\n\nThis should, unless I am missing something, be forward compatible with\nfuture softforks. My understanding was if \"versionbits softfork\" code\nis not ready by the time we're ready for the deployment,\nIsSuperMajority() would be acceptable; and this is how we could deploy\nit in the wake of the XT developers' carelessness.",
"sig": "d910e3a52fe41f67faca3928858cb8225283cfa38e91a812008879dfe61271b249d06e4c5620a5846b1cfb3da72f4d341a8339c1d579433be91a4b984ffce732"
}