Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

L2 totalGRTBurned / totalGRTMinted include bridge burns/mints (~99% of "burned" is L2→L1 withdrawals)

Abierto Apto para principiantes
#337 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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 GRT
  • totalGRTWithdrawn = 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

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, or totalGRTBurnedExcludingBridge / totalGRTMintedExcludingBridge, to GraphNetwork, updated in handleWithdrawalInitiated / handleDepositFinalized. The token Transfer comes before the gateway event in the same tx, so subtracting there works. Or handle BridgeBurned / BridgeMinted on L2GraphToken.
  • At minimum, document in schema.graphql that 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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de graphprotocol/graph-network-subgraph

Todos los issues de graphprotocol/graph-network-subgraph

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.