简体   繁体   English

Go-Ethereum 中的两个未知参数 function

[英]two unknow parameters in Go-Ethereum function

Im new in Go-EVM, and some time ago I got a source code to get transaction tracking.我是 Go-EVM 的新手,前段时间我得到了一个源代码来获取事务跟踪。 But some functions in the source codes have been updated and changed, here are some questions I wanna ask:但是源代码中的一些功能已经更新和更改,这里有一些我想问的问题:

The first one is: How to get *snapshot.Tree?第一个是:如何获取*snapshot.Tree?

stateDB, err := state.New(block.Root(), state.NewDatabase(db))   

Now this statements need three parameter and the lost parameter's type is *sanpshot.Tree.现在这个语句需要三个参数,丢失参数的类型是*sanpshot.Tree。 It is a struct, here is the link to its source code , in line 164.它是一个结构,这里是它的源代码的链接,在第 164 行。

The second one is: What are AsseccList and GasTipFee?第二个是:AsseccList 和 GasTipFee 是什么?

message := types.NewMessage(from, tx.To(), 0, tx.Value(), tx.Gas(), from Address, to Address, nonce, amount, gasLimit, tx.GasPrice(), GasTopfee, GasTipFee, tx.Data(), accesslist AccessList, false)   

AccessList is also a struct. AccessList 也是一个结构。 You can see its struct from here .你可以从这里看到它的结构。 What should I input into AccessList and GasTipFee?我应该在 AccessList 和 GasTipFee 中输入什么?
Really appreciate it if you can help me solve these questions.如果您能帮我解决这些问题,我将不胜感激。

In your case you do not need to pass a tree snapshot if you do not have one.在您的情况下,如果您没有树快照,则不需要传递树快照。 The purpose of the tree snapshot is to, if the snapshot matches with the given root of the block's trie, run what they call a pre-fetcher routine, that is in charge of preloading nodes in memory so that when the state reaches the commit phase, it is more performant because it already has most of the required nodes in memory.树快照的目的是,如果快照与块的树的给定根匹配,则运行他们所谓的预取程序,该程序负责预加载 memory 中的节点,以便当 state 到达提交阶段时,它的性能更高,因为它已经拥有 memory 中所需的大部分节点。 So in your case, you should be perfectly fine passing nil to that constructor.因此,在您的情况下,您应该完全可以将nil传递给该构造函数。

As for the AccessList and GasTipFee parameters:至于AccessListGasTipFee参数:

  • AccessList is an EIP-2930 access list. AccessList是一个EIP-2930访问列表。 It's once again something optional that transactions can provide to specify the addresses and storage keys that they need access to.交易可以提供指定它们需要访问的地址和存储密钥的可选功能。 Once again you can provide a nil slice.你可以再一次提供一个nil切片。
  • What you have called GasTipFee is called GasTipCap on master and is basically the limit value of a gas tip, as far as I understand.据我所知,您所说的GasTipFee 在 master 上称为GasTipCap GasTipFee是气尖的极限值。 You can find more information on gas fees in the official documentation.您可以在官方文档中找到有关 gas 费用的更多信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 go-ethereum 安装中创建命令? - Make command in go-ethereum installation? 如何将 AWS 区块链服务与 go-ethereum 一起使用? - How to use the AWS blockchain service with go-ethereum? 没有 abi 的 go-ethereum 编码或解码输入数据 - go-ethereum encoding or decoding input data without abi 使用 glide 安装 go-ethereum 依赖项和tendermint 依赖项 - install go-ethereum dependencies and tendermint dependencies with glide 如何通过 go-ethereum 创建 eth 帐户? - How can I create eth account via go-ethereum? 为什么命令“ go clean -n -r -igithub.com/ethereum/go-ethereum…”不起作用? - Why command “go clean -n -r -i github.com/ethereum/go-ethereum…” does not work? 从 go-ethereum 实现 Ethereum Personal_sign (EIP-191) 给出了与 ethers.js 不同的签名 - Implementing Ethereum personal_sign (EIP-191) from go-ethereum gives different signature from ethers.js “不支持交易类型”尝试使用 Go-Ethereum、Solidity、Go 部署简单合约时。 不会发生在 Remix 中 - "transaction type not supported" When trying to deploy a simple contract using Go-Ethereum, Solidity, Go. Doesn't happen in Remix Istanbul-tools安装错误:github.com/ethereum/go-ethereum/crypto/bn256/cloudflare.gfpMul:重定位目标runtime.support_bmi2未定义 - Istanbul-tools installation error: github.com/ethereum/go-ethereum/crypto/bn256/cloudflare.gfpMul: relocation target runtime.support_bmi2 not defined 函数参数中的多态性 - Go polymorphism in function parameters
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM