fix(rpc): make eth_maxPriorityFeePerGas return tx_gas_price instead of a constant 0 (#5653)
Problem
eth_maxPriorityFeePerGasis hard-coded to0x0(EthEndpoint::maxPriorityFeePerGas), and every block reportsbaseFeePerGas = 0x0(BlockResponse.cpp). A client that prices an EIP-1559 transaction the standard way, `maxFeePerGas = 2 * baseFeePerGas
- maxPriorityFeePerGas
, therefore computesmaxFeePerGas = 0.TxValidator(FIB-75) then rejects the transaction becauseeffectiveGasPrice(tx) < tx_gas_price, and reports it asInsufficientFunds` — which sends the user hunting for balance they already have.Reproduced on the POTOS testnet (v3.17.1,
tx_gas_price = 0x5208) from the same account and nonce:eth_gasPrice -> 0x5208 (21000 wei) eth_maxPriorityFeePerGas -> 0x0 latest.baseFeePerGas -> 0x0 type-2 tx, maxFeePerGas=1 -> {"code":-32603,"message":"InsufficientFunds"} type-2 tx, maxFeePerGas=42000 -> accepted, 0x5d8047e8…e4a172web3j
DynamicEIP1559GasProvider, ethersgetFeeData()and viemestimateFeesPerGas()all use that formula, so any EIP-1559 sender that trusts the node’s own fee hints is rejected. Only clients that ignore the 1559 hints and takeeth_gasPriceget through.Fix
Since the base fee is always reported as 0, the whole system gas price is the tip.
eth_maxPriorityFeePerGasnow returns thetx_gas_pricesystem config, the same valueeth_gasPricereturns, so2 * 0 + tiplands exactly on the admission floor. The two endpoints share a new private helpersystemGasPriceQuantity();eth_gasPricebehaviour is unchanged.The value charged at execution is
tx_gas_priceregardless ofmaxFeePerGas(BlockExecutive::setEffectiveGasPrice), so a higher hint costs the sender nothing extra.Tests
- New
Web3MaxPriorityFeeTest: withtx_gas_price = 0x5208, both endpoints return 21000 and the client formula reaches the floor; the tip follows a config change and drops to 0 whentx_gas_price = 0x0.Web3NodeStatusTest::maxPriorityFeePerGasIsConstantrenamed tomaxPriorityFeePerGasResponds; its assertion (a result or an error is present) still holds.Local run:
test-bcos-rpcfull suite, see below.
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
中文 / English
FISCO BCOS(读作/ˈfɪskl bi:ˈkɒz/)是金融区块链合作联盟(深圳)(简称”金链盟”)开源工作组于2017年推出的国产安全可控区块链底层开源平台,致力于为数字经济时代提供可信基础设施,释放数据要素价值,助力产业数字化及Web3.0经济发展。至今已在金融、政务、公益等领域落地标杆应用超600个,如区块链服务网络BSN、珠三角征信链、粤澳/深港/深圳-新加坡跨境数据验证平台、中国银联区块链可信存证服务等。
核心特性:
版本信息
系统概述
FISCO BCOS系统架构包括基础层、核心层、服务层、用户层和接入层提供稳定、安全的区块链底层服务。中间件层通过可视化界面,简化了用户管理区块链系统的流程。右侧配套相关开发、运维、安全控制的组件,辅助应用落地过程中不同角色的需要;同时,提供隐私保护和跨链相关的技术组件,满足不同场景的应用诉求。
关键特性
组件服务
开发运维工具
技术文档
《FISCO BCOS官方技术文档》提供建链开发指引、工具介绍以及设计原理解析,用户可通过阅读官方技术文档快速了解、使用FISCO BCOS。
若需查阅FISCO BCOS 2.x版本相关信息,可参考 《FISCO BCOS 2.x 技术文档》
落地应用案例
FISCO BCOS已在金融、政务、公益等领域落地标杆应用超600个,有效助力产业数字化发展和数据可信流通。典型应用包括:
更多案例可参考《2025飞梭链(FISCO BCOS)产业应用发展报告》。
加入我们的社区
截至2025年底,FISCO BCOS开源社区已汇聚超5000家企业及机构、10万余名个人成员共建共治,发展为中国最具活力的区块链技术开源社区之一。
社区荣誉:
欢迎对FISCO BCOS开源技术及应用感兴趣的开发者加入社区,获取更多支持与帮助。
贡献代码
我们欢迎并非常感谢您的贡献,请参阅代码贡献流程。
如项目对您有帮助,欢迎star支持!
License
FISCO BCOS的开源协议为Apache License 2.0, 详情参见LICENSE。