graphprotocol / graphprotocol/graph-node

unknown import: `ethereum::ethereum.call` has not been defined

未关闭
#4,309 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

offchain
主要语言
Rust
星标
3.2k
派生
1.1k
平均合并
4 天 1 小时
30 天内合并 PR
1

描述

Summary

This happens when a file data source handler uses contract calls directly or is in the same AssemblyScript file as other handlers which use contract calls. If the contract call is done by a different handler in the same file, this can be fixed by putting the file data source handler in its own file, which is best practice.

Potential Fix

Contract calls in file data source handlers could be enabled by somehow passing the ethereum.call host fn when instantiating an offchain data source, relevant code:
https://github.com/graphprotocol/graph-node/blob/92670f27d93ed08a6e83805ad644d9004d4d77ee/runtime/wasm/src/host.rs#L137-L141

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 runtime/wasm/src/host.rs 约第 137-141 行开始,追踪 offchain 数据源是如何实例化的。确认缺失的 ethereum.call host 函数如何影响文件数据源处理程序,然后确定是否可以在实例化时传入该函数。当合约调用在所述处理程序场景中不再产生 unknown import 错误时,即表示完成。

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

评估

技术栈
rust, wasm
领域
backend-api-design, blockchain
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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