Pool+JDC: handle new SeenSharesBudgetExhausted error variant from channels_sv2 share validation - #733
Draft
plebhash wants to merge 3 commits into
Draft
Conversation
channels_sv2 adds a SeenSharesBudgetExhausted variant to the server-side ShareValidationError: validate_share returns it once a channel's accepted-share dedup cache (seen_shares) reaches the budget derived from its expected share rate. The variant carries no error code, so per the enum's contract the embedding application should disconnect the client. Both the standard and extended share-submission paths previously routed this through their generic catch-all arm, which already disconnects, so behavior was correct but the event was logged like any other channel error. Add an explicit arm to both paths that names the condition (the channel's share rate far outran its configured expectation, filling the per-tip dedup cache) before disconnecting, so an operator can tell a closed misbehaving channel apart from a transient fault. No SubmitShares.Error is sent, since the variant has no error code.
…ation JDC acts as a server toward its downstream miners, validating their shares with server-side StandardChannel/ExtendedChannel. Those now return the new ShareValidationError::SeenSharesBudgetExhausted variant when a downstream channel fills its per-tip accepted-share dedup cache, but both downstream share paths funneled every non-code-carrying variant into a `_ => unreachable!()` arm, so this would panic the handler. Add ShareValidationError to JDCErrorKind's ChannelSv2Error (with a From impl, mirroring the pool) and an explicit arm on both the standard and extended downstream paths that closes the offending downstream via JDCError::disconnect. No SubmitShares.Error is sent, since the variant has no error code to carry. The upstream-facing paths validate with client-side channels, whose ShareValidationError has no such variant, so they are unaffected.
DO NOT MERGE. Temporary commit so CI can build against the companion stratum branch before it lands on stratum-mining/stratum. Repoints the stratum-core git dependency from stratum-mining/stratum#main to plebhash/stratum#2026-08-17-channels-sv2-hardening (which carries the SeenSharesBudgetExhausted variant these changes depend on) in stratum-apps and bitcoin-core-sv2, and regenerates the committed lockfiles so the --locked CI builds resolve the fork. Revert this commit once the stratum PR is merged and stratum-core is released (or the branch dependency is bumped to the merged rev).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
companion stratum-mining/stratum#2303
draft due to e6cb12f (avoids accidental merging)
but ready for review