diff --git a/libethereum/SkaleHost.cpp b/libethereum/SkaleHost.cpp index 46315ef9d..136c793c7 100644 --- a/libethereum/SkaleHost.cpp +++ b/libethereum/SkaleHost.cpp @@ -583,13 +583,6 @@ void SkaleHost::createBlock( const ConsensusExtFace::transactions_vector& _appro out_txns.push_back( t ); m_debugTracer.tracepoint( "drop_good" ); m_tq.dropGood( t ); - - if ( SkaleDebugInterface::g_isEnabled && m_tq.isTransactionKnown( sha ) != 0 ) { - // this trace is expensive since it will aquire a read lock on transaction queue - LOG( m_traceLogger ) - << "Consensus returned future transaction that we didn't yet send"; - m_debugTracer.tracepoint( "import_future" ); - } } total_arrived += out_txns.size(); diff --git a/libskale/SkaleDebug.cpp b/libskale/SkaleDebug.cpp index 9863f825e..ed72fb46d 100644 --- a/libskale/SkaleDebug.cpp +++ b/libskale/SkaleDebug.cpp @@ -5,39 +5,18 @@ #include #include - -std::atomic< bool > SkaleDebugInterface::g_isEnabled = true; - -#define CHECK_ENABLED \ - if ( !SkaleDebugInterface::g_isEnabled ) { \ - return; \ - }; - -#define CHECK_ENABLED_STR \ - if ( !SkaleDebugInterface::g_isEnabled ) { \ - return ""; \ - }; - -#define CHECK_ENABLED_INT \ - if ( !SkaleDebugInterface::g_isEnabled ) { \ - return 0; \ - }; - SkaleDebugInterface::SkaleDebugInterface() {} int SkaleDebugInterface::add_handler( handler h ) { - CHECK_ENABLED_INT; handlers.push_back( h ); return handlers.size() - 1; } void SkaleDebugInterface::remove_handler( int pos ) { - CHECK_ENABLED handlers.erase( handlers.begin() + pos ); } std::string SkaleDebugInterface::call( const std::string& arg ) { - CHECK_ENABLED_STR; for ( auto handler : handlers ) { std::string res = handler( arg ); if ( !res.empty() ) @@ -48,13 +27,11 @@ std::string SkaleDebugInterface::call( const std::string& arg ) { void SkaleDebugTracer::call_on_tracepoint( const std::function< void( const std::string& ) >& callee ) { - CHECK_ENABLED; global_callbacks.push_back( callee ); } void SkaleDebugTracer::call_on_tracepoint( const std::string& name, const std::function< void( const std::string& ) >& callee ) { - CHECK_ENABLED; tracepoint_struct& tp_obj = find_by_name( name ); std::lock_guard< std::mutex > thread_lock( tp_obj.thread_mutex ); @@ -63,7 +40,6 @@ void SkaleDebugTracer::call_on_tracepoint( } void SkaleDebugTracer::break_on_tracepoint( const std::string& name, int count ) { - CHECK_ENABLED; tracepoint_struct& tp_obj = find_by_name( name ); std::lock_guard< std::mutex > thread_lock( tp_obj.thread_mutex ); @@ -75,7 +51,6 @@ void SkaleDebugTracer::break_on_tracepoint( const std::string& name, int count ) } void SkaleDebugTracer::wait_for_tracepoint( const std::string& name ) { - CHECK_ENABLED; tracepoint_struct& tp_obj = find_by_name( name ); std::unique_lock< std::mutex > lock2( tp_obj.caller_mutex ); @@ -83,7 +58,6 @@ void SkaleDebugTracer::wait_for_tracepoint( const std::string& name ) { } void SkaleDebugTracer::continue_on_tracepoint( const std::string& name ) { - CHECK_ENABLED; tracepoint_struct& tp_obj = find_by_name( name ); std::lock_guard< std::mutex > thread_lock( tp_obj.thread_mutex ); @@ -92,7 +66,6 @@ void SkaleDebugTracer::continue_on_tracepoint( const std::string& name ) { } void SkaleDebugTracer::tracepoint( const std::string& name ) { - CHECK_ENABLED; tracepoint_struct& tp_obj = find_by_name( name ); std::unique_lock< std::mutex > lock2( tp_obj.thread_mutex ); @@ -119,7 +92,6 @@ void SkaleDebugTracer::tracepoint( const std::string& name ) { } std::string DebugTracer_handler( const std::string& arg, SkaleDebugTracer& tracer ) { - CHECK_ENABLED_STR; using namespace std; if ( arg.find( "trace " ) == 0 ) { diff --git a/libskale/State.cpp b/libskale/State.cpp index 1ffc4ac48..fd0f56384 100644 --- a/libskale/State.cpp +++ b/libskale/State.cpp @@ -1028,10 +1028,13 @@ std::pair< ExecutionResult, TransactionReceipt > State::execute( EnvInfo const& totalStorageUsed_ += currentStorageUsed_; updateStorageUsage(); } + // TODO: review logic|^ - h256 shaLastTx = _t.sha3(); - + h256 shaLastTx = _t.sha3(); // _t.hasSignature() ? _t.sha3() : _t.sha3( + // dev::eth::WithoutSignature ); this->m_db_ptr->setLastExecutedTransactionHash( shaLastTx ); + // std::cout << "--- saving \"safeLastExecutedTransactionHash\" = " << + // shaLastTx.hex() << "\n"; TransactionReceipt receipt = TransactionReceipt( statusCode, startGasUsed + e.gasUsed(), e.logs() ); diff --git a/libskale/State.h b/libskale/State.h index 31e09f577..3c2eb0941 100644 --- a/libskale/State.h +++ b/libskale/State.h @@ -157,7 +157,6 @@ using ChangeLog = std::vector< Change >; * * Any atomic change to any account is registered and appended in the changelog. * In case some changes must be reverted, the changes are popped from the - * In case some changes must be reverted, the changes are popped from the * changelog and undone. For possible atomic changes list @see Change::Kind. * The changelog is managed by savepoint(), rollback() and commit() methods. */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bae4a33c0..a0a15a45e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,15 +1,3 @@ -# do not use new CMP0110 feature of cmake -if(POLICY CMP0110) - cmake_policy(SET CMP0110 OLD) -endif() - - -macro(assert condition) - if (NOT ${condition}) - message(FATAL_ERROR "Assertion failed: ${condition}") - endif() -endmacro() - file(GLOB_RECURSE sources "*.cpp" "*.h" "*.sol") if( NOT CONSENSUS ) @@ -26,31 +14,24 @@ foreach(file ${sources}) file(STRINGS ${file} test_list_raw REGEX "BOOST_.*TEST_(SUITE|CASE|SUITE_END)") set(TestSuite "DEFAULT") set(TestSuitePath "") - # read source of each test file into a list of string foreach(test_raw ${test_list_raw}) - # we match strings like BOOST_AUTO_TEST_SUITE(JsonRpcSuite) and strip beginning turning them into - # string "SUITE JsonRpcSuite" string(REGEX REPLACE ".*TEST_(SUITE|CASE)\\(( [^ ,\\)]*).*" "\\1 \\2" test ${test_raw}) - assert(test) #skip disabled if (";${excludeSuites};" MATCHES ";${TestSuite};") continue() endif() - # we match string like SUITE JsonRpcSuite These are suite names if(test MATCHES "^SUITE .*") - # now we cut the beginning to get just JsonRpcSuite + string(SUBSTRING ${test} 6 -1 TestSuite) - assert(TestSuite) set(TestSuitePath "${TestSuitePath}/${TestSuite}") - assert(TestSuitePath) + if(FASTCTEST) if (";${excludeSuites};" MATCHES ";${TestSuite};") continue() endif() if (NOT ";${allSuites};" MATCHES ";${TestSuite};") - message(STATUS "TestSuite value: ${TestSuite}") string(SUBSTRING ${TestSuitePath} 1 -1 TestSuitePathFixed) list(APPEND allSuites ${TestSuite}) separate_arguments(TESTETH_ARGS) diff --git a/test/unittests/libskutils/test_skutils_helper.h b/test/unittests/libskutils/test_skutils_helper.h index b3955742a..5833e98ab 100644 --- a/test/unittests/libskutils/test_skutils_helper.h +++ b/test/unittests/libskutils/test_skutils_helper.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/test/unittests/libweb3jsonrpc/WebThreeStubClient.cpp b/test/unittests/libweb3jsonrpc/WebThreeStubClient.cpp index e3f221876..c297164dc 100644 --- a/test/unittests/libweb3jsonrpc/WebThreeStubClient.cpp +++ b/test/unittests/libweb3jsonrpc/WebThreeStubClient.cpp @@ -158,17 +158,6 @@ std::string WebThreeStubClient::skale_protocolVersion() { jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString() ); } - -std::string WebThreeStubClient::skale_stats() { - Json::Value p; - p = Json::nullValue; - Json::Value result = this->CallMethod( "skale_stats", p ); - return result.toStyledString(); -} - - - - std::string WebThreeStubClient::eth_protocolVersion() { Json::Value p; p = Json::nullValue; diff --git a/test/unittests/libweb3jsonrpc/WebThreeStubClient.h b/test/unittests/libweb3jsonrpc/WebThreeStubClient.h index d56bac071..9125b97ab 100644 --- a/test/unittests/libweb3jsonrpc/WebThreeStubClient.h +++ b/test/unittests/libweb3jsonrpc/WebThreeStubClient.h @@ -27,7 +27,6 @@ class WebThreeStubClient : public jsonrpc::Client { bool net_listening() noexcept( false ); std::string skale_receiveTransaction( const Json::Value& param1 ) noexcept( false ); std::string skale_protocolVersion() noexcept( false ); - std::string skale_stats(); std::string eth_protocolVersion() noexcept( false ); std::string skale_shutdownInstance() noexcept( false ); std::string eth_hashrate() noexcept( false ); diff --git a/test/unittests/libweb3jsonrpc/jsonrpc.cpp b/test/unittests/libweb3jsonrpc/jsonrpc.cpp index afb4e34a5..f5e3d7ae9 100644 --- a/test/unittests/libweb3jsonrpc/jsonrpc.cpp +++ b/test/unittests/libweb3jsonrpc/jsonrpc.cpp @@ -4407,8 +4407,6 @@ BOOST_AUTO_TEST_CASE( eth_signAndSendRawTransaction, fixture.splitAccountInHalves( firstAccount, dst, gasPrice, TransactionWait::WAIT_FOR_COMPLETION); } - - cout << fixture.rpcClient()->skale_stats() << endl; } BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthTransfers,