Skip to content

fix(#76): structured errors for local eth_getLogs + gasPrice premium - #143

Merged
Reiers merged 1 commit into
mainfrom
fix/76-eth-getlogs-structured-errors
Jul 23, 2026
Merged

fix(#76): structured errors for local eth_getLogs + gasPrice premium#143
Reiers merged 1 commit into
mainfrom
fix/76-eth-getlogs-structured-errors

Conversation

@Reiers

@Reiers Reiers commented Jul 23, 2026

Copy link
Copy Markdown
Owner

See commit message. Ships as v1.9.1 once green.

What:

  1. localGetLogsMaxRange raised from 24h to 7d.
  2. New ErrLocalRangeTooWide / ErrLocalOutOfRetention — surfaced to bridge-off clients instead of the misleading FEVM method requires --vm-bridge-rpc.
  3. EthGasPrice now returns base-fee + gas-premium (mirrors lotus).

Why: today Rabinovitch reported his lantern demon 'suddenly became unavailable to Curio.' Diagnosis in ~/.openclaw/workspace/projects/lantern-internal-notes/rabinovitch-reply-draft-2026-07-23.md. His node was stale, but even fresh it would have served him misleading error text for a chunk of Curio's watcher queries.

Test evidence (from live mainnet on node2 today):

  • eth_getCode on 0xd44bf…f668f7: 15,930-byte match with Glif ✅
  • eth_getLogs in-retention address-filtered: matches Glif (both 0 in the test range) ✅
  • eth_getLogs 500 epochs back (out-of-retention) → previously masked as 'requires --vm-bridge-rpc'; now returns ErrLocalOutOfRetention ✅
  • eth_gasPrice 14% low vs Glif (0x5e7f5d vs 0x6c1438) — this fix closes the delta

Follow-ups NOT in this PR:

- Raise localGetLogsMaxRange from 2880 (24h) to 20160 (~7d at 30s blocks)
  so first-boot Curio watchers can backfill a weekly window without
  chunking. Full-tier retention supports this; PDP/Light tiers still
  benefit for anything inside their retention window.

- Introduce ErrLocalRangeTooWide + ErrLocalOutOfRetention. When the
  local path bails out and the VM bridge is NOT configured, surface
  the specific reason instead of masking it as 'FEVM method requires
  --vm-bridge-rpc'. That mask stays correct for genuinely-FEVM methods
  (e.g. eth_call, #74 parity) but was misleading for eth_getLogs, where
  the client can almost always chunk and get a served answer.

- EthGasPrice now returns parentBaseFee + gasPremium (nblocksincl=10)
  mirroring lotus. Fixes ~14% gasPrice-vs-Glif underprice observed on
  2026-07-23 that could make tx builders stall during base-fee spikes.

Reduces the confusing 'daemon unavailable to Curio' failure mode
Rabinovitch reported today: an in-retention address-filtered query
succeeds locally; an out-of-window query returns a truthful reason
the caller can react to.
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