Reduced Data Temporary Softfork, implemented as a modified BIP9 temporary deployment#238
Reduced Data Temporary Softfork, implemented as a modified BIP9 temporary deployment#238dathonohm wants to merge 34 commits intobitcoinknots:29.x-knotsfrom
Conversation
|
Let me suggest adding a note that OP_RETURN is deprecated in help texts, please. |
|
what's the timeline to get this merged so the signaling can use this implementation? |
|
There is no specific timeline to get this merged into Knots, as it is not confirmed that it will be eligible for merging, even when complete. However, I am aiming to have this draft ready for review in the next few days. Miner signaling can still use this deployment if the activation client is released after the start of the signaling period (which is today, so this will definitely happen). |
|
All comments from #234 are now addressed. Undrafting since the code is relatively stable now. Still needs rebase. |
OP_RETURN is not deprecated; it is merely limited to 83 bytes in consensus. |
df70e59 to
d699af3
Compare
|
Rebased on v29.2.knots20251110. Ready for review. |
|
Concept NACK There shouldn't be any emergency softfork to address spam without at least a sketeched out permanent solution |
|
@stackingsaunter Please keep conceptual discussion to the BIP PR. This PR is for code review only. |
luke-jr
left a comment
There was a problem hiding this comment.
Review not complete yet
994b2fe to
5a54af7
Compare
|
All review comments are now addressed. CI is now fully passing (except for the "test each commit" job). A tag has been created for the current version, RC2 (identical to this branch except for the last commit, which updates the UA string for BIP-110). Next I will make a release for RC2, and clean up the commit history here. |
5a54af7 to
cc089c4
Compare
datacarriersize is not deprecated, but OP_RETURN is. Documenting it is out of scope for this PR, though. |
| // at which all the in-chain inputs of the tx were included in blocks. | ||
| // Typical usage of GetPriority with chainActive.Height() will ensure this. | ||
| int heightDiff = currentHeight - cachedHeight; | ||
| int heightDiff = int(currentHeight) - int(cachedHeight); |
There was a problem hiding this comment.
Fixes UBSan unsigned integer overflow: 432 - 433 can't be represented in unsigned int (https://github.com/dathonohm/bitcoin/actions/runs/19997804442, ASan+UBSan job). The cast makes the subtraction signed so the dResult < 0 check on line 114 works correctly. Same pattern as line 70 in the same file (introduced in 28b7673).
There was a problem hiding this comment.
As the comment says, calling this with a currentHeight < cachedHeight is invalid...
There was a problem hiding this comment.
Removing this commit to expose the failure, then I'll work on a fix. This is an upstream bug.
f4045f3 to
1d3cdac
Compare
…T_REDUCED_DATA is active; adapt tests Wire OutputSizeLimit to deployment with unconditional mempool enforcement. Adapt test framework and functional tests for 34-byte output script limit and 83-byte OP_RETURN limit. Test fixes from: 8257367, c609a45, 9194f6f, b141420, e011d53, fc62079, a065a59, 4f371cf, 5ee8102, ebe821e (partial) Co-Authored-By: Dathon Ohm <dathonohm@proton.me> Co-Authored-By: 3c853b6299 <3c853b6299@pm.me> Co-Authored-By: moneybadger1 <moneybadger1@proton.me> Co-Authored-By: Léo Haf <leohaf@orangepill.ovh> Github-Pull: #238 Rebased-From: 45c004e
…height from reduced_data script validation rules Bugfix: validation: Do not cache the result of CheckInputScripts if flags_per_input is used (and avoid using it when unnecessary) Co-Authored-By: Dathon Ohm <dathonohm@proton.me> Co-Authored-By: Lőrinc <pap.lorinc@gmail.com> Github-Pull: #238 Rebased-From: 71722a2
…x8000009; adapt tests Squash of: - b662a23 Define a service bit for BIP148 - 0db5282 Add questionmark to end of BIP148 service bit string, and add to bitcoin-cli - b5a77cd Preferentially peer with nodes enforcing RDTS; rename BIP148 references to ReducedData; adapt tests - 85289a3 net: ask DNS seed for x8000009 (original: ea8c1ee) Define a service bit for BIP148 Github-Pull: bitcoin#10532 Rebased-From: cd74a23fcf9588199e196ab31bc64972400c2027 Add questionmark to end of BIP148 service bit string, and add to bitcoin-cli Preferentially peer with nodes enforcing RDTS; rename BIP148 references to ReducedData; adapt tests Combines: preferential peering (367b344), BIP148->ReducedData rename (85a78b8), service bit test fixes (f98fe90, ebe821e, 5efab4a, 4b757d8, f648a21). net: ask DNS seed for x8000009 Co-Authored-By: Luke Dashjr <luke-jr+git@utopios.org> Co-Authored-By: 3c853b6299 <3c853b6299@pm.me> Co-Authored-By: Léo Haf <leohaf@orangepill.ovh> Github-Pull: #238 Rebased-From: 983555f
ReducedData Temporary Softfork (BIP-110/RDTS)
Implementation of BIP-110 for Bitcoin Knots.
Versionbits extensions
max_activation_height(mutually exclusive withtimeout) with BIP8/148-style mandatory signaling enforcementactive_durationfor temporary deployments (expiry after ~1 year) and a correspondingEXPIREDBIP9 statethreshold(55% for RDTS instead of global 95%)Consensus rules (when DEPLOYMENT_REDUCED_DATA is active)
SCRIPT_VERIFY_REDUCED_DATA), except BIP16 redeemScriptDISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,DISCOURAGE_UPGRADABLE_TAPROOT_VERSION,DISCOURAGE_OP_SUCCESSenforced at consensus levelOP_IF/OP_NOTIFforbidden in TapscriptOther features
NODE_REDUCED_DATAservice bit (bit 27) with preferential peeringx8000009)Commit structure (34 commits)
The commits have been structured such that every commit passes all tests (except for the coin_age_priority UBSan issue which is fixed outside this PR). The BIP9 modifications are placed first, since the actual consensus validation changes depend on the existence of
DEPLOYMENT_REDUCED_DATA(originally a buried deployment).Two commits are intentionally large because their changes break a large amount of tests, so test adaptations that must land atomically are bundled:
45c004e30eand983555f940.