feat: enrich AMM token metadata — bump graph v1.2.3→v1.2.6 + opt-in backfill

graph v1.2.6 reads ERC20 symbol/name/decimals for AMM Token entities
(was address-placeholder). supervisor.go runs graph's BackfillTokens at
startup when BACKFILL_TOKENS=1 to enrich existing placeholder rows in
place (≤3 eth_calls/token, no re-sync), before the live indexer loop.
This commit is contained in:
2026-06-21 23:55:00 -07:00
parent 066a8060c6
commit feaa1442b5
3 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ go 1.26.4
require (
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674
github.com/luxfi/graph v1.2.3
github.com/luxfi/graph v1.2.6
github.com/luxfi/indexer v1.4.5
github.com/luxfi/mdns v0.1.1
github.com/mattn/go-sqlite3 v2.0.3+incompatible
+2
View File
@@ -181,6 +181,8 @@ github.com/luxfi/geth v1.16.98 h1:w187TtKuGStf3tm2bshuHVKBv2Frjx0lT54kQVXyNHA=
github.com/luxfi/geth v1.16.98/go.mod h1:6kEzSExdk9CPQDPXALt6P3HfQqBq7KF1Jrrv9gBpxbU=
github.com/luxfi/graph v1.2.3 h1:cgHiBU8vBO4b39HnVr1UewEAeP3Bx+JZBHlfacTvDZQ=
github.com/luxfi/graph v1.2.3/go.mod h1:NbKTixz6Miunyh+7ER3G389mzUKV22QIVPjpcTnKZuY=
github.com/luxfi/graph v1.2.6 h1:iapa/PB2UqLzHyAT5bM8173PfRISDJSbBYFuVcjcPJY=
github.com/luxfi/graph v1.2.6/go.mod h1:NbKTixz6Miunyh+7ER3G389mzUKV22QIVPjpcTnKZuY=
github.com/luxfi/ids v1.2.13 h1:lEotq0WUpMLcc/5X5MbE3n73jdfNo8IlFvTDfUXg+9A=
github.com/luxfi/ids v1.2.13/go.mod h1:QWjJvggX/nRkmrz1AGSaF2Y6mnOvz3g7lFOzs3Zd+JM=
github.com/luxfi/indexer v1.4.5 h1:vfYgM/hnNujjS47B7/VKAxFJHsFhhME0SnLaAAaYuwA=
+12
View File
@@ -307,6 +307,18 @@ func (s *ChainSupervisor) runSubgraph(ctx context.Context, cfg ChainConfig, sg S
PoolManager: cfg.PoolManager, // empty => indexer defaults to 0x9999
StartBlock: cfg.Indexer.StartBlock,
}, store)
// One-shot enrichment of Token rows persisted by an older graph build with the
// address placeholder (symbol == shortAddr). Opt-in via BACKFILL_TOKENS=1; runs
// before Run so live indexing is not racing the same SeedToken writes. Cheap:
// ≤3 eth_calls per placeholder token, no re-sync. New tokens are enriched on
// first sight regardless of this flag.
if os.Getenv("BACKFILL_TOKENS") == "1" {
if n, err := idx.BackfillTokens(ctx); err != nil {
log.Printf("[%s/%s] token backfill: %v (enriched=%d)", cfg.Slug, sg.Name, err, n)
} else {
log.Printf("[%s/%s] token backfill: enriched=%d", cfg.Slug, sg.Name, n)
}
}
go func() {
if err := idx.Run(ctx); err != nil && ctx.Err() == nil {
log.Printf("[%s/%s] indexer: %v", cfg.Slug, sg.Name, err)