diff --git a/external/silkworm b/external/silkworm index 67e0299..b9554f8 160000 --- a/external/silkworm +++ b/external/silkworm @@ -1 +1 @@ -Subproject commit 67e02993a67b2597375913e97b9d3a8da9473c1c +Subproject commit b9554f894184fa09408170bb9ee0ae3febb10ced diff --git a/src/block_conversion_plugin.cpp b/src/block_conversion_plugin.cpp index 64a13ad..e4d6d0d 100644 --- a/src/block_conversion_plugin.cpp +++ b/src/block_conversion_plugin.cpp @@ -280,7 +280,6 @@ class block_conversion_plugin_impl : std::enable_shared_from_thisnew_config.value()); auto consensus_param = eosevm::ConsensusParameters { - .min_gas_price = std::visit([](auto&& arg) -> auto& { return arg.minimum_gas_price; }, new_config), .gas_fee_parameters = eosevm::GasFeeParameters { .gas_txnewaccount = std::visit([](auto&& arg) -> auto& { return arg.gas_parameter.gas_txnewaccount; }, new_config), .gas_newaccount = std::visit([](auto&& arg) -> auto& { return arg.gas_parameter.gas_newaccount; }, new_config), diff --git a/src/block_conversion_plugin.hpp b/src/block_conversion_plugin.hpp index 3a18b74..0e6263c 100644 --- a/src/block_conversion_plugin.hpp +++ b/src/block_conversion_plugin.hpp @@ -29,11 +29,10 @@ struct gas_parameter_type { EOSIO_REFLECT(gas_parameter_type, gas_txnewaccount, gas_newaccount, gas_txcreate, gas_codedeposit, gas_sset) struct consensus_parameter_data_v0 { - uint64_t minimum_gas_price = 0; - gas_parameter_type gas_parameter; + gas_parameter_type gas_parameter; }; using consensus_parameter_data_type = std::variant; -EOSIO_REFLECT(consensus_parameter_data_v0, minimum_gas_price, gas_parameter) +EOSIO_REFLECT(consensus_parameter_data_v0, gas_parameter) class block_conversion_plugin : public appbase::plugin { public: diff --git a/tests/nodeos_eos_evm_gasparam_fork_test.py b/tests/nodeos_eos_evm_gasparam_fork_test.py index 7e1886d..fda9666 100755 --- a/tests/nodeos_eos_evm_gasparam_fork_test.py +++ b/tests/nodeos_eos_evm_gasparam_fork_test.py @@ -684,7 +684,7 @@ def makeReservedEvmAddress(account): # update gas parameter Utils.Print("Update gas parameter: ram price = 5 EOS per MB, gas price = 10Gwei") - trans = prodNode.pushMessage(evmAcc.name, "updtgasparam", json.dumps({"ram_price_mb":"5.0000 EOS","minimum_gas_price":10000000000}), '-p {0}'.format(evmAcc.name), silentErrors=False) + trans = prodNode.pushMessage(evmAcc.name, "updtgasparam", json.dumps({"ram_price_mb":"5.0000 EOS","gas_price":10000000000}), '-p {0}'.format(evmAcc.name), silentErrors=False) prodNode.waitForTransBlockIfNeeded(trans[1], True); time.sleep(2) @@ -714,7 +714,7 @@ def makeReservedEvmAddress(account): assert(row4["eth_address"] == "9e126c57330fa71556628e0aabd6b6b6783d99fa") assert(row4["balance"] == "0000000000000000000000000000000000000000000000024c923bc3177b4c00") # diff = 3,173,650,000,000,000 = 3,173,650 (Gwei) = (100,000 + (183910 + 21000) * 15) (Gwei) - # {"ram_price_mb":"5.0000 EOS","minimum_gas_price":10000000000} + # {"ram_price_mb":"5.0000 EOS","gas_price":10000000000} # {'consensusParameter': AttributeDict({'gasFeeParameters': AttributeDict({'gasCodedeposit': 530, 'gasNewaccount': 183910, 'gasSset': 186280, 'gasTxcreate': 321180, 'gasTxnewaccount': 183910} # Launch eos-evm-node @@ -753,7 +753,6 @@ def makeReservedEvmAddress(account): Utils.Print("before fork, the latest evm block is:" + str(evm_block)) assert(evm_block["nonce"].hex() == "0x0000000000000001") assert("consensusParameter" in evm_block) - assert(evm_block["consensusParameter"]["minGasPrice"] == 10000000000) assert(evm_block["consensusParameter"]["gasFeeParameters"]["gasCodedeposit"] == 530) assert(evm_block["consensusParameter"]["gasFeeParameters"]["gasNewaccount"] == 183910) assert(evm_block["consensusParameter"]["gasFeeParameters"]["gasSset"] == 186280) @@ -890,7 +889,7 @@ def makeReservedEvmAddress(account): # update gas parameter in minor fork (node0), but not node1 Utils.Print("Update gas parameter in minor fork: ram price = 6 EOS per MB, gas price = 10Gwei") - trans = prodNode.pushMessage(evmAcc.name, "updtgasparam", json.dumps({"ram_price_mb":"6.0000 EOS","minimum_gas_price":10000000000}), '-p {0}'.format(evmAcc.name), silentErrors=False) + trans = prodNode.pushMessage(evmAcc.name, "updtgasparam", json.dumps({"ram_price_mb":"6.0000 EOS","gas_price":10000000000}), '-p {0}'.format(evmAcc.name), silentErrors=False) prodNode.waitForTransBlockIfNeeded(trans[1], True); time.sleep(2) @@ -937,7 +936,6 @@ def makeReservedEvmAddress(account): Utils.Print("in minor fork, the latest evm block is:" + str(evm_block)) assert(evm_block["nonce"].hex() == "0x0000000000000001") assert("consensusParameter" in evm_block) - assert(evm_block["consensusParameter"]["minGasPrice"] == 10000000000) assert(evm_block["consensusParameter"]["gasFeeParameters"]["gasCodedeposit"] == 636) assert(evm_block["consensusParameter"]["gasFeeParameters"]["gasNewaccount"] == 220692) assert(evm_block["consensusParameter"]["gasFeeParameters"]["gasSset"] == 222956) @@ -1040,7 +1038,6 @@ def makeReservedEvmAddress(account): Utils.Print("after fork resolved, the latest evm block is:" + str(evm_block)) assert(evm_block["nonce"].hex() == "0x0000000000000001") assert("consensusParameter" in evm_block) - assert(evm_block["consensusParameter"]["minGasPrice"] == 10000000000) assert(evm_block["consensusParameter"]["gasFeeParameters"]["gasCodedeposit"] == 530) assert(evm_block["consensusParameter"]["gasFeeParameters"]["gasNewaccount"] == 183910) assert(evm_block["consensusParameter"]["gasFeeParameters"]["gasSset"] == 186280) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 325414d..67fb4ec 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -872,7 +872,7 @@ def get_block(num): # update gas parameter Utils.Print("Update gas parameter: ram price = 100 EOS per MB, gas price = 900Gwei") - trans = prodNode.pushMessage(evmAcc.name, "updtgasparam", json.dumps({"ram_price_mb":"100.0000 EOS","minimum_gas_price":900000000000}), '-p {0}'.format(evmAcc.name), silentErrors=False) + trans = prodNode.pushMessage(evmAcc.name, "updtgasparam", json.dumps({"ram_price_mb":"100.0000 EOS","gas_price":900000000000}), '-p {0}'.format(evmAcc.name), silentErrors=False) prodNode.waitForTransBlockIfNeeded(trans[1], True); time.sleep(2) @@ -882,10 +882,10 @@ def get_block(num): time.sleep(2) b = get_block("latest") - # 'consensusParameter': {'gasFeeParameters': {'gasCodedeposit': 118, 'gasNewaccount': 40946, 'gasSset': 43728, 'gasTxcreate': 71508, 'gasTxnewaccount': 40946}, 'minGasPrice': 900000000000} + Utils.Print("get_block_latest: " + json.dumps(b)) + # 'consensusParameter': {'gasFeeParameters': {'gasCodedeposit': 118, 'gasNewaccount': 40946, 'gasSset': 43728, 'gasTxcreate': 71508, 'gasTxnewaccount': 40946}} assert("consensusParameter" in b) - assert(b["consensusParameter"]["minGasPrice"] == 900000000000) assert(b["consensusParameter"]["gasFeeParameters"]["gasCodedeposit"] == 118) assert(b["consensusParameter"]["gasFeeParameters"]["gasNewaccount"] == 40946) assert(b["consensusParameter"]["gasFeeParameters"]["gasSset"] == 43728)