feat(#50): prefetch-on-send (UN-DEPLOYED — needs supervised bridge-off verify)#52
Closed
Reiers wants to merge 2 commits into
Closed
feat(#50): prefetch-on-send (UN-DEPLOYED — needs supervised bridge-off verify)#52Reiers wants to merge 2 commits into
Reiers wants to merge 2 commits into
Conversation
…(UN-DEPLOYED, needs supervised bridge-off verify) When eth_sendRawTransaction publishes a tx locally (#45 Stage 4), start a background StateSearchMsg poll for its message CID on a standalone, generous-deadline context. That background search drives the embedded Bitswap source to pull the freshly-produced message + AMT + receipt blocks into cache as soon as the tx lands. By the time the client's own short- deadline receipt poll runs, the blocks are warm and the receipt resolves locally instead of racing (and losing to) a cold cross-peer Bitswap fetch inside the poll window — the residual that kept #50 open. - new ChainAPI.OnSentTx hook, fired non-blocking after a successful local MpoolPush (mirrors the #44 OnLocalMiss adaptive-warming pattern) - pkg/daemon sendWarmer: per-tx background warm loop, dedup, concurrency cap (64), self-bounded (stop on found / 10m max), bound to daemon root ctx - purely additive + read-only: nil hook = unchanged behavior; never affects the send result; never publishes or mutates state - 5 unit tests (stop-on-found, dedup, concurrency cap, ctx-cancel, nil-safe), pass under -race; full pkg/daemon + rpc/handlers suites green NOT deployed to cc-smoke. Needs live bridge-off verification in a supervised daytime window before merge (the engine builds + unit-tests clean, but the real proof is a bridge-off write-confirm cycle showing zero 'net/bitswap: context canceled' receipt misses).
This was referenced Jun 21, 2026
Closed
Formatting-only; no behavioral change. The branch CI failed on gofmt drift (struct field alignment in sendWarmer). No logic touched.
This was referenced Jun 26, 2026
Reiers
added a commit
that referenced
this pull request
Jun 30, 2026
Reiers
added a commit
that referenced
this pull request
Jun 30, 2026
Part 3 of #50. The embedded daemon hardcoded Glif as the polling Sync head source + cold-block fallback with no opt-out, so a bridge-off node silently fell back to Glif whenever gossip stalled - a hidden third-party dependency. - Config.FallbackRPC overrides the upstream RPC URL (e.g. operator's own Forest), defaulting to the network Glif URL (unchanged behavior). - Config.NoFallbackRPC removes the upstream RPC entirely: head comes only from gossipsub, cold blocks only from gateway+Bitswap. A gossip stall then surfaces as a stalled head (observable) instead of a silent Glif fetch. Refuses to start if libp2p is disabled (no head source at all). Wired so syncSrc/backfillSrc are truly-nil interfaces (not typed-nil) when NoFallbackRPC, and hstore.Sync.pollAndApply guards nil src as a no-op so gossip drives the head alone without nil-panicking. Test: nil-source Sync is a safe no-op leaving head intact. (Part 1 = PR #52 prefetch-on-send, merged. Part 2 = msgsearch bitswap-with-retry, already shipped in the #77 bridge-off parity work.)
Owner
Author
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.
What
Closes the last residual on #50: a freshly-produced message block is not reliably served by random gossip peers within the client's receipt-poll window, so bridge-off the receipt lookup occasionally fails with
net/bitswap: context canceled.This implements #50 fix-option 2 (prefetch-on-send): when
eth_sendRawTransactionpublishes a tx locally, we start a backgroundStateSearchMsgpoll for its message CID on a standalone, generous-deadline context. That background search drives the embedded Bitswap source to pull the message + AMT + receipt blocks into cache as soon as the tx lands — so the client's own short-deadline receipt poll hits a warm cache instead of racing a cold cross-peer fetch.How
ChainAPI.OnSentTxhook, fired non-blocking after a successful localMpoolPush(mirrors the Embedded state-block availability for local eth_call (last blocker for --vm-bridge-rpc-disable) #44OnLocalMissadaptive-warming pattern).pkg/daemonsendWarmer: per-tx background warm loop with dedup, a concurrency cap (64), self-bounding (stop on found / 10-minute max), bound to the daemon root context (cancelled on Stop).Tests
-race.pkg/daemon+rpc/handlerssuites green.go vetclean,CGO_ENABLED=0.The engine builds and unit-tests clean, but the real proof is a bridge-off write-confirm cycle on cc-smoke showing zero
net/bitswap: context canceledreceipt misses across several sends. That is a supervised, daytime, bridge-off test (per ops policy — bridge-off proving tests are not run unsupervised).This PR is intentionally opened separate from / unrelated to the in-flight mainnet PDP first-proof window (that runs bridge-ON on Curio Core and has nothing to do with this Lantern bitswap path). Parking it here as code-complete so the daytime session is "deploy + watch", not "write from scratch".
Verification checklist (for the supervised session)
eth_sendRawTransaction: published locally+ a background warm kicks in (add a debug log if needed).net/bitswap: context canceledacross N sends.