graphprotocol / graphprotocol/graph-node

Add support for failed transactions

未关闭
#1,055 5 条评论 12 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

chains/ethereum enhancement projects/synthetix
主要语言
Rust
星标
3.2k
派生
1.1k
平均合并
4 天 1 小时
30 天内合并 PR
1

描述

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
Transactions do not support the status flag from receipts, nor do they support the error reason (gas or revert reason). Moreover only successful call transactions will invoke a subgraph's handlers.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?
That a failed transaction from an invocation of a call handler would:
a) Trigger the call handler in the subgraph
b) That the EthereumTransaction class would contain the following:
* a flag for status reflecting the success status of the transaction
* an errorType - reverted or out-of-gas (others?)
* the revertReason if any (which is easy to surface in ethers and web3)

The main motivation for something like this is for projects, such as ours, to track errors users have when interacting with our contracts (for monitoring tools). As users pay gas even for failed transactions, it's critical to minimize these where possible. It's even more important when they call our functions from their own contracts. As you can imagine, these calls are harder to track as unlike regular transactions invoking our contracts directly (where we are the to destination of the transaction) - their to destination is their contract which is calling ours by reference in the code.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

Issue 提到了 EthereumTransaction 类和 subgraph call handler,但没有提供任何 repository 文件或测试。首先跟踪 receipts 和 call handler 的处理方式,然后确定失败交易应如何表示和分发。完成标准是:失败的 call 会触发 handler,并公开 status、错误类型以及任何 revert reason。

由索引模型根据 Issue 内容生成。

评估

技术栈
blockchain, graphql, rust
领域
backend-api-design, blockchain
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。