Skip to content

relaymonitor: page forward-fill through dense windows - #883

Open
damilolaedwards wants to merge 1 commit into
ethpandaops:masterfrom
damilolaedwards:fix/relaymonitor-forward-fill-cursor-gap
Open

damilolaedwards wants to merge 1 commit into
ethpandaops:masterfrom
damilolaedwards:fix/relaymonitor-forward-fill-cursor-gap

Conversation

@damilolaedwards

Copy link
Copy Markdown

Summary

Forward-fill fetched one page per tick and advanced the cursor to the highest slot in the response. On a relay with many builder submissions per slot, a single limit-capped page can return only the top few slots of the requested range, so the cursor jumped straight to the top of the window while the slots below it were never fetched. Because forward-fill only ever moves the cursor forward, those slots were skipped for good.

fetchForwardFillWindow now pages down through the window, lowering the cursor to just below the lowest slot seen each time the response comes back truncated, until the window is fully covered down to the current position or a page budget is hit. The cursor is only advanced once the whole window is proven covered. If the budget runs out on a very dense window, the location is left unchanged and the same window is retried on the next tick rather than silently skipping part of it.

Test plan

  • go build ./...
  • go test ./pkg/relaymonitor/... -race
  • New tests cover a window that pages through cleanly within the budget (asserting every slot is delivered and the cursor lands at the expected value), and a window too dense for the budget (asserting no location update happens rather than a partial, gap creating one)

Forward-fill fetched one page per tick and advanced the cursor to the
highest slot in the response. On a relay with many builder
submissions per slot, a single limit-capped page can return only the
top few slots of the requested range, so the cursor jumped straight
to the top of the window while the slots below it were never
fetched. Because forward-fill only ever moves the cursor forward,
those slots were skipped for good.

fetchForwardFillWindow now pages down through the window, lowering
the cursor to just below the lowest slot seen each time the response
comes back truncated, until the window is fully covered down to the
current position or a page budget is hit. The cursor is only
advanced once the whole window is proven covered. If the budget runs
out on a very dense window, the location is left unchanged and the
same window is retried on the next tick rather than silently skipping
part of it.

Added tests covering both cases: a window that pages through cleanly
within the budget, and one dense enough that it should make no
progress rather than a partial, gap-creating one.
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