From ec344c64dff2109c023ca8338a4168b921465ee2 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 26 Sep 2023 20:15:27 +0100 Subject: [PATCH 01/12] 1672 Add stats to selfdestruct. Print patches --- libethereum/BlockChain.cpp | 4 +++- libethereum/Client.cpp | 30 ++++++++++++++---------- libethereum/SchainPatch.h | 13 +++++++++- libskale/ContractStorageLimitPatch.h | 5 ++++ libskale/ContractStorageZeroValuePatch.h | 6 +++++ libskale/POWCheckPatch.h | 5 ++++ libskale/RevertableFSPatch.h | 5 ++++ libskale/StorageDestructionPatch.h | 6 +++++ libskale/VerifyDaSigsPatch.h | 5 ++++ 9 files changed, 64 insertions(+), 15 deletions(-) diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 8902b8ff0..fcca55c02 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -1263,7 +1263,8 @@ void BlockChain::garbageCollect( bool _force ) { m_lastCollection = chrono::system_clock::now(); - while ( m_lastStats.memTotal() >= c_maxCacheSize ) { + // We subtract memory that blockhashes occupy because it is treated sepaparately + while ( m_lastStats.memTotal() - m_lastStats.memBlockHashes >= c_maxCacheSize ) { Guard l( x_cacheUsage ); for ( CacheID const& id : m_cacheUsage.back() ) { m_inUse.erase( id ); @@ -1316,6 +1317,7 @@ void BlockChain::garbageCollect( bool _force ) { { WriteGuard l( x_blockHashes ); + // This is where block hash memory cleanup is treated // allow only 4096 blockhashes in the cache if ( m_blockHashes.size() > 4096 ) { auto last = m_blockHashes.begin(); diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index dcd422880..c4a78324d 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -153,17 +153,16 @@ Client::Client( ChainParams const& _params, int _networkID, init( _forceAction, _networkID ); TotalStorageUsedPatch::g_client = this; - ContractStorageLimitPatch::contractStoragePatchTimestamp = - chainParams().sChain.contractStoragePatchTimestamp; - ContractStorageZeroValuePatch::contractStorageZeroValuePatchTimestamp = - chainParams().sChain.contractStorageZeroValuePatchTimestamp; - VerifyDaSigsPatch::verifyDaSigsPatchTimestamp = chainParams().sChain.verifyDaSigsPatchTimestamp; - RevertableFSPatch::revertableFSPatchTimestamp = chainParams().sChain.revertableFSPatchTimestamp; - StorageDestructionPatch::storageDestructionPatchTimestamp = - chainParams().sChain.storageDestructionPatchTimestamp; - POWCheckPatch::powCheckPatchTimestamp = chainParams().sChain.powCheckPatchTimestamp; + ContractStorageLimitPatch::setTimestamp( chainParams().sChain.contractStoragePatchTimestamp ); + ContractStorageZeroValuePatch::setTimestamp( + chainParams().sChain.contractStorageZeroValuePatchTimestamp ); + VerifyDaSigsPatch::setTimestamp( chainParams().sChain.verifyDaSigsPatchTimestamp ); + RevertableFSPatch::setTimestamp( chainParams().sChain.revertableFSPatchTimestamp ); + StorageDestructionPatch::setTimestamp( chainParams().sChain.storageDestructionPatchTimestamp ); + POWCheckPatch::setTimestamp( chainParams().sChain.powCheckPatchTimestamp ); } + Client::~Client() { stopWorking(); } @@ -1080,7 +1079,9 @@ Block Client::blockByNumber( BlockNumber _h ) const { auto readState = m_state.createStateReadOnlyCopy(); readState.mutableHistoricState().setRootByBlockNumber( _h ); - DEV_GUARDED( m_blockImportMutex ) { return Block( bc(), hash, readState ); } + DEV_GUARDED( m_blockImportMutex ) { + return Block( bc(), hash, readState ); + } assert( false ); return Block( bc() ); } catch ( Exception& ex ) { @@ -1094,7 +1095,9 @@ Block Client::blockByNumber( BlockNumber _h ) const { Block Client::latestBlock() const { // TODO Why it returns not-filled block??! (see Block ctor) try { - DEV_GUARDED( m_blockImportMutex ) { return Block( bc(), bc().currentHash(), m_state ); } + DEV_GUARDED( m_blockImportMutex ) { + return Block( bc(), bc().currentHash(), m_state ); + } assert( false ); return Block( bc() ); } catch ( Exception& ex ) { @@ -1242,7 +1245,7 @@ ExecutionResult Client::call( Address const& _from, u256 _value, Address _dest, t.checkOutExternalGas( ~u256( 0 ) ); if ( _ff == FudgeFactor::Lenient ) { historicBlock.mutableState().mutableHistoricState().addBalance( - _from, ( u256 )( t.gas() * t.gasPrice() + t.value() ) ); + _from, ( u256 ) ( t.gas() * t.gasPrice() + t.value() ) ); } ret = historicBlock.executeHistoricCall( bc().lastBlockHashes(), t ); @@ -1266,7 +1269,8 @@ ExecutionResult Client::call( Address const& _from, u256 _value, Address _dest, t.forceChainId( chainParams().chainID ); t.checkOutExternalGas( ~u256( 0 ) ); if ( _ff == FudgeFactor::Lenient ) - temp.mutableState().addBalance( _from, ( u256 )( t.gas() * t.gasPrice() + t.value() ) ); + temp.mutableState().addBalance( + _from, ( u256 ) ( t.gas() * t.gasPrice() + t.value() ) ); ret = temp.execute( bc().lastBlockHashes(), t, skale::Permanence::Reverted ); } catch ( InvalidNonce const& in ) { LOG( m_logger ) << "exception in client call(1):" diff --git a/libethereum/SchainPatch.h b/libethereum/SchainPatch.h index 9994336dd..5bafcdcd0 100644 --- a/libethereum/SchainPatch.h +++ b/libethereum/SchainPatch.h @@ -1,6 +1,17 @@ #ifndef SCHAINPATCH_H #define SCHAINPATCH_H -class SchainPatch {}; +#include + +class SchainPatch { +public: + static void printInfo( const std::string& _patchName, time_t _timeStamp ) { + if ( _timeStamp == 0 ) { + cnote << "Patch " << _patchName << " is disabled"; + } else { + cnote << "Patch " << _patchName << " is set at timestamp " << _timeStamp; + } + } +}; #endif // SCHAINPATCH_H diff --git a/libskale/ContractStorageLimitPatch.h b/libskale/ContractStorageLimitPatch.h index 0884b81a1..f7442b572 100644 --- a/libskale/ContractStorageLimitPatch.h +++ b/libskale/ContractStorageLimitPatch.h @@ -21,6 +21,11 @@ class ContractStorageLimitPatch : public SchainPatch { public: static bool isEnabled(); + static void setTimestamp( time_t _timeStamp ) { + printInfo( __FILE__, _timeStamp ); + contractStoragePatchTimestamp = _timeStamp; + } + private: friend class dev::eth::Client; static time_t contractStoragePatchTimestamp; diff --git a/libskale/ContractStorageZeroValuePatch.h b/libskale/ContractStorageZeroValuePatch.h index d38b737ce..f64d3059a 100644 --- a/libskale/ContractStorageZeroValuePatch.h +++ b/libskale/ContractStorageZeroValuePatch.h @@ -21,6 +21,12 @@ class ContractStorageZeroValuePatch : public SchainPatch { public: static bool isEnabled(); + static void setTimestamp( time_t _timeStamp ) { + printInfo( __FILE__, _timeStamp ); + contractStorageZeroValuePatchTimestamp = _timeStamp; + } + + private: friend class dev::eth::Client; static time_t contractStorageZeroValuePatchTimestamp; diff --git a/libskale/POWCheckPatch.h b/libskale/POWCheckPatch.h index 37166a1b8..65a4f5905 100644 --- a/libskale/POWCheckPatch.h +++ b/libskale/POWCheckPatch.h @@ -17,6 +17,11 @@ class POWCheckPatch : public SchainPatch { public: static bool isEnabled(); + static void setTimestamp( time_t _timeStamp ) { + printInfo( __FILE__, _timeStamp ); + powCheckPatchTimestamp = _timeStamp; + } + private: friend class dev::eth::Client; static time_t powCheckPatchTimestamp; diff --git a/libskale/RevertableFSPatch.h b/libskale/RevertableFSPatch.h index 195d409f1..83321bfec 100644 --- a/libskale/RevertableFSPatch.h +++ b/libskale/RevertableFSPatch.h @@ -14,6 +14,11 @@ class RevertableFSPatch : public SchainPatch { public: static bool isEnabled(); + static void setTimestamp( time_t _timeStamp ) { + printInfo( __FILE__, _timeStamp ); + revertableFSPatchTimestamp = _timeStamp; + } + private: friend class dev::eth::Client; static time_t revertableFSPatchTimestamp; diff --git a/libskale/StorageDestructionPatch.h b/libskale/StorageDestructionPatch.h index 17340977b..fb16bbb4d 100644 --- a/libskale/StorageDestructionPatch.h +++ b/libskale/StorageDestructionPatch.h @@ -14,6 +14,12 @@ class StorageDestructionPatch : public SchainPatch { public: static bool isEnabled(); + static void setTimestamp( time_t _timeStamp ) { + printInfo( __FILE__, _timeStamp ); + storageDestructionPatchTimestamp = _timeStamp; + } + + private: friend class dev::eth::Client; static time_t storageDestructionPatchTimestamp; diff --git a/libskale/VerifyDaSigsPatch.h b/libskale/VerifyDaSigsPatch.h index 816f2b743..426412507 100644 --- a/libskale/VerifyDaSigsPatch.h +++ b/libskale/VerifyDaSigsPatch.h @@ -26,6 +26,11 @@ class VerifyDaSigsPatch : public SchainPatch { static time_t verifyDaSigsPatchTimestamp; static time_t lastBlockTimestamp; + static void setTimestamp( time_t _timeStamp ) { + printInfo( __FILE__, _timeStamp ); + verifyDaSigsPatchTimestamp = _timeStamp; + } + public: static time_t getVerifyDaSigsPatchTimestamp(); }; From 686040923682048de64f3adde40f3783e0225d42 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 26 Sep 2023 21:14:38 +0100 Subject: [PATCH 02/12] 1672 Added stats for deletes --- libdevcore/LevelDB.cpp | 15 +++++++++++++++ libdevcore/LevelDB.h | 7 +++++++ libethereum/Client.cpp | 4 +++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/libdevcore/LevelDB.cpp b/libdevcore/LevelDB.cpp index 5b29b04f3..c4866ec45 100644 --- a/libdevcore/LevelDB.cpp +++ b/libdevcore/LevelDB.cpp @@ -70,6 +70,7 @@ class LevelDBWriteBatch : public WriteBatchFace { private: leveldb::WriteBatch m_writeBatch; + std::atomic keysToBeDeletedCount; }; void LevelDBWriteBatch::insert( Slice _key, Slice _value ) { @@ -78,6 +79,7 @@ void LevelDBWriteBatch::insert( Slice _key, Slice _value ) { } void LevelDBWriteBatch::kill( Slice _key ) { + LevelDB::g_keysToBeDeletedStats++; m_writeBatch.Delete( toLDBSlice( _key ) ); } @@ -168,6 +170,9 @@ void LevelDB::insert( Slice _key, Slice _value ) { void LevelDB::kill( Slice _key ) { leveldb::Slice const key( _key.data(), _key.size() ); auto const status = m_db->Delete( m_writeOptions, key ); + // Add this point the key is not actually deleted. It will be deleted when the batch + // is committed + g_keysToBeDeletedStats++; checkStatus( status ); } @@ -185,6 +190,9 @@ void LevelDB::commit( std::unique_ptr< WriteBatchFace > _batch ) { DatabaseError() << errinfo_comment( "Invalid batch type passed to LevelDB::commit" ) ); } auto const status = m_db->Write( m_writeOptions, &batchPtr->writeBatch() ); + // Commit happened. Increment key deletes count + g_keyDeletesStats += g_keysToBeDeletedStats; + g_keysToBeDeletedStats = 0; checkStatus( status ); } @@ -275,5 +283,12 @@ void LevelDB::doCompaction() const { m_db->CompactRange( nullptr, nullptr ); } +std::atomic LevelDB::g_keysToBeDeletedStats = 0; +std::atomic LevelDB::g_keyDeletesStats = 0; + +uint64_t LevelDB::getKeyDeletesStats() { + return g_keyDeletesStats; +} + } // namespace db } // namespace dev diff --git a/libdevcore/LevelDB.h b/libdevcore/LevelDB.h index 9503e3da0..0a597c51e 100644 --- a/libdevcore/LevelDB.h +++ b/libdevcore/LevelDB.h @@ -61,6 +61,13 @@ class LevelDB : public DatabaseFace { void doCompaction() const; + // Return the total count of key deletes since the start + static uint64_t getKeyDeletesStats(); + // count of the keys that were deleted since the start of skaled + static std::atomic< uint64_t > g_keyDeletesStats; + // count of the keys that are scheduled to be deleted but are not yet deleted + static std::atomic< uint64_t > g_keysToBeDeletedStats; + private: std::unique_ptr< leveldb::DB > m_db; leveldb::ReadOptions const m_readOptions; diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index c4a78324d..c62b19968 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -44,6 +44,7 @@ #include #include +#include #ifdef HISTORIC_STATE #include @@ -923,7 +924,8 @@ void Client::sealUnconditionally( bool submitToBlockChain ) { << ":BDS:" << BlockDetails::howMany() << ":TSS:" << TransactionSkeleton::howMany() << ":UTX:" << TransactionQueue::UnverifiedTransaction::howMany() << ":VTX:" << TransactionQueue::VerifiedTransaction::howMany() - << ":CMM:" << bc().getTotalCacheMemory(); + << ":CMM:" << bc().getTotalCacheMemory() + << ":KDS:" << db::LevelDB::getKeyDeletesStats(); if ( number() % 1000 == 0 ) { ssBlockStats << ":RAM:" << getRAMUsage(); ssBlockStats << ":CPU:" << getCPUUsage(); From aef845b6ce43b05f19cc59f45a5fd6e4cea2c666 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 26 Sep 2023 21:22:19 +0100 Subject: [PATCH 03/12] 1672 Clang format --- libethereum/Client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index c62b19968..85247ee8e 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -43,8 +43,8 @@ #include #include -#include #include +#include #ifdef HISTORIC_STATE #include From 5f6ddeb04f58f7aeee16af90188872c5ab28e5fc Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 26 Sep 2023 21:34:16 +0100 Subject: [PATCH 04/12] 1672 Clang format --- libethereum/Client.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 85247ee8e..217825c82 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -972,10 +972,11 @@ void Client::noteChanged( h256Hash const& _filters ) { w.second.append_changes( m_filters.at( w.second.id ).changes_ ); } else if ( m_specialFilters.count( w.second.id ) ) for ( h256 const& hash : m_specialFilters.at( w.second.id ) ) { - LOG( m_loggerWatch ) << "!!! " << w.first << " " - << ( w.second.id == PendingChangedFilter ? "pending" : - w.second.id == ChainChangedFilter ? "chain" : - "???" ); + LOG( m_loggerWatch ) + << "!!! " << w.first << " " + << ( w.second.id == PendingChangedFilter ? + "pending" : + w.second.id == ChainChangedFilter ? "chain" : "???" ); w.second.append_changes( LocalisedLogEntry( SpecialLogEntry, hash ) ); } } @@ -1081,9 +1082,7 @@ Block Client::blockByNumber( BlockNumber _h ) const { auto readState = m_state.createStateReadOnlyCopy(); readState.mutableHistoricState().setRootByBlockNumber( _h ); - DEV_GUARDED( m_blockImportMutex ) { - return Block( bc(), hash, readState ); - } + DEV_GUARDED( m_blockImportMutex ) { return Block( bc(), hash, readState ); } assert( false ); return Block( bc() ); } catch ( Exception& ex ) { @@ -1097,9 +1096,7 @@ Block Client::blockByNumber( BlockNumber _h ) const { Block Client::latestBlock() const { // TODO Why it returns not-filled block??! (see Block ctor) try { - DEV_GUARDED( m_blockImportMutex ) { - return Block( bc(), bc().currentHash(), m_state ); - } + DEV_GUARDED( m_blockImportMutex ) { return Block( bc(), bc().currentHash(), m_state ); } assert( false ); return Block( bc() ); } catch ( Exception& ex ) { @@ -1247,7 +1244,7 @@ ExecutionResult Client::call( Address const& _from, u256 _value, Address _dest, t.checkOutExternalGas( ~u256( 0 ) ); if ( _ff == FudgeFactor::Lenient ) { historicBlock.mutableState().mutableHistoricState().addBalance( - _from, ( u256 ) ( t.gas() * t.gasPrice() + t.value() ) ); + _from, ( u256 )( t.gas() * t.gasPrice() + t.value() ) ); } ret = historicBlock.executeHistoricCall( bc().lastBlockHashes(), t ); @@ -1271,8 +1268,7 @@ ExecutionResult Client::call( Address const& _from, u256 _value, Address _dest, t.forceChainId( chainParams().chainID ); t.checkOutExternalGas( ~u256( 0 ) ); if ( _ff == FudgeFactor::Lenient ) - temp.mutableState().addBalance( - _from, ( u256 ) ( t.gas() * t.gasPrice() + t.value() ) ); + temp.mutableState().addBalance( _from, ( u256 )( t.gas() * t.gasPrice() + t.value() ) ); ret = temp.execute( bc().lastBlockHashes(), t, skale::Permanence::Reverted ); } catch ( InvalidNonce const& in ) { LOG( m_logger ) << "exception in client call(1):" From d3dc58275d81ecb8d4d102d7eb229903e48d976f Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 26 Sep 2023 21:35:47 +0100 Subject: [PATCH 05/12] 1672 more clang format --- libdevcore/LevelDB.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libdevcore/LevelDB.cpp b/libdevcore/LevelDB.cpp index 319129092..c5fb3e505 100644 --- a/libdevcore/LevelDB.cpp +++ b/libdevcore/LevelDB.cpp @@ -70,7 +70,7 @@ class LevelDBWriteBatch : public WriteBatchFace { private: leveldb::WriteBatch m_writeBatch; - std::atomic keysToBeDeletedCount; + std::atomic< uint64_t > keysToBeDeletedCount; }; void LevelDBWriteBatch::insert( Slice _key, Slice _value ) { @@ -283,8 +283,8 @@ void LevelDB::doCompaction() const { m_db->CompactRange( nullptr, nullptr ); } -std::atomic LevelDB::g_keysToBeDeletedStats = 0; -std::atomic LevelDB::g_keyDeletesStats = 0; +std::atomic< uint64_t > LevelDB::g_keysToBeDeletedStats = 0; +std::atomic< uint64_t > LevelDB::g_keyDeletesStats = 0; uint64_t LevelDB::getKeyDeletesStats() { return g_keyDeletesStats; From 04327de24e5b0cf64764f1672787e90a4f1fa019 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 26 Sep 2023 21:41:38 +0100 Subject: [PATCH 06/12] 1672 clang format --- libethereum/Client.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 217825c82..9c3213511 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -972,11 +972,10 @@ void Client::noteChanged( h256Hash const& _filters ) { w.second.append_changes( m_filters.at( w.second.id ).changes_ ); } else if ( m_specialFilters.count( w.second.id ) ) for ( h256 const& hash : m_specialFilters.at( w.second.id ) ) { - LOG( m_loggerWatch ) - << "!!! " << w.first << " " - << ( w.second.id == PendingChangedFilter ? - "pending" : - w.second.id == ChainChangedFilter ? "chain" : "???" ); + LOG( m_loggerWatch ) << "!!! " << w.first << " " + << ( w.second.id == PendingChangedFilter ? "pending" : + w.second.id == ChainChangedFilter ? "chain" : + "???" ); w.second.append_changes( LocalisedLogEntry( SpecialLogEntry, hash ) ); } } From 4463aa9eaea3b0030334d27e6bd72c0fe8976aa9 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:56:28 +0100 Subject: [PATCH 07/12] Update LevelDB.cpp 1672 add_stats_to_self_destruct. Fix typo --- libdevcore/LevelDB.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdevcore/LevelDB.cpp b/libdevcore/LevelDB.cpp index c5fb3e505..69d32c525 100644 --- a/libdevcore/LevelDB.cpp +++ b/libdevcore/LevelDB.cpp @@ -170,7 +170,7 @@ void LevelDB::insert( Slice _key, Slice _value ) { void LevelDB::kill( Slice _key ) { leveldb::Slice const key( _key.data(), _key.size() ); auto const status = m_db->Delete( m_writeOptions, key ); - // Add this point the key is not actually deleted. It will be deleted when the batch + // At this point the key is not actually deleted. It will be deleted when the batch // is committed g_keysToBeDeletedStats++; checkStatus( status ); From 3efcc7de4e356f97869c476218cde38f476402ee Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:58:09 +0100 Subject: [PATCH 08/12] 1672 Self destruct stats. Fix typo --- libdevcore/LevelDB.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libdevcore/LevelDB.cpp b/libdevcore/LevelDB.cpp index 69d32c525..17997012a 100644 --- a/libdevcore/LevelDB.cpp +++ b/libdevcore/LevelDB.cpp @@ -190,7 +190,8 @@ void LevelDB::commit( std::unique_ptr< WriteBatchFace > _batch ) { DatabaseError() << errinfo_comment( "Invalid batch type passed to LevelDB::commit" ) ); } auto const status = m_db->Write( m_writeOptions, &batchPtr->writeBatch() ); - // Commit happened. Increment key deletes count + // Commit happened. This means the keys actually got deleted in LevelDB. Increment key deletes statst + // and set g_keysToBeDeletedStats to zero g_keyDeletesStats += g_keysToBeDeletedStats; g_keysToBeDeletedStats = 0; checkStatus( status ); From d7e8101f9fda49ed42031ba3b292205525f1bead Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Wed, 27 Sep 2023 12:11:54 +0100 Subject: [PATCH 09/12] 1672 add stats. Fix typo --- libethereum/Client.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 9c3213511..9802db14a 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -153,6 +153,7 @@ Client::Client( ChainParams const& _params, int _networkID, init( _forceAction, _networkID ); + // Set timestamps for patches. TotalStorageUsedPatch::g_client = this; ContractStorageLimitPatch::setTimestamp( chainParams().sChain.contractStoragePatchTimestamp ); ContractStorageZeroValuePatch::setTimestamp( From 3850f1a872c5e85a9a74d79d27254ac441f3132c Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:08:53 +0100 Subject: [PATCH 10/12] 1672 clang format --- libdevcore/LevelDB.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libdevcore/LevelDB.cpp b/libdevcore/LevelDB.cpp index 17997012a..a5849d62e 100644 --- a/libdevcore/LevelDB.cpp +++ b/libdevcore/LevelDB.cpp @@ -190,8 +190,8 @@ void LevelDB::commit( std::unique_ptr< WriteBatchFace > _batch ) { DatabaseError() << errinfo_comment( "Invalid batch type passed to LevelDB::commit" ) ); } auto const status = m_db->Write( m_writeOptions, &batchPtr->writeBatch() ); - // Commit happened. This means the keys actually got deleted in LevelDB. Increment key deletes statst - // and set g_keysToBeDeletedStats to zero + // Commit happened. This means the keys actually got deleted in LevelDB. Increment key deletes stats + // and set g_keysToBeDeletedStats to zero g_keyDeletesStats += g_keysToBeDeletedStats; g_keysToBeDeletedStats = 0; checkStatus( status ); From 6f0b47b640c6bf33ba2482fd6c7913751f22ae8d Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:10:10 +0100 Subject: [PATCH 11/12] 1672 Clang format --- libethereum/Client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 9802db14a..36e651e0c 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -153,7 +153,7 @@ Client::Client( ChainParams const& _params, int _networkID, init( _forceAction, _networkID ); - // Set timestamps for patches. + // Set timestamps for patches TotalStorageUsedPatch::g_client = this; ContractStorageLimitPatch::setTimestamp( chainParams().sChain.contractStoragePatchTimestamp ); ContractStorageZeroValuePatch::setTimestamp( From 451db1d228add97c84cb7319ca30a98e727f1709 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:12:17 +0100 Subject: [PATCH 12/12] 1672 clang format --- libdevcore/LevelDB.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libdevcore/LevelDB.cpp b/libdevcore/LevelDB.cpp index a5849d62e..2896cf4d0 100644 --- a/libdevcore/LevelDB.cpp +++ b/libdevcore/LevelDB.cpp @@ -190,8 +190,8 @@ void LevelDB::commit( std::unique_ptr< WriteBatchFace > _batch ) { DatabaseError() << errinfo_comment( "Invalid batch type passed to LevelDB::commit" ) ); } auto const status = m_db->Write( m_writeOptions, &batchPtr->writeBatch() ); - // Commit happened. This means the keys actually got deleted in LevelDB. Increment key deletes stats - // and set g_keysToBeDeletedStats to zero + // Commit happened. This means the keys actually got deleted in LevelDB. Increment key deletes + // stats and set g_keysToBeDeletedStats to zero g_keyDeletesStats += g_keysToBeDeletedStats; g_keysToBeDeletedStats = 0; checkStatus( status );