[QmZsgJLiLQKpb8hxTmQ5LWyrFVvfWzVaL4WK8dfFBn7EeK] `handleInitialize` drops the Pool when a currency's `decimals()` reverts
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 70/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- blockchain
Línea de trabajo
Comienza en src/mappings/poolManager.ts, en handleInitializeHelper, y sigue fetchTokenDecimals en src/utils/token.ts, comparando su comportamiento con fetchTokenSymbol y fetchTokenName. Revisa la protección Pool.load en src/mappings/swap.ts y reproduce la ruta afectada de Initialize y Swap. Se considera terminado cuando una llamada a decimals() que hace revert ya no impide que Pool se almacene ni que sus swaps se procesen.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Repo: Uniswap/v4-subgraph
Deployment seen on: QmZsgJLiLQKpb8hxTmQ5LWyrFVvfWzVaL4WK8dfFBn7EeK (V4, Ethereum mainnet)
Problem
If a pool is initialized with a token whose decimals() reverts, handleInitializeHelper returns
early and never saves the Pool entity. The Initialize event is lost permanently, so the pool
and all of its swaps are missing from the subgraph.
src/mappings/poolManager.ts#L78-L84:
const decimals = fetchTokenDecimals(event.params.currency0, tokenOverrides, nativeTokenDetails)
// bail if we couldn't figure out the decimals
if (decimals === null) {
log.debug('mybug the decimal on token 0 was null', [])
return
}
Same for currency1 at #L105-L110
(note: that branch logs "token 0" too, which is misleading).
fetchTokenDecimals
returns null whenever try_decimals() reverts. By contrast,
fetchTokenSymbol
and fetchTokenName
already fall back to 'unknown'. Decimals is the only metadata call that aborts indexing instead of
degrading gracefully.
Real occurrence
| Block | 25709273 |
| Tx | 0x812855aba2c3764d3df74f90e9549e543a75ae6735a8f2f0a7a52b1c31f81114 |
| Pool id | 0xc8a28c2bcce2f26a172a85ac5162d5240d26970d95494c446b27bf1b8e982e45 |
| currency0 | 0x0000000000000000000000000000000000000000 (native) |
| currency1 | 0xf1d2d880c5dde7cc912636c2b4d080b3fe5f7b50 |
currency1 reverts on the whole ERC-20 metadata surface (it is a deployed contract, just not a
standard ERC-20):
$ cast call 0xf1d2d880c5dde7cc912636c2b4d080b3fe5f7b50 "decimals()" --block 25709273
Error: execution reverted
Initialize (logIndex 208) and the pool's first Swap (logIndex 211) are in the same
transaction, so the pool breaks immediately. Result in the store: no Pool row, no Token row,
no swaps - the pool simply does not exist.
Two different symptoms
The current main already guards the load in
src/mappings/swap.ts#L163-L168:
const pool = Pool.load(poolId)
if (!pool) {
log.warning('Pool not found: {}', [poolId])
return
}
So depending on the build:
-
Older builds (like the deployment above, which non-null-asserts the pool) abort the handler:
Mapping aborted at src/mappings/swap.ts, line 39, column 16, with message: unexpected nullWith
nonFatalErrorsenabled the subgraph is then stuckunhealthyforever. The error is
deterministic, so it hits every indexer and cannot be repaired by rewinding or resyncing. -
Current
mainlogs a warning and returns - no error, but the pool's swaps, volume and TVL are
silently missing from all aggregates. Arguably worse, since nothing surfaces the gap.
Either way the underlying cause is the same: the Pool was never created.
Impact
- Pools with any non-standard-
decimals()currency are entirely absent from the subgraph. - Their swaps never contribute to
PoolDayData/TokenDayData/UniswapDayData. - Not fixable operationally - only a mapping change and redeploy helps.
- Lenguaje dominante
- Rust
- Estrellas
- 3.2k
- Forks
- 1.1k
- Merge medio
- 4 d 1 h
- PR fusionados (30 d)
- 1
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de graphprotocol/graph-node
-
current: include emits an all-null bucket for dimensionless aggregations, nulling the whole response Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
graphprotocol/graph-node#6719 ·
-
RUSTSEC-2026-0194: Quadratic run time when checking a start tag for duplicate attribute names Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
graphprotocol/graph-node#6673 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
graphprotocol/graph-node#6650 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
graphprotocol/graph-node#6722 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
graphprotocol/graph-node#6721 ·
Todos los issues de graphprotocol/graph-node
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
ontola/atomic-server#1625 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
VirusTotal/yara-x#777 ·
-
has_tail_capacity wraps and get_writable_raw_unchecked commits raw_len before the bounds check Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
stratum-mining/stratum#2404 ·
-
bug ci good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100