Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#337 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
blockchain

調査の方向性

src/mappings/graphToken.ts の26-37行目から始める。そこではゼロアドレスとの間のすべての Transfer が totalGRTBurned/totalGRTMinted を増加させている。また src/mappings/l2Gateway.ts の6-41行目では、handleWithdrawalInitiated と handleDepositFinalized がすでに totalGRTWithdrawn/totalGRTDepositedConfirmed を追跡している。提案されている新しい GraphNetwork フィールド(同じ tx では token の Transfer が gateway イベントより先に発生するため、gateway ハンドラーで更新する)と、BridgeBurned/BridgeMinted の処理のどちらかを決定し、その後 schema.graphql を更新し、types を再生成し、サブグラフのテストとブロック 510908608/510908609 にわたる再現用 GraphQL クエリを実行して、totalGRTBurned が withdrawal に伴って動かなくなったことを確認する。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
82
フォーク
47
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphprotocol/graph-network-subgraph のほかの issue

graphprotocol/graph-network-subgraph の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。