L2 totalGRTBurned / totalGRTMinted include bridge burns/mints (~99% of "burned" is L2→L1 withdrawals)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- blockchain
Línea de trabajo
Empieza en src/mappings/graphToken.ts líneas 26-37, donde cada Transfer hacia/desde la dirección cero incrementa totalGRTBurned/totalGRTMinted, y en src/mappings/l2Gateway.ts líneas 6-41, donde handleWithdrawalInitiated y handleDepositFinalized ya registran totalGRTWithdrawn/totalGRTDepositedConfirmed. Decide entre los nuevos campos de GraphNetwork sugeridos (actualizados en los handlers del gateway, ya que el Transfer del token precede al evento del gateway en la misma tx) o el manejo de BridgeBurned/BridgeMinted, luego actualiza schema.graphql, regenera los types y ejecuta los tests del subgraph más la query GraphQL de reproducción en los bloques 510908608/510908609 para confirmar que totalGRTBurned ya no se mueve con los withdrawals.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Priority: Not urgent, but please fix this in the next network subgraph update. The reported burn is wildly off.
Summary
On the Arbitrum network subgraph, GraphNetwork.totalGRTBurned counts the Transfer(account, 0x0) emitted by L2GraphToken.bridgeBurn when users withdraw GRT to L1 through L2GraphTokenGateway. Likewise, totalGRTMinted counts bridgeMint on deposits. Those tokens aren't destroyed or newly issued. They're released from, or locked in, the L1 BridgeEscrow.
Numbers
At Arbitrum block 512,550,079:
totalGRTBurned= 1,326,791,691.745 GRTtotalGRTWithdrawn= 1,316,538,491.385 GRT (99.23% of "burned")- Real burns (HorizonStaking, L2Curation, GraphPayments) = 10,253,200.360 GRT
totalGRTMinted= 4,556,212,688.651 GRT, of which bridge deposits (totalGRTDepositedConfirmed) = 3,689,732,064.311 GRT
L1 totalGRTBurned at Ethereum block 26,140,215 is 27,088,912.106 GRT and is not affected. Real burns across both chains are about 37.34M GRT. Adding the two subgraphs together gives about 1.354B GRT.
Verified to the wei against Arbitrum eth_getLogs: the 664,012 Transfer→0x0 logs sum exactly to totalGRTBurned; the 1,897 BridgeBurned events equal the 1,897 WithdrawalInitiated events and sum exactly to totalGRTWithdrawn.
Repro
{
before: graphNetwork(id: "1", block: {number: 510908608}) { totalGRTBurned totalGRTWithdrawn }
after: graphNetwork(id: "1", block: {number: 510908609}) { totalGRTBurned totalGRTWithdrawn }
}
A single 50M GRT withdrawal (tx 0xf5cf39ef9d300233fc458c9be7655979bf85eadb4d4374b2bbc5848addadfe22) increases totalGRTBurned by exactly 50,000,000. The tx contains only the token burn, BridgeBurned, and WithdrawalInitiated. There is no protocol burn in it.
Cause
src/mappings/graphToken.ts#L26-L37treats every Transfer to or from the zero address as a burn or mint.src/mappings/l2Gateway.ts#L6-L41incrementstotalGRTWithdrawn/totalGRTDepositedConfirmedwithout adjusting the burned/minted totals.
totalSupply itself is correct. Only the burned and minted totals are misleading when they're read as protocol burns and issuance.
Suggested fix (non-breaking)
- Add
totalGRTBurnedByBridge/totalGRTMintedByBridge, ortotalGRTBurnedExcludingBridge/totalGRTMintedExcludingBridge, toGraphNetwork, updated inhandleWithdrawalInitiated/handleDepositFinalized. The token Transfer comes before the gateway event in the same tx, so subtracting there works. Or handleBridgeBurned/BridgeMintedon L2GraphToken. - At minimum, document in
schema.graphqlthat the L2 values include bridge flows.
Workaround for consumers until then: realBurned = L1.totalGRTBurned + (L2.totalGRTBurned − L2.totalGRTWithdrawn) and realL2Minted = L2.totalGRTMinted − L2.totalGRTDepositedConfirmed.
- Lenguaje dominante
- TypeScript
- Estrellas
- 82
- Forks
- 47
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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-network-subgraph
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 45/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
graphprotocol/graph-network-subgraph#270 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
graphprotocol/graph-network-subgraph#249 · 5 comentarios ·
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
graphprotocol/graph-network-subgraph#173 · 1 comentario ·
Todos los issues de graphprotocol/graph-network-subgraph
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
kind/chore priority/must
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sidereal-io/sidereal#380 ·
Los mantenedores suelen responder en 1 día
-
Mend: dependency security vulnerability
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
opfab/operatorfabric-core#10653 ·
Los mantenedores suelen responder en 1 día
-
backend bug size:sm
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
chrisbenincasa/tunarr#2237 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 Medio día Aptitud para principiantes 69/100
Lam30ne/regulate-app#39 ·