Skip to content

refine extranonce assumptions#1944

Merged
plebhash merged 14 commits into
stratum-mining:mainfrom
plebhash:2025-10-10-extranonce-sizes
Oct 14, 2025
Merged

refine extranonce assumptions#1944
plebhash merged 14 commits into
stratum-mining:mainfrom
plebhash:2025-10-10-extranonce-sizes

Conversation

@plebhash

@plebhash plebhash commented Oct 10, 2025

Copy link
Copy Markdown
Member

close #1861

summary of changes:

  • simplified try_strip_bip141 for better maintainability
  • validation of extended shares now takes rollable_extranonce_size into consideration
  • full_extranonce_size of extended channels (both server and client sides) is always calculated based on extranonce_prefix plus rollable_extranonce_size, and no longer assumed to be MAX_EXTRANONCE_LEN
  • rollable_extranonce_size never changes across the lifespan of a channel (even after SetExtranoncePrefix)
  • JobFactory takes full_extranonce_size as a parameter on a few methods, which is used to set appropriate scriptSig_len values inside coinbase_tx_prefix
  • GroupChannel takes full_extranonce_size as a parameter on its constructor, since JobFactory now needs it
  • adapts JDC with fixed extranonce assumptions
  • adapts Pool with fixed extranonce assumptions

@plebhash plebhash force-pushed the 2025-10-10-extranonce-sizes branch from a4edd07 to 40a14f5 Compare October 13, 2025 15:51
@plebhash plebhash marked this pull request as ready for review October 13, 2025 15:52
Comment thread protocols/v2/channels-sv2/src/client/extended.rs Outdated
Comment thread protocols/v2/channels-sv2/src/server/extended.rs
Comment thread protocols/v2/channels-sv2/src/server/extended.rs Outdated
Comment thread roles/jd-client/src/lib/channel_manager/template_message_handler.rs
Comment thread roles/jd-client/src/lib/channel_manager/upstream_message_handler.rs
Comment thread roles/jd-client/src/lib/channel_manager/upstream_message_handler.rs
plebhash added a commit to plebhash/stratum that referenced this pull request Oct 13, 2025
@plebhash plebhash force-pushed the 2025-10-10-extranonce-sizes branch from 11704ad to 6823db3 Compare October 13, 2025 22:13
@plebhash plebhash force-pushed the 2025-10-10-extranonce-sizes branch 4 times, most recently from 47b4a89 to 2549a5d Compare October 14, 2025 15:05

@Shourya742 Shourya742 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.

LGTM. Some minor suggestions.

Comment thread protocols/v2/channels-sv2/src/client/extended.rs Outdated
Comment thread protocols/v2/channels-sv2/src/server/jobs/factory.rs Outdated
@plebhash plebhash force-pushed the 2025-10-10-extranonce-sizes branch from 2549a5d to 4020799 Compare October 14, 2025 18:06
@plebhash plebhash merged commit cc98bd0 into stratum-mining:main Oct 14, 2025
11 checks passed
@plebhash plebhash deleted the 2025-10-10-extranonce-sizes branch October 14, 2025 18:35
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.

need to re-evaluate strategies around extranonce sizes on channels_sv2

3 participants