Skip to content

Port of BIP-110 UASF code from Knots#2

Open
v72t wants to merge 81 commits into
29.xfrom
29.3+UASF-BIP110
Open

Port of BIP-110 UASF code from Knots#2
v72t wants to merge 81 commits into
29.xfrom
29.3+UASF-BIP110

Conversation

@v72t

@v72t v72t commented Mar 3, 2026

Copy link
Copy Markdown
Owner

This PR ports the UASF BIP-110 code from Knots to Bitcoin Core v29.3.

Specifically Dathon Ohm's 29.3.knots20260210+UASF-BIP110 branch has been rebased on top of the Bitcoin Core v29.3 release.

…to reduce data push size limit to 256 bytes (except for P2SH redeemScript push)
…l never), limit non-OP_RETURN scripts to 34 bytes
@v72t v72t changed the title Port of BIP-110 UASF Code from Knots. Port of BIP-110 UASF code from Knots Mar 3, 2026
luke-jr and others added 10 commits March 4, 2026 01:26
…AM,UPGRADABLE_TAPROOT_VERSION,OP_SUCCESS} on blocks when DEPLOYMENT_REDUCED_DATA is active (never yet)
Github-Pull: bitcoin#10532
Rebased-From: cd74a23fcf9588199e196ab31bc64972400c2027
… risk

Github-Pull: bitcoin#10532
Rebased-From: e42a2f6beb61df3e3a201804cf3bcce6b00c88ba
…imit; add reduced_data deployment name to allow regtest RPC access for testing
…hout_usage helper for testmempoolaccept results
…eviction threshold

The test was failing because commit 58a329b changed gen_return_txouts()
from using 1 large OP_RETURN output to 734 small OP_RETURN outputs (to
comply with the new MAX_OUTPUT_SCRIPT_SIZE=34 consensus rule in bip444).

This change altered how fill_mempool() fills the mempool, raising the
eviction threshold from ~0.68 sat/vB to ~1.10 sat/vB. The test's
create_package_2p1c() was using hardcoded feerates (1.0 and 2.0 sat/vB),
causing parent1 to be below the new eviction threshold and get rejected.

Solution: Calculate parent feerates dynamically based on the actual
mempoolminfee after fill_mempool() runs. This makes the test robust to
future changes in mempool dynamics.

- Store mempoolminfee in raise_network_minfee()
- Use 2x and 4x mempoolminfee for parent1 and parent2 feerates
- Add logging to show the calculated feerates

Test results with fix:
- mempoolminfee: 1.101 sat/vB
- parent1: 2.202 sat/vB (2x threshold) → accepted ✓
- parent2: 4.404 sat/vB (4x threshold) → accepted ✓
@v72t v72t force-pushed the 29.3+UASF-BIP110 branch 2 times, most recently from c916f62 to 65b9c10 Compare March 4, 2026 01:06
dathonohm and others added 8 commits March 5, 2026 22:54
Without this, the build can potentially pick up on our own tags as if they determine its own version
… push size limit

The tapscript/pushmaxlimit spender uses a leaf script with a 520-byte
push (MAX_SCRIPT_ELEMENT_SIZE). Since SCRIPT_VERIFY_REDUCED_DATA is
included in STANDARD_SCRIPT_VERIFY_FLAGS, the 256-byte reduced push
limit (MAX_SCRIPT_ELEMENT_SIZE_REDUCED) is enforced as mempool policy.
This causes the 520-byte push to be rejected as non-standard.

Without standard=False, the test intermittently tries to submit this
spender to the mempool expecting acceptance, depending on whether the
randomly chosen tx version and co-inputs happen to all be standard.

On the upstream Knots-based branch (bip110-v0.3), this fix was
introduced by the match_more_datacarrier merge (Bitcoin Core PR 28408),
which independently made large tapscript pushes non-standard via
datacarrier size filtering. On this Core-based branch, the same fix
is needed because SCRIPT_VERIFY_REDUCED_DATA has the same effect.

Reproduces with: --randomseed=823027376919141336
@v72t v72t force-pushed the 29.3+UASF-BIP110 branch from 24190dd to 77564fd Compare March 5, 2026 21:55
@PyBLOCK-Bitcoin

PyBLOCK-Bitcoin commented Jun 25, 2026

Copy link
Copy Markdown

Hello, we wanted to use this client to send RDTS templates to SV2 pools, but we were informed that it requires an update.
https://x.com/leo_haf/status/2070226296005603612

Would it be possible to update it as soon as possible so we can implement it in PyBLOCK - Pool?

Thanks in advance.

@v72t @dathonohm @luke-jr @Retropex

@dathonohm

Copy link
Copy Markdown

Hello @PyBLOCK-Bitcoin - have you tried building the port of BIP-110 to Core's master branch? It's sitting a few dozen commits before Core v31 and all tests are passing, so it should work. I may update it to be based on v31 if there is demand and I have time. It most likely has the SV2 compatibility code you need.

@PyBLOCK-Bitcoin

Copy link
Copy Markdown

Hello @PyBLOCK-Bitcoin - have you tried building the port of BIP-110 to Core's master branch? It's sitting a few dozen commits before Core v31 and all tests are passing, so it should work. I may update it to be based on v31 if there is demand and I have time. It most likely has the SV2 compatibility code you need.

No, in the end we bypassed the restriction with your client, and we are already signaling BIP-110 on SV2.
PyBLOCK SV2

@dathonohm

Copy link
Copy Markdown

@PyBLOCK-Bitcoin Magnificent news!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants