Skip to content

Implement SubmitSharesExtended handler #14

@average-gary

Description

@average-gary

Summary

Handle SubmitSharesExtended messages from extended channel proxies, validate proof-of-work, and respond with success/error.

Context

Extended channel submissions include the extranonce chosen by the proxy, in addition to the standard fields. The ExtendedChannel::validate_share() method validates the full share including the proxy-chosen extranonce against the allocated prefix and size.

Tasks

  • Route SubmitSharesExtended to the correct ExtendedChannel by channel_id
  • Call extended_channel.validate_share(msg)
  • Handle ShareValidationResult variants (same as standard, but with extended extranonce context):
    • Valid(hash) -> SubmitShares.Success
    • BlockFound(hash, template_id, coinbase) -> trigger block assembly
    • Error variants -> SubmitShares.Error
  • Validate that submitted extranonce falls within the allocated prefix + size range
  • Batch success responses for efficiency
  • Track share counts per extended channel

Acceptance Criteria

  • Valid extended shares with correct extranonce are accepted
  • Extranonce outside allocated range is rejected
  • Block-found triggers block submission
  • Unit tests: valid extended share, block found, extranonce validation, invalid extranonce

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase:4-sharesShare submission, validation, Emission bridgesv2Stratum v2 related

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions