Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

806 consensus improvements #1888

Merged
merged 13 commits into from
May 16, 2024
2 changes: 1 addition & 1 deletion libconsensus
Submodule libconsensus updated 47 files
+5 −2 .github/workflows/build.yml
+6 −0 .github/workflows/dockerimage.yml
+3 −0 .idea/misc.xml
+46 −41 .idea/workspace.xml
+66 −8 chains/Schain.cpp
+13 −3 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
+8 −0 node/Node.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
14 changes: 10 additions & 4 deletions libethereum/SchainPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand All @@ -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:
Expand All @@ -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 ) ) );
Expand Down
4 changes: 3 additions & 1 deletion libethereum/SchainPatchEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ enum class SchainPatchEnum {
CorrectForkInPowPatch,
ContractStorageZeroValuePatch,
PushZeroPatch,
VerifyDaSigsPatch,
ContractStoragePatch,
StorageDestructionPatch,
SkipInvalidTransactionsPatch,
SelfdestructStorageLimitPatch,
// consensus related patches
VerifyDaSigsPatch,
FastConsensusPatch,
PatchesCount
};

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 );

auto consensus_engine_ptr = make_unique< ConsensusEngine >( _extFace, m_client.number(), ts, 0,
patchTimeStamps, m_client.chainParams().sChain.consensusStorageLimit );
Expand Down
Loading