From 949fc273e46c3ea926b1ecc9951696041beb7d9a Mon Sep 17 00:00:00 2001 From: kladkogex <13399135+kladkogex@users.noreply.github.com> Date: Tue, 29 Aug 2023 11:34:06 +0100 Subject: [PATCH 01/15] 1560 slow catchup --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index a80663fa8..047362b1f 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit a80663fa8f6fe0696c24c0b1f20a36486f59bd9a +Subproject commit 047362b1f466b65e9838c3f0f461659bb2c28d85 From 2475147f706c288949148dc88bf5dac43278675e Mon Sep 17 00:00:00 2001 From: kladkogex <13399135+kladkogex@users.noreply.github.com> Date: Tue, 29 Aug 2023 11:42:10 +0100 Subject: [PATCH 02/15] 1560 --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index 047362b1f..af6fc3fb9 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit 047362b1f466b65e9838c3f0f461659bb2c28d85 +Subproject commit af6fc3fb99c4d2b166b6eabb0eb3950bbe69951e From c1efbfb95901fd190c4aed9331a143bcbba940e6 Mon Sep 17 00:00:00 2001 From: kladkogex <13399135+kladkogex@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:34:45 +0100 Subject: [PATCH 03/15] SKALE 1560 slow catchup --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index af6fc3fb9..5a9b85d8f 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit af6fc3fb99c4d2b166b6eabb0eb3950bbe69951e +Subproject commit 5a9b85d8f171e1ba5f7dfe244cff70e0e39aa5f4 From 2d3a7eb9ff81b2b92813606198baf0a021d0a213 Mon Sep 17 00:00:00 2001 From: Dima Litvinov Date: Mon, 4 Sep 2023 15:53:52 +0100 Subject: [PATCH 04/15] IS-256 HACK do_register() in stats::element only in stop(), to avoid race condition with queue --- libskutils/include/skutils/stats.h | 2 +- libskutils/src/stats.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libskutils/include/skutils/stats.h b/libskutils/include/skutils/stats.h index 79650c733..3600d637b 100644 --- a/libskutils/include/skutils/stats.h +++ b/libskutils/include/skutils/stats.h @@ -220,7 +220,7 @@ class element : public skutils::ref_retain_release { element( const char* strSubSystem, const char* strProtocol, const char* strMethod, int /*nServerIndex*/, int /*ipVer*/ ); virtual ~element(); - void stop() const; + void stop(); void setMethod( const char* strMethod ) const; void setError() const; double getDurationInSeconds() const; diff --git a/libskutils/src/stats.cpp b/libskutils/src/stats.cpp index 2d0814992..d77dcbd20 100644 --- a/libskutils/src/stats.cpp +++ b/libskutils/src/stats.cpp @@ -405,7 +405,6 @@ element::element( const char* strSubSystem, const char* strProtocol, const char* strProtocol_ = "N/A"; if ( strMethod_.empty() ) strMethod_ = g_strMethodNameUnknown; - do_register(); } element::~element() { stop(); @@ -420,12 +419,13 @@ void element::do_unregister() { queue::getQueueForSubsystem( strSubSystem_.c_str() ).do_unregister( rttElement ); } -void element::stop() const { +void element::stop() { lock_type lock( mtx() ); if ( isStopped_ ) return; isStopped_ = true; tpEnd_ = skutils::stats::clock::now(); + do_register(); } void element::setMethod( const char* strMethod ) const { From 82659feed22da370ba0c3cfc74f584ff62bae54c Mon Sep 17 00:00:00 2001 From: Dima Litvinov Date: Tue, 5 Sep 2023 15:24:07 +0100 Subject: [PATCH 05/15] Don't use setup-docker in functional-tests --- .github/workflows/functional-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 104e86442..489c82421 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -37,8 +37,6 @@ sudo npm install -g yarn sudo chown -R runner:runner ~/.config # HACK - - uses: docker-practice/actions-setup-docker@v1 - - name: Prepare SGX keys/certs run: | echo "${{ secrets.sgx_key }}" > sgx_certs/sgx.key From d8ada22704f098f58b2784779e91011d0bd8c47f Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Thu, 7 Sep 2023 12:33:05 +0100 Subject: [PATCH 06/15] 1637 use 21k for gasEstimateStep if gas used is less --- libethereum/ClientBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethereum/ClientBase.cpp b/libethereum/ClientBase.cpp index a20c2f9b3..6d646f45a 100644 --- a/libethereum/ClientBase.cpp +++ b/libethereum/ClientBase.cpp @@ -132,7 +132,7 @@ std::pair< u256, ExecutionResult > ClientBase::estimateGas( Address const& _from estimateGasStep( upperBound, bk, _from, _dest, _value, gasPrice, _data ); if ( estimatedStep.first ) { auto executionResult = estimatedStep.second; - auto gasUsed = executionResult.gasUsed.convert_to< int64_t >(); + auto gasUsed = std::max( executionResult.gasUsed.convert_to< int64_t >(), lowerBound ); estimatedStep = estimateGasStep( gasUsed, bk, _from, _dest, _value, gasPrice, _data ); if ( estimatedStep.first ) { From a832517ac6ebe1f8abf91313504f93aa0ac73de6 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Thu, 7 Sep 2023 13:18:10 +0100 Subject: [PATCH 07/15] 1638 fix cmake build and disable tests id deps --- deps/build.sh | 16 ++++++++-------- skaled/CMakeLists.txt | 2 +- storage_benchmark/CMakeLists.txt | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deps/build.sh b/deps/build.sh index 741df09f8..d7b4b3766 100755 --- a/deps/build.sh +++ b/deps/build.sh @@ -703,7 +703,7 @@ if [ "$WITH_UNWIND" = "yes" ]; #eval autoheader #eval automake --add-missing eval autoreconf -i - eval ./configure --disable-shared --prefix="$INSTALL_ROOT" + eval ./configure --disable-shared --disable-tests --prefix="$INSTALL_ROOT" cd .. fi echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}" @@ -1113,7 +1113,7 @@ then # .. #cd ../.. eval ./autogen.sh - eval ./configure "${CONF_CROSSCOMPILING_OPTS_GENERIC}" --enable-static --disable-shared --prefix="$INSTALL_ROOT" "${CONF_DEBUG_OPTIONS}" + eval ./configure "${CONF_CROSSCOMPILING_OPTS_GENERIC}" --enable-static --disable-shared --disable-samples --prefix="$INSTALL_ROOT" "${CONF_DEBUG_OPTIONS}" cd .. fi #cd libevent/build @@ -1142,7 +1142,7 @@ then if [ ! -f "libuv-from-git.tar.gz" ]; then echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" - eval git clone https://github.com/libuv/libuv.git + eval git clone https://github.com/libuv/libuv.git cd libuv eval git checkout v1.x eval git pull @@ -1191,11 +1191,11 @@ then if [ ! -f "libwebsockets-from-git.tar.gz" ]; then echo -e "${COLOR_INFO}downloading it${COLOR_DOTS}...${COLOR_RESET}" - eval git clone https://github.com/warmcat/libwebsockets.git + eval git clone https://github.com/warmcat/libwebsockets.git eval cd libwebsockets - # eval git checkout v4.1-stable - eval git checkout v4.3-stable - eval git pull + # eval git checkout v4.1-stable + eval git checkout v4.3-stable + eval git pull cd .. echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" eval tar -czf libwebsockets-from-git.tar.gz ./libwebsockets @@ -1391,7 +1391,7 @@ then eval "$WGET" https://boostorg.jfrog.io/artifactory/main/release/1.68.0/source/boost_1_68_0.tar.bz2 fi echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}" - eval tar -xf boost_1_68_0.tar.bz2 + eval tar -xf boost_1_68_0.tar.bz2 fi cd boost_1_68_0 echo -e "${COLOR_INFO}configuring and building it${COLOR_DOTS}...${COLOR_RESET}" diff --git a/skaled/CMakeLists.txt b/skaled/CMakeLists.txt index 11209cad8..593119d59 100644 --- a/skaled/CMakeLists.txt +++ b/skaled/CMakeLists.txt @@ -25,8 +25,8 @@ target_link_libraries( devcore Boost::program_options skutils - "${DEPS_INSTALL_ROOT}/lib/liblzma.a" "${DEPS_INSTALL_ROOT}/lib/libunwind.a" + "${DEPS_INSTALL_ROOT}/lib/liblzma.a" pthread idn2 batched-io diff --git a/storage_benchmark/CMakeLists.txt b/storage_benchmark/CMakeLists.txt index 1684ebe56..8180d42dc 100644 --- a/storage_benchmark/CMakeLists.txt +++ b/storage_benchmark/CMakeLists.txt @@ -20,8 +20,8 @@ target_link_libraries( historic skutils devcore - "${DEPS_INSTALL_ROOT}/lib/liblzma.a" "${DEPS_INSTALL_ROOT}/lib/libunwind.a" + "${DEPS_INSTALL_ROOT}/lib/liblzma.a" ) #target_include_directories(evm_benchmark PRIVATE ../utils) From 794dd781ad8223b3dd2cf5351045865df917b755 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Thu, 7 Sep 2023 15:29:00 +0100 Subject: [PATCH 08/15] remove tests from deps --- deps/build.sh | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/deps/build.sh b/deps/build.sh index d7b4b3766..f8a184049 100755 --- a/deps/build.sh +++ b/deps/build.sh @@ -1996,10 +1996,10 @@ then then echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" eval git clone https://github.com/google/glog.git --recursive - cd glog - eval git checkout ee6faf13b20de9536f456bd84584f4ab4db1ceb4 - cd .. - echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" + cd glog + eval git checkout ee6faf13b20de9536f456bd84584f4ab4db1ceb4 + cd .. + echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" eval tar -czf glog-from-git.tar.gz ./glog else echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}" @@ -2010,7 +2010,7 @@ then eval mkdir -p build cd build eval "$CMAKE" "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" \ - -DBUILD_SHARED_LIBS=OFF -DWITH_UNWIND=OFF \ + -DBUILD_SHARED_LIBS=OFF -DWITH_UNWIND=OFF -DWITH_GTEST=OFF \ .. cd .. else @@ -2077,11 +2077,11 @@ then then echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" eval git clone https://github.com/facebook/folly.git --recursive - cd folly - eval git checkout 5c8fc1b622422a1c73f46d6fb51ac1164d8efb0f - cd .. - echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" - eval tar -czf folly-from-git.tar.gz ./folly + cd folly + eval git checkout 5c8fc1b622422a1c73f46d6fb51ac1164d8efb0f + cd .. + echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" + eval tar -czf folly-from-git.tar.gz ./folly else echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}" eval tar -xzf folly-from-git.tar.gz @@ -2165,10 +2165,10 @@ then then echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" eval git clone https://github.com/google/googletest.git --recursive - cd googletest - eval git checkout 4c5650f68866e3c2e60361d5c4c95c6f335fb64b - cd .. - echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" + cd googletest + eval git checkout 4c5650f68866e3c2e60361d5c4c95c6f335fb64b + cd .. + echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" eval tar -czf gtest-from-git.tar.gz ./googletest else echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}" @@ -2208,10 +2208,10 @@ then then echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" eval git clone https://github.com/facebookincubator/fizz.git --recursive - cd fizz - eval git checkout 93003f4161f7cebe1c121b3232215db8314c2ce7 - cd .. - echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" + cd fizz + eval git checkout 93003f4161f7cebe1c121b3232215db8314c2ce7 + cd .. + echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" eval tar -czf fizz-from-git.tar.gz ./fizz else echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}" @@ -2253,10 +2253,10 @@ then then echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" eval git clone https://github.com/facebook/wangle.git --recursive - cd wangle - eval git checkout 7249d3f8d18bcd4bc13649d13654ccb2a771f7b3 - cd .. - echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" + cd wangle + eval git checkout 7249d3f8d18bcd4bc13649d13654ccb2a771f7b3 + cd .. + echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" eval tar -czf wangle-from-git.tar.gz ./wangle else echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}" From d01b21bf79e4130cb2383b9f8ed15bc1be091171 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Thu, 7 Sep 2023 19:36:33 +0100 Subject: [PATCH 09/15] 1637 add unittest --- test/unittests/libweb3jsonrpc/jsonrpc.cpp | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/test/unittests/libweb3jsonrpc/jsonrpc.cpp b/test/unittests/libweb3jsonrpc/jsonrpc.cpp index aaee07279..1ff35dc63 100644 --- a/test/unittests/libweb3jsonrpc/jsonrpc.cpp +++ b/test/unittests/libweb3jsonrpc/jsonrpc.cpp @@ -1804,6 +1804,64 @@ contract Logger{ BOOST_REQUIRE_EQUAL(logs.size(), 24); } +BOOST_AUTO_TEST_CASE( estimate_gas_low_gas_txn ) { + JsonRpcFixture fixture; + dev::eth::simulateMining( *( fixture.client ), 10 ); + + auto senderAddress = fixture.coinbase.address(); + +/* +// SPDX-License-Identifier: None +pragma solidity ^0.6.0; + +contract TestEstimateGas { + uint256[256] number; + uint256 counter = 0; + + function store(uint256 x) public { + number[counter] = x; + counter += 1; + } + + function clear(uint256 pos) public { + number[pos] = 0; + } +} +*/ + + string bytecode = "608060405260006101005534801561001657600080fd5b50610104806100266000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80636057361d146037578063c0fe1af8146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050608d565b005b608b60048036036020811015607657600080fd5b810190808035906020019092919050505060b8565b005b806000610100546101008110609e57fe5b018190555060016101006000828254019250508190555050565b60008082610100811060c657fe5b01819055505056fea26469706673582212206c8da972693a5b8c9bf59c197c4a0c554e9f51abd20047572c9c19125b533d2964736f6c634300060c0033"; + + Json::Value create; + create["code"] = bytecode; + create["gas"] = "180000"; // TODO or change global default of 90000? + + string deployHash = fixture.rpcClient->eth_sendTransaction( create ); + dev::eth::mineTransaction( *( fixture.client ), 1 ); + + Json::Value deployReceipt = fixture.rpcClient->eth_getTransactionReceipt( deployHash ); + string contractAddress = deployReceipt["contractAddress"].asString(); + + Json::Value txStore1; // call store(1) + txStore1["to"] = contractAddress; + txStore1["data"] = "0x6057361d0000000000000000000000000000000000000000000000000000000000000001"; + txStore1["from"] = toJS( senderAddress ); + txStore1["gasPrice"] = fixture.rpcClient->eth_gasPrice(); + string txHash = fixture.rpcClient->eth_call( txStore1, "latest" ); + + Json::Value estimateGasCall; // call clear(0) + estimateGasCall["to"] = contractAddress; + estimateGasCall["data"] = "0xc0fe1af80000000000000000000000000000000000000000000000000000000000000000"; + estimateGasCall["from"] = toJS( senderAddress ); + estimateGasCall["gasPrice"] = fixture.rpcClient->eth_gasPrice(); + string estimatedGas = fixture.rpcClient->eth_estimateGas( estimateGasCall ); + + dev::bytes data = dev::jsToBytes( estimateGasCall["data"].asString() ); + + BOOST_REQUIRE( dev::jsToU256( estimatedGas ) > dev::eth::TransactionBase::baseGasRequired( + false, &data, fixture.client->chainParams().scheduleForBlockNumber( + fixture.client->number() ) ) ); +} + BOOST_AUTO_TEST_CASE( storage_limit_contract ) { JsonRpcFixture fixture; dev::eth::simulateMining( *( fixture.client ), 10 ); From b232296706dc7c8533734902b06fc2dfa5f07808 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Thu, 7 Sep 2023 20:02:43 +0100 Subject: [PATCH 10/15] 1637 add unittest --- test/unittests/libweb3jsonrpc/jsonrpc.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unittests/libweb3jsonrpc/jsonrpc.cpp b/test/unittests/libweb3jsonrpc/jsonrpc.cpp index 1ff35dc63..fd7df6a06 100644 --- a/test/unittests/libweb3jsonrpc/jsonrpc.cpp +++ b/test/unittests/libweb3jsonrpc/jsonrpc.cpp @@ -1860,6 +1860,7 @@ contract TestEstimateGas { BOOST_REQUIRE( dev::jsToU256( estimatedGas ) > dev::eth::TransactionBase::baseGasRequired( false, &data, fixture.client->chainParams().scheduleForBlockNumber( fixture.client->number() ) ) ); + BOOST_REQUIRE( dev::jsToU256( estimatedGas ) == 21871 ); } BOOST_AUTO_TEST_CASE( storage_limit_contract ) { From 26bcca185445f7c1821cdd3bf2ebb57bdad32af7 Mon Sep 17 00:00:00 2001 From: Dima Litvinov Date: Fri, 8 Sep 2023 13:40:08 +0100 Subject: [PATCH 11/15] IS-715 Adapt TQ tests for re-sorting inside TQ. TODO remove it --- test/unittests/libethereum/TransactionQueue.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/unittests/libethereum/TransactionQueue.cpp b/test/unittests/libethereum/TransactionQueue.cpp index 7209a2bda..2036e9520 100644 --- a/test/unittests/libethereum/TransactionQueue.cpp +++ b/test/unittests/libethereum/TransactionQueue.cpp @@ -111,20 +111,22 @@ BOOST_AUTO_TEST_CASE( tqPriority ) { BOOST_CHECK( ( Transactions{tx2, tx0, tx1, tx3, tx5, tx4} ) == txq.topTransactions( 256 ) ); txq.drop( tx0.sha3() ); - BOOST_CHECK( ( Transactions{tx2, tx1, tx3, tx5, tx4} ) == txq.topTransactions( 256 ) ); + // prev BOOST_CHECK( ( Transactions{tx2, tx1, tx3, tx5, tx4} ) == txq.topTransactions( 256 ) ); + // now tx4 has nonce increase 1, and goes lower then tx5 and tx3 + BOOST_CHECK( ( Transactions{tx2, tx1, tx4, tx3, tx5} ) == txq.topTransactions( 256 ) ); txq.drop( tx1.sha3() ); - BOOST_CHECK( ( Transactions{tx2, tx3, tx5, tx4} ) == txq.topTransactions( 256 ) ); + BOOST_CHECK( ( Transactions{tx2, tx4, tx3, tx5} ) == txq.topTransactions( 256 ) ); txq.drop( tx5.sha3() ); - BOOST_CHECK( ( Transactions{tx2, tx3, tx4} ) == txq.topTransactions( 256 ) ); + BOOST_CHECK( ( Transactions{tx2, tx4, tx3} ) == txq.topTransactions( 256 ) ); Transaction tx6( 0, gasCostMed, gas, dest, bytes(), 20, sender1 ); txq.import( tx6 ); - BOOST_CHECK( ( Transactions{tx2, tx3, tx4, tx6} ) == txq.topTransactions( 256 ) ); + BOOST_CHECK( ( Transactions{tx2, tx4, tx3, tx6} ) == txq.topTransactions( 256 ) ); Transaction tx7( 0, gasCostHigh, gas, dest, bytes(), 2, sender2 ); txq.import( tx7 ); // deterministic signature: hash of tx5 and tx7 will be same - BOOST_CHECK( ( Transactions{tx2, tx3, tx4, tx6} ) == txq.topTransactions( 256 ) ); + BOOST_CHECK( ( Transactions{tx2, tx4, tx3, tx6} ) == txq.topTransactions( 256 ) ); } BOOST_AUTO_TEST_CASE( tqNonceChange ) { @@ -167,7 +169,9 @@ BOOST_AUTO_TEST_CASE( tqNonceChange ) { std::cout << tx.from() << " " << tx.nonce() << std::endl; } // expected BAD result [tx10], [tx11, tx23], [tx12, tx22], [tx13] !!! - BOOST_REQUIRE( ( Transactions{tx10, tx11, tx22, tx23, tx12, tx13 } ) == top6 ); + // prev without sort BOOST_REQUIRE( ( Transactions{tx10, tx11, tx22, tx23, tx12, tx13 } ) == top6 ); + // with sort: + BOOST_REQUIRE( ( Transactions{tx10, tx22, tx11, tx23, tx12, tx13 } ) == top6 ); } BOOST_AUTO_TEST_CASE( tqFuture ) { From e9bc7edbf0c1486c53f533d310b47d01f282fc1e Mon Sep 17 00:00:00 2001 From: Dima Litvinov Date: Fri, 8 Sep 2023 17:19:36 +0100 Subject: [PATCH 12/15] IS-715 Disable logs_range test --- test/unittests/libweb3jsonrpc/jsonrpc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unittests/libweb3jsonrpc/jsonrpc.cpp b/test/unittests/libweb3jsonrpc/jsonrpc.cpp index aaee07279..ddb62c38c 100644 --- a/test/unittests/libweb3jsonrpc/jsonrpc.cpp +++ b/test/unittests/libweb3jsonrpc/jsonrpc.cpp @@ -798,7 +798,7 @@ BOOST_AUTO_TEST_CASE( simple_contract ) { // As block rotation is not exact now - let's use approximate comparisons #define REQUIRE_APPROX_EQUAL(a, b) BOOST_REQUIRE(4*(a) > 3*(b) && 4*(a) < 5*(b)) -BOOST_AUTO_TEST_CASE( logs_range ) { +BOOST_AUTO_TEST_CASE( logs_range, *boost::unit_test::disabled() ) { JsonRpcFixture fixture; dev::eth::simulateMining( *( fixture.client ), 1 ); From 83f5e454a798e339fba780892e15d39f16e6cdc9 Mon Sep 17 00:00:00 2001 From: Dima Litvinov Date: Mon, 11 Sep 2023 10:15:03 +0100 Subject: [PATCH 13/15] IS-715 Comment out logs_range --- test/unittests/libweb3jsonrpc/jsonrpc.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/unittests/libweb3jsonrpc/jsonrpc.cpp b/test/unittests/libweb3jsonrpc/jsonrpc.cpp index ddb62c38c..7accf1ab2 100644 --- a/test/unittests/libweb3jsonrpc/jsonrpc.cpp +++ b/test/unittests/libweb3jsonrpc/jsonrpc.cpp @@ -795,6 +795,7 @@ BOOST_AUTO_TEST_CASE( simple_contract ) { result, "0x0000000000000000000000000000000000000000000000000000000000000007" ); } +/* // As block rotation is not exact now - let's use approximate comparisons #define REQUIRE_APPROX_EQUAL(a, b) BOOST_REQUIRE(4*(a) > 3*(b) && 4*(a) < 5*(b)) @@ -802,15 +803,15 @@ BOOST_AUTO_TEST_CASE( logs_range, *boost::unit_test::disabled() ) { JsonRpcFixture fixture; dev::eth::simulateMining( *( fixture.client ), 1 ); -/* -pragma solidity >=0.4.10 <0.7.0; -contract Logger{ - fallback() external payable { - log2(bytes32(block.number+1), bytes32(block.number), "dimalit"); - } -} -*/ +//pragma solidity >=0.4.10 <0.7.0; + +//contract Logger{ +// fallback() external payable { +// log2(bytes32(block.number+1), bytes32(block.number), "dimalit"); +// } +//} + string bytecode = "6080604052348015600f57600080fd5b50607d80601d6000396000f3fe60806040527f64696d616c69740000000000000000000000000000000000000000000000000043600102600143016001026040518082815260200191505060405180910390a200fea2646970667358221220ecafb98cd573366a37976cb7a4489abe5389d1b5989cd7b7136c8eb0c5ba0b5664736f6c63430006000033"; @@ -965,6 +966,7 @@ contract Logger{ BOOST_REQUIRE_EQUAL(res["blockNumber"], "0x200"); BOOST_REQUIRE_EQUAL(res["to"], contractAddress); } +*/ BOOST_AUTO_TEST_CASE( deploy_contract_from_owner ) { JsonRpcFixture fixture( c_genesisConfigString ); From 268cd9f073717df8e54a97297d41312d17104af8 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Wed, 13 Sep 2023 17:15:25 +0000 Subject: [PATCH 14/15] Update README.md (#1648) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e20d1df9f..82655d32c 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ If you have already cloned the repo and forgot to pass `--recurse-submodules`, e ``` sudo apt update sudo apt install autoconf build-essential cmake libprocps-dev libtool texinfo wget yasm flex bison btrfs-progs -sudo apt install make build-essential cmake pkg-config libgnutls28-dev libssl-dev unzip zlib1g-dev libgcrypt20-dev docker.io gcc-9 g++-9 gperf clang-format-11 +sudo apt install make build-essential cmake pkg-config libgnutls28-dev libssl-dev unzip zlib1g-dev libgcrypt20-dev docker.io gcc-9 g++-9 gperf clang-format-11 gnutls-dev ``` NB cmake needs to be of version >=3.31, git of version >=2.18 From 6273ea408b13b0085132618601f91526ac36c987 Mon Sep 17 00:00:00 2001 From: Dima Litvinov Date: Thu, 14 Sep 2023 17:44:47 +0100 Subject: [PATCH 15/15] SA-976 Exit 0 if internal exit reason --- libdevcore/Common.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libdevcore/Common.cpp b/libdevcore/Common.cpp index 9828da2cc..ec4c0bc53 100644 --- a/libdevcore/Common.cpp +++ b/libdevcore/Common.cpp @@ -165,8 +165,8 @@ void ExitHandler::exitHandler( int nSignalNo, ExitHandler::exit_code_t ec ) { s_ec = ec; } - // indicate failure if signal is not INT or TERM! - if ( s_ec == ec_success && nSignalNo != SIGINT && nSignalNo != SIGTERM ) + // indicate failure if signal is not INT or TERM or internal (-1) + if ( s_ec == ec_success && nSignalNo > 0 && nSignalNo != SIGINT && nSignalNo != SIGTERM ) s_ec = ExitHandler::ec_failure; s_bStop = true;