受EIP-1159影响的JSON RPC API
source link: http://blog.hubwiz.com/2021/08/01/EIP-1159-json-rpc-changes/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
受EIP-1159影响的JSON RPC API
发表于 2021-08-01
| 分类于 以太坊
EIP-1159升级了以太坊的交易定价机制,将gasPrice分为base和tip两部分。EIP-1159 不能兼容之前的版本,因此将导致硬分叉。包含EIP-1159升级的分叉被称为伦敦分叉, 大约在8月4日发生。在这篇文章中,我们将介绍EIP-1159造成的以太坊JSON RPC API变化。
用自己熟悉的语言学习 以太坊开发 : Java | Php | Python | .Net / C# | Golang | Node.JS | Flutter / Dart
eth1.0-apis仓库 没有版本号,因此很难跟踪 EIP-1159引发的JSON RPC API变化。下面是我们找出的API变化清单。
EIP-1559引入了一种新的交易类型(0x02)并在区块头加入一个新的字段(baseFeePerGas)。 总体来说,任何返回交易或区块的RPC API都会在EIP-1159生效后受到影响。
下面的API调用受到EIP-1159的影响,标记*
的表明该API及其变化形式都受到影响:
eth_call
eth_call涉及到显著的修改,具体描述参见这里。
eth_getBlockBy*
在伦敦分叉后的区块中会增加一个新的字段 baseFeePerGas
。
eth_getRawTransaction*
在伦敦分叉后可能反馈RPL编码的EIP-1159交易。
eth_getTransactionBy*
gasPrice now interpreted as XXX (update after infra call)
EIP-1559交易将添加两个新的字段:maxPriorityFeePerGas
和 maxFeePerGas
。
eth_getTransactionReceipt
在交易收据中将添加一个新的字段 effectiveGasPrice
。在伦敦分叉前,该字段
的值与 gasPrice
相等;在伦敦分叉后,该字段的值等于实际的gas价格。计算过程
根据交易是否为EIP-1159交易而有所不同。
eth_getUncleBy*
在伦敦分叉后的区块中将增加一个新的字段 baseFeePerGas
。
eth_sendTransaction
支持EIP-1559交易字段 maxPriorityFeePerGas
和 maxFeePerGas
。节点软件需要计算这两个
字段的合理值,如果在输入数据中不包含的话。旧式交易依然还可以通过设置gasPrice
来发送。
eth_estimateGas
伦敦分叉后,需要指定 gasPrice
或 maxFeePerGas
和 maxPriorityFeePerGas
。在伦敦分叉前,
可以省略 gasPrice
,因为可以设置为0。但EIP-1559生效后,需要考虑baseFeePerGas
,手续费
必须要能够支付基准手续费。
eth_sendRawTransaction
这个API目前支持RLP编码的EIP-1159交易。
eth_feeHistory
这个API是EIP-1559引入的,它返回交易手续费的历史数据。关于此API的更多信息可以查看这里。
需要指出的是,GETH为了此API支持hex编码值与整数的转换,会引入不兼容的更新。具体参见这里。
原文链接:EIP-1559 JSON RPC Changes
汇智网翻译整理,转载请标明出处
Recommend
-
121
JSON-RPC一览
-
21
Filecoin RPC API中文文档【Lotus】 2020-12-13
-
10
JSON-RPC is a remote procedure call protocol encoded in JSO...
-
5
JSON-RPC2.0规范由JSON-RPC工作组([email protected])维护,发布于2010-03-26(基于2009-05-24的版本), 最近的更新于2013-01-04。 整体来说,2.0版本的JSON-RPC规...
-
7
json-rpc 1.0规范解读
-
3
¶ JSON RPC API JSON is a lightweight data-interchange format. It can represent numbers, strings, ordered sequences of values, and collections of...
-
25
Chia RPC API官方文档中文版由汇智网翻译整理, 访问地址:http://cw.hubwiz.com/card/c/chia-rpc/ 1、Chia RPC API 概述Chia节点内置JSON RPC API服务,开发人员可以用来获取区块链信息并加以控制。可...
-
5
以太坊的历史进程以太坊共有四个发展阶段,分别是前沿(Frontier)、家园(Homestead)、大都会(Metropolis)和宁静(Serenity)。其中宁静是以太坊的最终阶段,标志以太坊达到了 2.0 阶段。以太坊 2.0 与 1.0 版本有很大不同,包括共识机制从 PoW 转...
-
7
POJ 1159 - Palindrome | 眈眈探求 POJ 1159 - Palindrome Time: 3000MS Memory: 65536K 难度: 初级
-
1
使用golang进行rpc开发之二使用json进行开发 2022-09-29 Go...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK