Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure in EOS EVM node #362

Open
taokayan opened this issue Feb 18, 2025 · 0 comments · May be fixed by #363
Open

Assertion failure in EOS EVM node #362

taokayan opened this issue Feb 18, 2025 · 0 comments · May be fixed by #363
Assignees
Labels
bug Something isn't working 👍 lgtm

Comments

@taokayan
Copy link
Contributor

taokayan commented Feb 18, 2025

related to #247
depends on #360

version used:
eos-evm-node: f1d34c1
evm contract: 4b3ea85eac4a41d3c7d3195b1d19ab73027adc12

eos-evm-node assertion factor_den > 0 failed if the first evm transaction (after transit to v3) is a direct eosio.evm::pushtx action with max priority fee set to 0, and it also failed to get the gas_prices.

cleos:
act_data is {'miner': 'evmtxwrapper', 'rlptx': '02f8b0823cc503808545d964b8008405f5e1009433b57dc70014fd7aa6e1ed3080eed2b619632b8e80b844a9059cbb0000000000000000000000002787b98fc4e731d0456b3941f0b3fe2e014399620000000000000000000000000000000000000000000000000000000000002710c080a07ae9469ec93547b6e351e0ff24c6aa3857e77c75f6551d8b7667bffbf26a23d7a072db0d00e4a6d3d50d6639d341deb6d44ffd4de6ec291f118453e1df2455e350'}
executed transaction: 11a035dfb8067479177fd38331bf3217ae1d41040673176b961804103f50e0e1  288 bytes  1865 us
#     eosio.evm <= eosio.evm::pushtx            {"miner":"evmtxwrapper","rlptx":"02f8b0823cc503808545d964b8008405f5e1009433b57dc70014fd7aa6e1ed3080e...
#     eosio.evm <= eosio.evm::configchange      {"consensus_parameter_data":["consensus_parameter_data_v0",{"gas_parameter":{"gas_txnewaccount":4066...
#     eosio.evm <= eosio.evm::evmtx             {"event":["evmtx_v3",{"eos_evm_version":3,"rlptx":"02f8b0823cc503808545d964b8008405f5e1009433b57dc70...

eos-evm-node:
  INFO [02-13|07:34:26.745 UTC] ExecutionEngine                    verifying chain 419bc7e7fb7bcfdb648d6196d4b29602db7d2e8dfa1aa44f7f3363ebc67b4c68
  INFO [02-13|07:34:26.745 UTC] ExecPipeline                       Forward start --------------------------
  INFO [02-13|07:34:26.745 UTC] [1/11 Headers]                     Updating headers from=210
  INFO [02-13|07:34:26.745 UTC] [1/11 Headers]                     Updating completed, wrote 1 headers, last=211
  INFO [02-13|07:34:26.750 UTC] [4/11 Senders]                     op=parallel_recover num_threads=16 max_batch_size=199728 
  INFO [02-13|07:34:26.786 UTC] [4/11 Senders]                     op=Forward done=36.850ms 
/home/kayan-u20/workspaces/eos-evm-node/external/silkworm/silkworm/core/execution/processor.cpp: gas_prices:0,0
Assert failed: factor_den > 0 Source: /home/kayan-u20/workspaces/eos-evm-node/external/silkworm/silkworm/core/execution/processor.cpp, line 86./kayan_start_evm_node.sh: line 5: 902289 Aborted                 (core dumped) ./eos-evm-node-new --ship-core-account=eosio.evm --chain-data ./chain-data --plugin block_conversion_plugin --plugin blockchain_plugin --nocolor 1 --verbosity=5 --genesis-json=./genesis.json $@

possible fix of bug3:
re-order the get prices and evm_version promotion check:

diff --git a/src/block_conversion_plugin.cpp b/src/block_conversion_plugin.cpp
index 75dc78a..84536b6 100644
--- a/src/block_conversion_plugin.cpp
+++ b/src/block_conversion_plugin.cpp
@@ -314,7 +314,9 @@ class block_conversion_plugin_impl : std::enable_shared_from_this<block_conversi
                      auto dtx = deserialize_tx(act);
                      auto& rlpx_ref = std::visit([](auto&& arg) -> auto& { return arg.rlpx; }, dtx);
 
-                     if(block_version >= 3) {
+                     auto tx_version = std::visit([](auto&& arg) -> auto { return arg.eos_evm_version; }, dtx);
+                     
+                     if(block_version >= 3 || tx_version >= 3) {
                         SILKWORM_ASSERT(std::holds_alternative<evmtx_v3>(dtx));
                         const auto& dtx_v3 = std::get<evmtx_v3>(dtx);
                         auto tx_gas_prices = eosevm::gas_prices{
@@ -349,7 +351,6 @@ class block_conversion_plugin_impl : std::enable_shared_from_this<block_conversi
                         SILK_CRIT << "Failed to decode transaction in block: " << curr.header.number;
                         throw std::runtime_error("Failed to decode transaction");
                      }
-                     auto tx_version = std::visit([](auto&& arg) -> auto { return arg.eos_evm_version; }, dtx);
 
                      if(tx_version < block_version) {
                         SILK_CRIT << "tx_version < block_version";
@github-project-automation github-project-automation bot moved this to Todo in EOS EVM Feb 18, 2025
@taokayan taokayan added the bug Something isn't working label Feb 18, 2025
@stephenpdeos stephenpdeos changed the title gas v3 bugs gas v3 bugs #3 Feb 19, 2025
@stephenpdeos stephenpdeos changed the title gas v3 bugs #3 Assertion failure in EOS EVM node Feb 19, 2025
@stephenpdeos stephenpdeos moved this from Todo to In Progress in EOS EVM Feb 21, 2025
This was referenced Feb 21, 2025
@taokayan taokayan linked a pull request Feb 21, 2025 that will close this issue
@arhag arhag added this to the EOS EVM Node v2.0.0-rc1 milestone Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 👍 lgtm
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants