Skip to content

feat(NET-1186): discover and parse the worker-oriented assignment - #67

Merged
toschoosqd merged 3 commits into
masterfrom
net-1186-worker-assignment-discovery
Aug 5, 2026
Merged

feat(NET-1186): discover and parse the worker-oriented assignment#67
toschoosqd merged 3 commits into
masterfrom
net-1186-worker-assignment-discovery

Conversation

@toschoosqd

Copy link
Copy Markdown
Contributor

Summary

Adds discovery and decoding support for the new WorkerAssignment type (from NET-1180), without touching real chunk-serving. Scope is deliberately narrow — infra only, not a switch-over.

  • visible_assignment() now prefers NetworkState.worker_assignment, falling back to the legacy assignment pointer — mirrors the pattern already used in sqd-portal (PR #125), gated behind mvcc-chunks.
  • fetch_worker_assignment() decodes sqd_assignments::WorkerAssignment alongside the untouched legacy fetch_assignment(); shared gzip-download logic factored out into download_gzipped().
  • In p2p.rs: when an update is sourced from worker_assignment, it's decoded and logged only — never fed to the legacy parser. DatasetsIndex and actual chunk-serving stay on the legacy path entirely.

Notes

  • Out of scope: switching real chunk-serving over to the new format. WorkerAssignmentChunk has no files/base_url — deriving them from schema_id/tables_present needs the schema delivery mechanism, which is separate, not-yet-scoped work (tracked against NET-1180's design doc, not this ticket).
  • Temporarily pins sqd-assignments to NET-1180's branch commit (1e334ec) in both [dependencies] and [dev-dependencies], since the new types aren't on sqd-network's master yet. Marked # TEMPORARY — needs re-pinning to master once sqd-network#214 merges.

Test plan

  • cargo check / test / clippy -D warnings / fmt --check clean, both with and without mvcc-chunks
  • Full suite (lib + e2e + query_concurrency + query_surface), 97 tests, 0 failures

🤖 Generated with Claude Code

- visible_assignment() prefers NetworkState.worker_assignment, falling
  back to the legacy assignment pointer (mirrors sqd-portal's PR #125
  pattern), gated by mvcc-chunks.
- fetch_worker_assignment() decodes sqd_assignments::WorkerAssignment
  alongside the untouched legacy fetch_assignment(); shared gzip-download
  logic factored into download_gzipped().
- p2p.rs: when an update is sourced from worker_assignment, decode and log
  it only -- never fed to the legacy parser, and DatasetsIndex/serving
  stays on the legacy path. WorkerAssignmentChunk has no files/base_url;
  deriving them from schema_id/tables_present needs schema delivery,
  which is separate, not-yet-scoped work (see NET-1180).

Temporarily pins sqd-assignments to NET-1180's unmerged branch commit
(1e334ec) since the new WorkerAssignment/PortalAssignment types aren't on
sqd-network's master yet -- re-pin once NET-1180 lands.

Verified: cargo check/test/clippy/fmt all clean, both with and without
mvcc-chunks -- full suite (lib + e2e + query_concurrency + query_surface),
97 tests, 0 failures.
@toschoosqd
toschoosqd requested a review from define-null July 29, 2026 14:39
…ommit

Picks up define-null's review fixes on sqd-network#214 (worker/portal .fbs split,
last_block_hash moved to the dataset level, assignment_fb.rs facade doc comment) --
none of them touch anything worker-rs uses (no references to PortalAssignment or
last_block_hash anywhere in this repo). Still a TEMPORARY pin pending NET-1180's merge.

Verified: check/test/clippy/fmt clean in both feature configs -- full suite (97
tests: lib + e2e + query_concurrency + query_surface, both configs), run one
target at a time given prior OOM issues on this machine; none recurred.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
NET-1180 (sqd-network#214) merged as 360bbd4. Drops the TEMPORARY branch pin
now that WorkerAssignment/PortalAssignment are on sqd-network's main.

Verified: check/test/clippy/fmt clean in both feature configs -- full suite
(97 tests), run one target at a time given prior OOM issues on this machine;
recurred once mid-run this time (unrelated background memory pressure), all
targets passed cleanly on retry after confirming memory had recovered.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@toschoosqd
toschoosqd merged commit f086368 into master Aug 5, 2026
5 checks passed
@toschoosqd
toschoosqd deleted the net-1186-worker-assignment-discovery branch August 5, 2026 12:46
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.

2 participants