mirror of
https://github.com/luxfi/graph.git
synced 2026-09-24 00:26:07 +00:00
d24bd62198fa504d743a4eff144df20dc5694472
Item 4: the 3-consecutive-poll hysteresis alone could be satisfied by a deeply-stale load-balanced RPC backend held >reorgDepth behind for the full window (~6s), wiping a still-canonical chain and re-indexing from genesis (DoS amplification). Keep the streak as a CHEAP PRE-FILTER, but gate the actual rewind on a deterministic signal: the chain's genesis (block 0) hash. Every node serves block 0 regardless of how far behind its head is, so an unchanged genesis hash deterministically rules out a re-genesis even on a deeply-lagging backend (unlike a cursor by-number/by-hash probe, which a backend whose head is below the cursor cannot serve and would false-trip). Honors the no-eth_getCode rule (only eth_getBlockByNumber 0x0 header is read). The probe is a struct field (genesisHashFn) so tests drive canonicality without a live RPC; baseline captured lazily before any reset decision. Fail-closed: a probe error or missing baseline never wipes. 3 existing regenesis tests updated to the new signature/semantics + 3 new (deeply-behind-but-canonical => NO wipe; changed genesis => wipe; probe-fails => NO wipe). Full indexer+engine suites green.
Description
Single-binary GraphQL query layer for Lux blockchain — replaces The Graph's Graph Node
27 MiB
Languages
Go
99.9%
Dockerfile
0.1%