Skip to content

Commit

Permalink
Merge pull request #1888 from skalenetwork/806_consensus_improvements
Browse files Browse the repository at this point in the history
806 consensus improvements
  • Loading branch information
DmytroNazarenko authored May 16, 2024
2 parents 35a2a78 + e5ba6b2 commit 932e183
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libconsensus
Submodule libconsensus updated 49 files
+4 −1 .github/workflows/build.yml
+6 −0 .github/workflows/dockerimage.yml
+3 −0 .idea/misc.xml
+51 −41 .idea/workspace.xml
+3 −2 Consensust.cpp
+68 −18 chains/Schain.cpp
+14 −5 chains/Schain.h
+7 −2 chains/SchainGettersSetters.cpp
+21 −0 datastructures/BooleanProposalVector.cpp
+2 −0 datastructures/BooleanProposalVector.h
+1 −1 datastructures/CommittedBlockList.cpp
+10 −0 db/BlockProposalDB.cpp
+441 −0 docs/consensus-spec.md
+124 −0 monitoring/OptimizerAgent.cpp
+48 −0 monitoring/OptimizerAgent.h
+0 −2 network/Network.cpp
+10 −0 node/Node.cpp
+75 −61 pendingqueue/PendingTransactionsAgent.cpp
+17 −16 pendingqueue/TestMessageGeneratorAgent.cpp
+6 −0 pendingqueue/TestMessageGeneratorAgent.h
+135 −71 protocols/blockconsensus/BlockConsensusAgent.cpp
+11 −0 protocols/blockconsensus/BlockConsensusAgent.h
+3 −1 test/11_out_of_16/node1/Node.json
+3 −1 test/11_out_of_16/node10/Node.json
+3 −1 test/11_out_of_16/node11/Node.json
+3 −1 test/11_out_of_16/node2/Node.json
+3 −1 test/11_out_of_16/node3/Node.json
+3 −1 test/11_out_of_16/node4/Node.json
+3 −1 test/11_out_of_16/node5/Node.json
+3 −1 test/11_out_of_16/node6/Node.json
+3 −1 test/11_out_of_16/node7/Node.json
+3 −1 test/11_out_of_16/node8/Node.json
+3 −1 test/11_out_of_16/node9/Node.json
+3 −1 test/sixteennodes/node01/Node.json
+3 −1 test/sixteennodes/node02/Node.json
+3 −1 test/sixteennodes/node03/Node.json
+3 −1 test/sixteennodes/node04/Node.json
+3 −1 test/sixteennodes/node05/Node.json
+3 −1 test/sixteennodes/node06/Node.json
+3 −1 test/sixteennodes/node07/Node.json
+3 −1 test/sixteennodes/node08/Node.json
+3 −1 test/sixteennodes/node09/Node.json
+3 −1 test/sixteennodes/node10/Node.json
+3 −1 test/sixteennodes/node11/Node.json
+3 −1 test/sixteennodes/node12/Node.json
+3 −1 test/sixteennodes/node13/Node.json
+3 −1 test/sixteennodes/node14/Node.json
+3 −1 test/sixteennodes/node15/Node.json
+2 −1 test/sixteennodes/node16/Node.json
2 changes: 1 addition & 1 deletion libethereum/ClientBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 8 additions & 4 deletions libethereum/SchainPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ 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;
else if ( _patchName == "VerifyDaSigsPatch" )
return SchainPatchEnum::VerifyDaSigsPatch;
else if ( _patchName == "FastConsensusPatch" )
return SchainPatchEnum::FastConsensusPatch;
else if ( _patchName == "EIP1559TransactionsPatch" )
return SchainPatchEnum::EIP1559TransactionsPatch;
else if ( _patchName == "VerifyBlsSyncPatch" )
Expand All @@ -52,8 +54,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:
Expand All @@ -62,6 +62,10 @@ std::string getPatchNameForEnum( SchainPatchEnum _enumValue ) {
return "SkipInvalidTransactionsPatch";
case SchainPatchEnum::SelfdestructStorageLimitPatch:
return "SelfdestructStorageLimitPatch";
case SchainPatchEnum::VerifyDaSigsPatch:
return "VerifyDaSigsPatch";
case SchainPatchEnum::FastConsensusPatch:
return "FastConsensusPatch";
case SchainPatchEnum::EIP1559TransactionsPatch:
return "EIP1559TransactionsPatch";
case SchainPatchEnum::VerifyBlsSyncPatch:
Expand Down
3 changes: 2 additions & 1 deletion libethereum/SchainPatchEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ enum class SchainPatchEnum {
CorrectForkInPowPatch,
ContractStorageZeroValuePatch,
PushZeroPatch,
VerifyDaSigsPatch,
ContractStoragePatch,
StorageDestructionPatch,
SkipInvalidTransactionsPatch,
SelfdestructStorageLimitPatch,
VerifyDaSigsPatch,
FastConsensusPatch,
EIP1559TransactionsPatch,
VerifyBlsSyncPatch,
FlexibleDeploymentPatch,
Expand Down
2 changes: 2 additions & 0 deletions libethereum/SkaleHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
patchTimeStamps["verifyBlsSyncPatchTimestamp"] =
m_client.chainParams().getPatchTimestamp( SchainPatchEnum::VerifyBlsSyncPatch );

Expand Down

0 comments on commit 932e183

Please sign in to comment.