Skip to content

3.x.x: allocate extranonce on subscribe and make the session sequence wrap-safe - #305

Merged
djh58 merged 1 commit into
3.x.xfrom
djh58/prism-b4-stratum-admission
Sep 10, 2026
Merged

djh58 merged 1 commit into
3.x.xfrom
djh58/prism-b4-stratum-admission

Conversation

@djh58

@djh58 djh58 commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Allocate the existing four-byte extranonce when a connection first sends a valid mining.subscribe. Connect-only traffic, health/configuration requests and authorization before subscription consume no shared sequence values. Repeated subscriptions reuse the allocated value; failed allocation leaves the connection unsubscribed. Connection errors use structured tracing.

Refs #276. This is the lazy-allocation slice. Wrap-safe allocation and its collision/expiry/concurrent-frontend tests remain; this PR does not close #276. The wider IP/request budgets are P2.

Target: 3.x.x, directly and independently of #280. Rebased onto f394427, including the ledger ownership split and merged #299. No VERSION or CHANGELOG changes. The four-byte wire value and existing database allocator remain unchanged.

The initial-job lifetime now starts at connection setup, so allocation time counts toward it. A full allocation timeout can consume that lifetime and close the connection after its error response; reconnect obtains a fresh value. The change does not reset or extend that timer.

Validation on the rebased branch:

  • 159 distinct native tests passed: 158 in the complete all-targets run, plus the deliberately ignored PostgreSQL acceptance test invoked explicitly. No failures or environment skips.
  • All eight live qbit regtest scenarios and both physical PostgreSQL failover/replication tests ran. This is functional correctness evidence, not D1 load or physical-host availability qualification.
  • The explicit disposable PostgreSQL test exercised 10,000 connect/close cycles: the sequence remained (1, false); the first real subscription changed it to (1, true). CI invokes the test explicitly, and explicit invocation without a DSN fails.
  • Existing extranonce uniqueness, durable acceptance and deduplication protocol assertions are unchanged. Rebase range-diff confirms the lazy-allocation patch is equivalent; formatting and diff checks pass.

Documentation explains the subscription state, failure/timeout behavior, independent qualification and remaining wrap-safety work, with a link from the native README. All four local deep-review lanes found no actionable issue after rebase and qualification. GitHub deep-review is complete: 12 checks passed (including Cursor), no failures or pending checks, and no actionable review findings. The optional autofix check is disabled/skipped. See the terminal review comment for the ledger and lane limitations.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@djh58

djh58 commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 4769888. Configure here.

@djh58

djh58 commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

Deep-review reached its terminal state at 4769888fa1715e7ab7c39d6249e1de24ee9415b2 against 3.x.x (f394427).

  • 12 successful checks (11 CI checks plus Cursor), zero failures, zero pending. The optional [code]smith autofix check is disabled/skipped.
  • Cursor reviewed this exact head and reported no new issues: 3.x.x: allocate extranonce on subscribe and make the session sequence wrap-safe #305 (review).
  • All four refreshed local lanes had zero actionable findings: native Codex/Astra medium review, thermo review, Fable adversarial review and independent Astra adversarial review. The exact named /code-review medium skill was unavailable, so the native Codex review command was used and recorded; its offline dependency-cache failure was not counted as test evidence.
  • Independent qualification: 159 distinct native tests passed after rebase, with no environment skips. All eight live-node and both physical PostgreSQL cases ran.
  • Ledger: 0 fixed, 0 deferred, 0 rebutted, 0 open; no unresolved review threads and no pending sign-offs. No tenki or codex-on-github result appeared; no result from an absent integration is claimed.

This PR is ready for maintainer review/merge as the lazy-allocation slice. It remains Refs #276: wrap-safe allocation and its collision/expiry/concurrent-frontend tests are still outstanding. No VERSION/CHANGELOG changes.

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.

1 participant