From e08bb0e1bc7090e61e6f865d29eb1613b3a57822 Mon Sep 17 00:00:00 2001 From: kayan Date: Fri, 5 Jul 2024 07:58:09 +0800 Subject: [PATCH 1/3] dynamic chainid --- silkworm | 2 +- src/CMakeLists.txt | 2 +- src/actions.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/silkworm b/silkworm index 76163e9c..5e3b0654 160000 --- a/silkworm +++ b/silkworm @@ -1 +1 @@ -Subproject commit 76163e9c9aedc7991307f21eaa14a861964446b4 +Subproject commit 5e3b0654545be2c934eb79c03a0c0ba72a99d7e4 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 07090f2e..0a00c1a0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -92,5 +92,5 @@ target_compile_options(evm_runtime PUBLIC --no-missing-ricardian-clause) if (WITH_LARGE_STACK) target_link_options(evm_runtime PUBLIC --stack-size=50000000) else() - target_link_options(evm_runtime PUBLIC --stack-size=34720) + target_link_options(evm_runtime PUBLIC --stack-size=37328) endif() diff --git a/src/actions.cpp b/src/actions.cpp index e552f735..a2997856 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -339,7 +339,7 @@ void evm_contract::exec(const exec_input& input, const std::optional> found_chain_config = lookup_known_chain(_config->get_chainid()); - check( found_chain_config.has_value(), "failed to find expected chain config" ); + check( found_chain_config.has_value(), "unknown chainid" ); eosevm::block_mapping bm(_config->get_genesis_time().sec_since_epoch()); @@ -465,7 +465,7 @@ void evm_contract::process_tx(const runtime_config& rc, eosio::name miner, const } std::optional> found_chain_config = lookup_known_chain(_config->get_chainid()); - check( found_chain_config.has_value(), "failed to find expected chain config" ); + check( found_chain_config.has_value(), "unknown chainid" ); eosevm::block_mapping bm(_config->get_genesis_time().sec_since_epoch()); From 8fdf3f2b68ee9639b05ca07e76f802ca6fb52b47 Mon Sep 17 00:00:00 2001 From: kayan Date: Fri, 5 Jul 2024 20:11:38 +0800 Subject: [PATCH 2/3] dynamic chain-id --- silkworm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silkworm b/silkworm index 5e3b0654..c4da9c73 160000 --- a/silkworm +++ b/silkworm @@ -1 +1 @@ -Subproject commit 5e3b0654545be2c934eb79c03a0c0ba72a99d7e4 +Subproject commit c4da9c735207b8d2a2a018ebfc6bb9f3bfd3add4 From 94464ec567304bd0b083f8a9f400e519713e9094 Mon Sep 17 00:00:00 2001 From: kayan Date: Sat, 6 Jul 2024 08:34:47 +0800 Subject: [PATCH 3/3] fix chain id in test --- tests/init_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/init_tests.cpp b/tests/init_tests.cpp index 04415aa8..55736d39 100644 --- a/tests/init_tests.cpp +++ b/tests/init_tests.cpp @@ -64,7 +64,7 @@ BOOST_FIXTURE_TEST_CASE(check_init, basic_evm_tester) try { eosio_assert_message_exception, [](const eosio_assert_message_exception& e) {return testing::expect_assert_message(e, "assertion failure with message: contract not initialized");}); - BOOST_REQUIRE_EXCEPTION(init(42), + BOOST_REQUIRE_EXCEPTION(init(0), eosio_assert_message_exception, [](const eosio_assert_message_exception& e) {return testing::expect_assert_message(e, "assertion failure with message: unknown chainid");}); init(15555);