Skip to content

add Sv2 string to coinbase tag standard - #2226

Merged
bit-aloo merged 1 commit into
stratum-mining:mainfrom
plebhash:2026-07-16-new-coinbase-tag-standard
Aug 5, 2026
Merged

add Sv2 string to coinbase tag standard#2226
bit-aloo merged 1 commit into
stratum-mining:mainfrom
plebhash:2026-07-16-new-coinbase-tag-standard

Conversation

@plebhash

@plebhash plebhash commented Jul 16, 2026

Copy link
Copy Markdown
Member

as proposed in #2141 (comment)

@plebhash
plebhash force-pushed the 2026-07-16-new-coinbase-tag-standard branch from 502eba5 to 4d3b149 Compare July 16, 2026 12:55
@plebhash
plebhash marked this pull request as draft July 16, 2026 13:25
@plebhash
plebhash force-pushed the 2026-07-16-new-coinbase-tag-standard branch from 4d3b149 to 9184c10 Compare August 3, 2026 18:40
@plebhash
plebhash marked this pull request as ready for review August 3, 2026 18:42

@GitGab19 GitGab19 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change tests from predefined static values to real shares research?

@plebhash

plebhash commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

Why did you change tests from predefined static values to real shares research?

adding Sv2 to the scriptSig changes the coinbase tx, which changes the merkle root, which invalidates every hardcoded nonce in these tests, so they had to be re-mined either way.


when I originally wrote those pre-defined shares it was a very laborious process to find the right nonces and hardcode them, so this time I went with a bounded search instead.

it's deterministic (fixed ntime/extranonce/version), so no flakiness, just an extra bit of CPU on every execution.

and only the positive cases became searches — the DoesNotMeetTarget tests still use fixed shares, so a too-lax target check would still fail.


I didn't see major harm in this approach, but happy to switch back if you prefer to stick to the old way.

I'm sure agents could re-mine the constants now if I give them explicit instructions.

Comment thread sv2/channels-sv2/src/server/extended.rs Outdated
Comment thread sv2/channels-sv2/src/server/extended.rs Outdated
Comment thread sv2/channels-sv2/src/server/standard.rs Outdated
@plebhash
plebhash force-pushed the 2026-07-16-new-coinbase-tag-standard branch from 9184c10 to 047fe86 Compare August 4, 2026 14:29
@plebhash

plebhash commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

@GitGab19 incorporated suggestions with pre-mined shares

fwiw #2236 was also introducing dynamic shares into tests, adapting accordingly before we merge

@bit-aloo
bit-aloo self-requested a review August 4, 2026 14:37
@plebhash
plebhash force-pushed the 2026-07-16-new-coinbase-tag-standard branch from 047fe86 to ea0f12b Compare August 4, 2026 15:46

@bit-aloo bit-aloo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@bit-aloo
bit-aloo merged commit b13195e into stratum-mining:main Aug 5, 2026
14 checks passed
@plebhash
plebhash deleted the 2026-07-16-new-coinbase-tag-standard branch August 5, 2026 11:31
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.

3 participants