【已解决】SendTransactionVM Exception while processing transaction: Transaction‘s maxFeePerGas (200000000

简介: 【已解决】SendTransactionVM Exception while processing transaction: Transaction‘s maxFeePerGas (200000000

说明

GoLang 调用 Uniswap 合约。

通过 ganache-cli --fork 启动。

异常信息

TX data nonce  0  transfer value  0  gasLimit  795605  gasPrice  2000000000  chainID  1337
2023/07/20 11:35:29 SendTransactionVM Exception while processing transaction: Transaction's maxFeePerGas (2000000000) is less than the block's baseFeePerGas (12904947910) (vm hf=shanghai -> block -> tx)

完整信息:

Connect url  http://127.0.0.1:8545  current number  17731725  address  0x62C1692E74C9ba729c3d06cDB0810cE29202D0bc
Your wallet valid balance is  1000 'eth
INFO [07-20|11:35:27.281] Persisted trie from memory database      nodes=3 size=405.00B time="11.542µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [07-20|11:35:27.282] Loaded most recent local header          number=0 hash="4526c3…f4d1c8" td=0 age=54y3mo4w
INFO [07-20|11:35:27.283] Loaded most recent local full block      number=0 hash="4526c3…f4d1c8" td=0 age=54y3mo4w
INFO [07-20|11:35:27.283] Loaded most recent local fast block      number=0 hash="4526c3…f4d1c8" td=0 age=54y3mo4w
WARN [07-20|11:35:27.283] Failed to load snapshot, regenerating    err="missing or corrupted snapshot"
INFO [07-20|11:35:27.283] Rebuilding state snapshot
INFO [07-20|11:35:27.283] Deleted state snapshot leftovers         kind=accounts wiped=0 elapsed="3.125µs"
INFO [07-20|11:35:27.283] Deleted state snapshot leftovers         kind=storage  wiped=0 elapsed="1.125µs"
INFO [07-20|11:35:27.283] Compacting snapshot account area
INFO [07-20|11:35:27.283] Compacting snapshot storage area
INFO [07-20|11:35:27.283] Compacted snapshot area in database      elapsed="6.417µs"
INFO [07-20|11:35:27.283] Wiper running, state snapshotting paused accounts=0 slots=0 storage=0.00B elapsed="25µs"
INFO [07-20|11:35:27.283] Resuming state snapshot generation       accounts=0 slots=0 storage=0.00B elapsed="3.917µs"
INFO [07-20|11:35:27.283] Generated state snapshot                 accounts=2 slots=0 storage=90.00B elapsed="40.334µs"
INFO [07-20|11:35:27.290] Imported new chain segment               blocks=1 txs=3 mgas=5.066 elapsed="880.417µs" mgasps=5753.940 number=1 hash="7d5f74…3da596" age=54y3mo4w dirty=25.13KiB
TX data nonce  0  transfer value  0  gasLimit  795605  gasPrice  2000000000  chainID  1337
2023/07/20 11:35:29 SendTransactionVM Exception while processing transaction: Transaction's maxFeePerGas (2000000000) is less than the block's baseFeePerGas (12904947910) (vm hf=shanghai -> block -> tx)
FAIL    ethereum/contract/contracts/deployUniswap       2.767s

原因

maxFeePerGas 太小,很明显。

默认是 :

Default Gas Price
==================
2000000000

解决办法

启动里加参数

参数说明


启动选项
下面可能有的横杠是两道。

-a 或 –accounts: 指定启动时要创建的测试账户数量。
-e 或 –defaultBalanceEther: 分配给每个测试账户的ether数量,默认值为100。
-b 或r –blockTime: 指定自动挖矿的blockTime,以秒为单位。默认值为0,表示不进行自动挖矿。
-d 或 –deterministic: 基于预定的助记词(mnemonic)生成固定的测试账户地址。
-n 或 –secure: 默认锁定所有测试账户,有利于进行第三方交易签名。
-m 或 –mnemonic: 用于生成测试账户地址的助记词。
-p 或 –port: 设置监听端口,默认值为8545。
-h 或 –hostname: 设置监听主机,默认值同NodeJS的server.listen()。
-s 或 –seed: 设置生成助记词的种子。.
-g 或 –gasPrice: 设定Gas价格,默认值为20000000000。
-l 或 –gasLimit: 设定Gas上限,默认值为90000。
-f 或 –fork: 从一个运行中的以太坊节点客户端软件的指定区块分叉。输入值应当是该节点旳HTTP地址和端口,例如http://localhost:8545。可选使用@标记来指定具体区块,例如:http://localhost:8545@1599200。
-i 或–networkId:指定网络id。默认值为当前时间,或使用所分叉链的网络id`。
–db: 设置保存链数据的目录。如果该路径中已经有链数据,ganache-cli`将用它初始化链而不是重新创建。
`–debug:输出VM操作码,用于调试。
–mem:输出ganache-cli`内存使用统计信息,这将替代标准的输出信息。
–noVMErrorsOnRPCResponse:不把失败的交易作为RPC错误发送。开启这个标志使错误报告方式兼容其他的节点客户端,例如geth和Parity。

特殊选项

–account: 指定账户私钥和账户余额来创建初始测试账户。可多次设置:

$ ganache-cli --account="<privatekey>,balance" [--account="<privatekey>,balance"]

参考:

https://benpaodewoniu.github.io/2022/03/20/ganache0/

目录
相关文章
|
数据库管理 Ruby
Transaction recovery: lock conflict caught and ignored
Transaction recovery: lock conflict caught and ignored环境:RAC 4节点、oracle 11.2.0.4、redhat 5.9 64bit 问题描述: 1.
1850 0
|
2月前
transaction 2 failed while formatting outputs from RPC
transaction 2 failed while formatting outputs from RPC
18 0
|
5月前
|
算法 关系型数据库 MySQL
transaction
【7月更文挑战第21天】
67 7
|
5月前
|
关系型数据库 MySQL Java
异常:no transaction is in progress
异常:no transaction is in progress
163 0
|
6月前
|
JSON 数据格式
【ERROR】Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)
【ERROR】Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)
51 0
The transaction associated with this command is not the connection‘s active
The transaction associated with this command is not the connection‘s active
222 0
|
7月前
|
安全
Error:Execution failed for task ':transformClassesAndResourcesWithProguardForRelease'
Error:Execution failed for task ':transformClassesAndResourcesWithProguardForRelease'
62 0
|
Java 关系型数据库 MySQL
定时任务Quzrtz:Failed to override connection auto commit/transaction isolation
定时任务Quzrtz:Failed to override connection auto commit/transaction isolation
147 0
|
SQL 关系型数据库 MySQL
Deadlock found when trying to get lock; try restarting transaction
Deadlock found when trying to get lock; try restarting transaction
331 1
|
XML Java 数据格式
Exception encountered during context initialization - cancelling refresh attempt
Exception encountered during context initialization - cancelling refresh attempt:
343 0