From d385944c4f7c9e2b2c0c2e9a7a1d98c48ae8dde5 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 7 May 2024 13:01:58 +0100 Subject: [PATCH 01/11] 806 consensus improvements --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index 2f7c74374..2db0f7b1b 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit 2f7c7437465ed3cbbfc914ce9fb0fefe3d096ecb +Subproject commit 2db0f7b1b860d262f0dad67b5a0b83152a95ee84 From b488ef293a9dd4e8125e3524d55182b05f2e08e0 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 7 May 2024 13:15:03 +0100 Subject: [PATCH 02/11] 806 improve consensus --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index 2db0f7b1b..d99a897a9 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit 2db0f7b1b860d262f0dad67b5a0b83152a95ee84 +Subproject commit d99a897a9f254a259cdf1b2e991744e779c783b7 From aafb27c4c3c0c784dd298fb6243dcacd06d4609d Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 7 May 2024 15:16:35 +0100 Subject: [PATCH 03/11] #806 enable patches --- libethereum/SchainPatch.cpp | 14 ++++++++++---- libethereum/SchainPatchEnum.h | 4 +++- libethereum/SkaleHost.cpp | 2 ++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/libethereum/SchainPatch.cpp b/libethereum/SchainPatch.cpp index 1ae076376..97d37ef5c 100644 --- a/libethereum/SchainPatch.cpp +++ b/libethereum/SchainPatch.cpp @@ -20,14 +20,17 @@ SchainPatchEnum getEnumForPatchName( const std::string& _patchName ) { return SchainPatchEnum::ContractStorageZeroValuePatch; else if ( _patchName == "PushZeroPatch" ) return SchainPatchEnum::PushZeroPatch; - else if ( _patchName == "VerifyDaSigsPatch" ) - return SchainPatchEnum::VerifyDaSigsPatch; else if ( _patchName == "ContractStoragePatch" ) return SchainPatchEnum::ContractStoragePatch; else if ( _patchName == "StorageDestructionPatch" ) return SchainPatchEnum::StorageDestructionPatch; else if ( _patchName == "SkipInvalidTransactionsPatch" ) return SchainPatchEnum::SkipInvalidTransactionsPatch; + // consesus-related patches + else if ( _patchName == "VerifyDaSigsPatch" ) + return SchainPatchEnum::VerifyDaSigsPatch; + else if ( _patchName == "FastConsensusPatch" ) + return SchainPatchEnum::FastConsensusPatch; else throw std::out_of_range( _patchName ); } @@ -46,8 +49,6 @@ std::string getPatchNameForEnum( SchainPatchEnum _enumValue ) { return "ContractStorageZeroValuePatch"; case SchainPatchEnum::PushZeroPatch: return "PushZeroPatch"; - case SchainPatchEnum::VerifyDaSigsPatch: - return "VerifyDaSigsPatch"; case SchainPatchEnum::ContractStoragePatch: return "ContractStoragePatch"; case SchainPatchEnum::StorageDestructionPatch: @@ -56,6 +57,11 @@ std::string getPatchNameForEnum( SchainPatchEnum _enumValue ) { return "SkipInvalidTransactionsPatch"; case SchainPatchEnum::SelfdestructStorageLimitPatch: return "SelfdestructStorageLimitPatch"; + // consensus-related patches + case SchainPatchEnum::VerifyDaSigsPatch: + return "VerifyDaSigsPatch"; + case SchainPatchEnum::FastConsensusPatch: + return "FastConsensusPatch"; default: throw std::out_of_range( "UnknownPatch #" + std::to_string( static_cast< size_t >( _enumValue ) ) ); diff --git a/libethereum/SchainPatchEnum.h b/libethereum/SchainPatchEnum.h index b1f439211..033caa6ba 100644 --- a/libethereum/SchainPatchEnum.h +++ b/libethereum/SchainPatchEnum.h @@ -11,11 +11,13 @@ enum class SchainPatchEnum { CorrectForkInPowPatch, ContractStorageZeroValuePatch, PushZeroPatch, - VerifyDaSigsPatch, ContractStoragePatch, StorageDestructionPatch, SkipInvalidTransactionsPatch, SelfdestructStorageLimitPatch, + // consensus related patches + VerifyDaSigsPatch, + FastConsensusPatch, PatchesCount }; diff --git a/libethereum/SkaleHost.cpp b/libethereum/SkaleHost.cpp index 7988705e8..9a53d8163 100644 --- a/libethereum/SkaleHost.cpp +++ b/libethereum/SkaleHost.cpp @@ -81,6 +81,8 @@ std::unique_ptr< ConsensusInterface > DefaultConsensusFactory::create( patchTimeStamps["verifyDaSigsPatchTimestamp"] = m_client.chainParams().getPatchTimestamp( SchainPatchEnum::VerifyDaSigsPatch ); + patchTimeStamps["fastConsensusPatchTimestamp"] = + m_client.chainParams().getPatchTimestamp( SchainPatchEnum::FastConsensusPatch ); auto consensus_engine_ptr = make_unique< ConsensusEngine >( _extFace, m_client.number(), ts, 0, patchTimeStamps, m_client.chainParams().sChain.consensusStorageLimit ); From 84e3099decb7c4aa5d41b5c1ccbf72e9275a5101 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 7 May 2024 15:30:38 +0100 Subject: [PATCH 04/11] 806 fix patch names --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index d99a897a9..78e97fddb 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit d99a897a9f254a259cdf1b2e991744e779c783b7 +Subproject commit 78e97fddb182091f68dedc4d91016f046ac968ca From 395b3a8267efee51ffa4856162927bbe9f3b5f81 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 7 May 2024 15:35:02 +0100 Subject: [PATCH 05/11] 806 fix patch naming --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index 78e97fddb..03bbaf01d 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit 78e97fddb182091f68dedc4d91016f046ac968ca +Subproject commit 03bbaf01de5ce9a55f18c4cf378f72e477b70c33 From 74d215dc7388a4bbb188973892bd862358424278 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 7 May 2024 15:47:16 +0100 Subject: [PATCH 06/11] 806 improve consensus github flow --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index 03bbaf01d..44cb1b0d8 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit 03bbaf01de5ce9a55f18c4cf378f72e477b70c33 +Subproject commit 44cb1b0d82b004426fc8831ab6cc1f229e2d7636 From af986c11686ff170f6f1c683e745e288acafca0d Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Mon, 13 May 2024 19:47:46 +0100 Subject: [PATCH 07/11] 806 consensus improvements --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index 44cb1b0d8..764b63493 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit 44cb1b0d82b004426fc8831ab6cc1f229e2d7636 +Subproject commit 764b634934032fdac49e101a34e59c407a9e159d From cef9482be54bb65a28e2b3816dbd62f5c4a6aacd Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Thu, 16 May 2024 12:14:32 +0100 Subject: [PATCH 08/11] 806 update consensus --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index 764b63493..320b63c95 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit 764b634934032fdac49e101a34e59c407a9e159d +Subproject commit 320b63c958d4a89737e6cbc5e3c0dc0ecf635059 From b19165b9f9f7b944fe2ad5d1cf3dc3bf14c39864 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Thu, 16 May 2024 12:39:56 +0100 Subject: [PATCH 09/11] Updated consensus --- libconsensus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libconsensus b/libconsensus index 320b63c95..b1916ed05 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit 320b63c958d4a89737e6cbc5e3c0dc0ecf635059 +Subproject commit b1916ed05c3b77f5925662fa591b9a054290d0fd From 543907dbed40f3b3fe0961f9b483b656828101fb Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Thu, 16 May 2024 14:56:40 +0100 Subject: [PATCH 10/11] 806b fix build --- libethereum/ClientBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethereum/ClientBase.cpp b/libethereum/ClientBase.cpp index a508dbc9a..768c37a7d 100644 --- a/libethereum/ClientBase.cpp +++ b/libethereum/ClientBase.cpp @@ -219,7 +219,7 @@ LocalisedLogEntries ClientBase::logs( LogFilter const& _f ) const { unsigned begin = min( bc().number() + 1, ( unsigned ) _f.latest() ); unsigned end = min( bc().number(), min( begin, ( unsigned ) _f.earliest() ) ); - if ( begin >= end && begin - end > bc().chainParams().getLogsBlocksLimit ) + if ( begin >= end && begin - end > (uint64_t) bc().chainParams().getLogsBlocksLimit ) BOOST_THROW_EXCEPTION( TooBigResponse() ); // Handle pending transactions differently as they're not on the block chain. From 2a2d16d5e86d1a7369b88f7b468d887a685c6876 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Thu, 16 May 2024 15:01:20 +0100 Subject: [PATCH 11/11] 806 libconsensus --- libethereum/ClientBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethereum/ClientBase.cpp b/libethereum/ClientBase.cpp index 768c37a7d..04b4302a8 100644 --- a/libethereum/ClientBase.cpp +++ b/libethereum/ClientBase.cpp @@ -219,7 +219,7 @@ LocalisedLogEntries ClientBase::logs( LogFilter const& _f ) const { unsigned begin = min( bc().number() + 1, ( unsigned ) _f.latest() ); unsigned end = min( bc().number(), min( begin, ( unsigned ) _f.earliest() ) ); - if ( begin >= end && begin - end > (uint64_t) bc().chainParams().getLogsBlocksLimit ) + if ( begin >= end && begin - end > ( uint64_t ) bc().chainParams().getLogsBlocksLimit ) BOOST_THROW_EXCEPTION( TooBigResponse() ); // Handle pending transactions differently as they're not on the block chain.