Skip to content

feat(queue): accept chain-detail's four row families in one message - #9678

Merged
JSONbored merged 1 commit into
mainfrom
queue/chain-detail-families
Aug 6, 2026
Merged

feat(queue): accept chain-detail's four row families in one message#9678
JSONbored merged 1 commit into
mainfrom
queue/chain-detail-families

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Closes metagraphed-infra#359.

chain-detail posts blocks, extrinsics, chain events and account events in one request because they must land in one write: a block whose drill-down shows no calls is readable and wrong. SyncBatchMessage carried a single rows array, so this lane had no shape to move in.

Widened, not split

The issue offered one-message-per-family or a family map. The first loses the property the four are posted together for — four messages retry independently — so it is rejected on that basis rather than chosen for being easiest.

families is optional and mutually exclusive with rows:

  • every existing lane carries one array and is untouched — widening costs them nothing
  • only a lane in MULTI_FAMILY_LANES may send families, and only the names in MULTI_FAMILY_LANE_ROW_FAMILIES, so an unrecognised family is refused rather than written to a guessed table
  • a message carrying both shapes is refused — accepting both would leave the writer to guess which is authoritative and silently drop one

The row count is the sum

passTallyFor counts families as well as rows. Counting only rows would credit zero and a declared pass would never close.

It throws rather than splitting

packMultiFamilyMessage refuses an oversize chunk instead of degrading into the split the shape exists to prevent.

That constraint bites today, and a test says so. The producer batches 2 blocks per POST at ~350–662 KiB against a 128 KB cap — so this lane cannot be cut over until the producer posts smaller batches.

Shipped wired and inert (SYNC_QUEUE_LANES does not name it), with the blocker recorded in a test rather than left to be rediscovered at cutover. That follow-up belongs on the producer side.

On the Workflows alternative

metagraphed-infra#363 flags Workflows as a candidate here, and a step boundary would also give atomicity. This is the smaller change: it is contained to a shape three lanes already ignore, adds no new platform primitive, and does not block a Workflows evaluation later — if that lands, this becomes one fewer reason to need it.

Verification

  • full suite: 703 files / 17,065 tests green
  • 11 new tests covering: families replacing rows, the summed tally, refusal of both-shapes / foreign lanes / unknown family names / empty and non-array families, the throw-not-split rule, single-call dispatch to the family writer, and a loud throw when no family writer is wired

Closes metagraphed-infra#359.

chain-detail posts blocks, extrinsics, chain events and account events in one
request because they must land in one write: a block whose drill-down shows no
calls is readable and WRONG. SyncBatchMessage carried one `rows` array, so this
lane had no shape to move in.

## Widened, not split

The issue offered one-message-per-family or a family map. The first loses the
property the four are posted together FOR -- four messages retry independently
-- so it is rejected on that basis rather than chosen for being easiest.

`families` is OPTIONAL and MUTUALLY EXCLUSIVE with `rows`. Every existing lane
carries one array and is untouched; only a lane in MULTI_FAMILY_LANES may send
families, and only the names in MULTI_FAMILY_LANE_ROW_FAMILIES, so an
unrecognised family is refused rather than written to a guessed table. A message
carrying both shapes is refused too -- accepting both would leave the writer to
guess which is authoritative and silently drop one.

## The row count is the sum

passTallyFor counts families as well as rows. Counting only `rows` would credit
zero and a declared pass would never close.

## It throws rather than splitting

packMultiFamilyMessage refuses an oversize chunk instead of degrading into the
split the shape exists to prevent.

THAT CONSTRAINT BITES TODAY, and the test says so: the producer batches 2 blocks
per POST at ~350-662 KiB against a 128 KB cap. So this lane CANNOT be cut over
until the producer posts smaller batches. Wired and inert -- SYNC_QUEUE_LANES
does not name it -- with the blocker recorded in a test rather than left to be
rediscovered at cutover.

- full suite 703 files / 17,065 tests green
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
metagraphed-data-api 9a756ab Aug 06 2026, 12:31 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
metagraphed-registry-sync-api 9a756ab Aug 06 2026, 12:31 PM

@superagent-security

Copy link
Copy Markdown

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Aug 6, 2026
@JSONbored
JSONbored merged commit a32f692 into main Aug 6, 2026
7 checks passed
@JSONbored
JSONbored deleted the queue/chain-detail-families branch August 6, 2026 20:40
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