获取CALL_EXCEPTION详细信息

huangapple go评论53阅读模式
英文:

Get CALL_EXCEPTION details

问题

我正在运行私有的Geth节点,想知道是否有办法找到交易异常的根本原因。当我发送交易时,我只能看到以下信息:

交易失败 [ 查看:
https://links.ethers.org/v5-errors-CALL_EXCEPTION ]

而当我在Hardhat网络中运行相同的交易时,我能够获取更多细节:

在处理交易时出现VM异常:使用panic代码回滚
0x11(算术操作在未检查的区块外部下溢或上溢)

是否有可能从我的Geth节点获取相同的信息?

英文:

I am running private geth node and I am wondering if there is any way to find the root cause of transaction exception. When I send the transaction, all I can see is:

> transaction failed [ See:
> https://links.ethers.org/v5-errors-CALL_EXCEPTION ]

And when I run the same transaction in hardhat network, I get more details:

> VM Exception while processing transaction: reverted with panic code
> 0x11 (Arithmetic operation underflowed or overflowed outside of an
> unchecked block)

Is it possible to get the same info from my geth node?

答案1

得分: 2

  • 使用交易重播提取还原原因,详见示例实现。这设置了您的节点必须存储的数据要求,以便能够重播交易。请查看您的节点配置和详细用例以进行进一步诊断。

  • 您的节点必须支持 EIP-140EIP-838。这已经存在了很多年,所以您的节点不太可能不支持它们。

  • 除非智能合约明确还原,否则默认还原(具有价值的可支付函数调用,数学错误)的 JSON-RPC 错误消息取决于节点类型,并可能在不同节点之间有所不同。

  • Hardhat 内部使用的是 Ganache 模拟节点,而不是 GoEtheruem。

英文:
  • The revert reason is extracted using transaction replay, see the example implementation. This sets requirements for what data your node must store in order to be able to replay the transaction. See your node configuration and detailed use case for further diagnosis.

  • Your node must support EIP-140 and EIP-838. This has been case for many years now so it is unlikely your node does not support this.

  • Unless a smart contract explicitly reverts, the default reverts (payable function called with value, math errors) JSON-RPC error messages depend on the node type and may vary across different nodes

  • Hardhat is internally using Ganache simulated node, not GoEtheruem

huangapple
  • 本文由 发表于 2023年1月9日 03:28:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/75050673.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定