-
Notifications
You must be signed in to change notification settings - Fork 33
Changelog Consensus
user_name edited this page Jun 13, 2023
·
26 revisions
All notable changes to this module will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Fix tests
- Add consensus README
- Updates consensus tests to use GetBlock mock instead of Get mock
- Updates consensus test to use BlockStore mock instead of KVStore mock
- Rename
TxResulttoIndexedTransaction
- Updated comments following P2P refactor
- Debug logging improvements
- Log warnings in
handleStateSyncMessage()
- Utilise the
TxResultprotobuf fromshared/core/types
- Added new helper functions for testing hotstuff consensus stages:
waitForNewRound(),waitForPrepareProposal(),waitForPrepareVoteswaitForPreCommit(),waitForCommit(), andwaitForDecide(), and a wrapper functionwaitForNextBlock(). - Removed state machine mock in testing, and introduced actual state machine that starts with
StartAllTestPocketNodes()function and addedgeneratePlaceholderBlock()function - Added, new helper functions for testing state sync stages:
waitForNodeToRequestMissingBlock(),waitForNodeToReceiveMissingBlock(),waitForNodeToCatchUp()and a wrapper functionwaitForNodeToSync()currently as placeholders.
- Updated
handleStateSyncMessage()to log warnings if server mode is not enabled
- Renamed
CreateAndApplyProposalBlocktoCreateProposalBlock - Updated to reflect the new
ApplyBlocksignature fromutilityUnitOfWork - Updated to use
utilityUnitOfWork.GetStateHash() - Removed duplicate import
- Add
fsm_handler.goto handle FSM transition events in consensus module - Update State Machine mock in
utils_test.go - Update state_sync module with additional function definitions
- Improve & simplify
utilityUnitOfWorkmanagement - Logging - improve the wording and context of various logging statements
- Logging - remove a lot of unused logging function helpers
- Genesis - Fix ordering of operations when resetting to genesis
- Added
msgToLoggingFields(hotstuffMsg)helper - Added missing
persistenceContext.Release()calls - Avoid redundant handling of hotstuff messages by replicas
- Consolidated
prev&lastterminology - Consolidated
stateHash&prevHashterminology - Removed unused
logPrefixvariables - Moved implementation of
modules.ConsensusDebugModuleinto its own file - Moved implementation of
modules.ConsensusPacemakerinto its own file - Moved implementation of
modules.ConsensusStateSyncinto its own file
- Bugfix for (unable to send txs in localnet) #631
- Refactored
utilityContextintoutilityUnitOfWork - Added
utilityUnitOfWorkFactoryto createutilityUnitOfWorkinstances depending on the fact that the current node isLeaderorReplica - Renamed
prepareAndApplyBlocktoprepareBlock - Centralized
applyBlocklogic - Updated tests
- Add quorum certificate to the block before committing to persistence
- Add error
ErrNoQcInReceivedBlockand messageDisregardBlock
- Add helper function
logHelper()for logging
- Creating a persistence read context when needing to accessing stateless (i.e. block hash) data
- Renamed package names and parameters to reflect changes in the rest of the codebase
- Removed the unused
validator.proto
- Fixed bug in
sendGetMetadataStateSyncMessage
- Fixed
TestPacemakerCatchupSameStepDifferentRoundstest
- Update logger value references with pointers
- Move functions exposed by ConsensusDebugModule to debugging.go
- Rename ServiceNode Actor Type Name to Servicer
- Updated log messages in the state sync submodule with consistent style and add height information
- Added state sync message types to the types package
- Modules embed
base_modules.IntegratableModuleandbase_modules.InterruptableModulefor DRYness - Updated modules
Createto accept generic options -
resetToGenesisclears the utility mempool as well - Publishing
ConsensusNewHeightEventon new height
- Add a few
nolintcomments to fix the code on main
- Add
state_syncsubmodule, withstate_syncstruct - Implement state sync server to advertise blocks and metadata
- Create new
state_sync_handler.gosource file that handlesStateSyncMessages sent to theConsensusmodule - Add two new tests in
state_sync_test.go:TestStateSyncServerGetMetaDataReqandTestStateSyncServerGetBlock - Update
TestHotstuff4Nodes1BlockHappyPathtest to also retrieve the committed block
- Address legacy linter errors from
golangci-lint
- Changed log lines to utilize new logger module.
- Introduced
hotstuffFIFOMempoolthat extends the logic provided by the genericized FIFO mempool inshared. - Added tests for
hotstuffFIFOMempoolto ensure that it behaves as expected.
- Fix
TestHotstuff4Nodes1BlockHappyPathmisplacement of actual and expected values inrequire.Equal
- Add a note on consensus test related workaround related to #462
- Decouple consensus module and pacemaker module
- Add
pacemakersubmodule - Update pacemaker struct to remove consensus module field, and related functions
- Create new
pacemaker_consensus.gosource file that consists ConsensusPacemaker function implementations
- Rewrite
interface{}toany
- Remove
Blockproto definition to consolidate undershared/core/types
- Force consensus to use a "star-like" broadcast instead of "RainTree" broadcast
- Improve logging throughout through the use of emojis and rewording certain statements
- Slightly improve the block verification flow (renaming, minor fixes, etc…) to stabilize LocalNet
- Rename the
consensus_testspackage toe2e_tests - Internalize configuration related to
fail_on_extra_msgsfrom theMakefileto theconsensusmodule - Forced all tests to fail if we receive extra unexpected messages and modify tests appropriately
- After #198, we made tests deterministic but there was a hidden bug that modified how the test utility functions because the clock would not move while we were waiting for messages. This prevented logs from streaming, tests from failing, and other issues. Tend to all related changes.
- Rename
ValidateMessagetoShouldHandleMessageand return a boolean - Pass a
reasontoInterruptRound - Improve readability of some parts of the code
- Updated module constructor to accept a
busand not aruntimeMgranymore - Registering module with the
busviaRegisterModulemethod - Updated tests and mocks accordingly
- Added protobuf message definitions for requests related to sharing state sync metadata and blocks
- Defined the interface for
StateSyncServerModule,StateSyncModule(moving the old interface toStateSyncModuleLEGACYas a reference only) - Overhaul (updates, improvements, clarifications & additions) of the State Sync README
- Removed
ValidatorMap() ValidatorMap
- ValidatorMap uses
Actorreferences now
- Updated do use the new centralized config and genesis
-
Actoris now a sharedstructinstead of aninterface - Removed converters between the interfaces and the consensus structs for Validators
- Consolidated number of validators in tests in a single constant:
numValidators - Fixed typo in
make test_consensus_concurrent_testsso that we can run the correct test matrix - Using
GetBus()instead ofbuswherever possible -
LeaderElectionModule'selectNextLeaderDeterministicRoundRobinnow usesPersistenceto access the list of validators instead of the staticValidatorMap.
- Unexport
ConsensusModulefields - Create
ConsensusDebugModuleinterface with setter functions to be used only for debugging puroposes - Update test in
TestPacemakerCatchupSameStepDifferentRoundsinpacemaker_test.goto use setter functions
- Removed unused
consensus.UtilityMessage
- Propagate
highPrepareQCif available to the block being created - Remove
blockProtoBytesfrom propagation inSetProposalBlock - Guarantee that write context is released when refreshing the utility context
- Use
GetBlockHash(height)instead ofGetPrevAppHashto be more explicit - Use the real
quorumCertwhen preparing a new block
- Added state sync interfaces and diagrams
- Propagate the
quorumCertificateonBlockcommit to theUtilitymodule - Slightly improved error handling of the
utilityContextlifecycle management
- Removed
apphashandtxResultsfromconsensusModulestructure - Modified lifecycle to
setthe proposal block within aPersistenceContext - Allow block and parts to be committed with the persistence context
- Stores transactions alongside blocks during
commit - Added current block
[]TxResultto the module
#235 Config and genesis handling
- Updated to use
RuntimeMgr - Made
ConsensusModulestruct unexported - Updated tests and mocks
- Removed some cross-module dependencies
- Don't ignore the exit code of
m.Run()in the unit tests
-
consensusModulestores block directly to prevent shared structure in theutilityModule
Consensus logic
- Pass in a list of messages to
findHighQCinstead of a hotstuff step - Made
CreateProposeMessageandCreateVotemessageaccept explicit values, identifying some bugs along the way - Made sure to call
applyBlockwhen usinghighQCfrom previous round - Moved business logic for
prepareAndApplyBlockintohotstuff_leader.go - Removed
MaxBlockBytesand storing the consensus genesis type locally as is
Consensus cleanup
- Using appropriate getters for protocol types in the hotstuff lifecycle
- Replaced
proto.Marshalwithcodec.GetCodec().Marshal - Reorganized and cleaned up the code in
consensus/block.go - Consolidated & removed a few
TODOs throughout the consensus module - Added TECHDEBT and TODOs that will be require for a real block lifecycle
- Fixed typo in
hotstuff_types.proto - Moved the hotstuff handler interface to
consensus/hotstuff_handler.go
Consensus testing
- Improved mock module initialization in
consensus/e2e_tests/utils_test.go
General
- Added a diagram for
AppHashrelatedContextInitialization - Added
Makefilekeywords forTODO
Encapsulate structures previously in shared #163
- Ensured proto structures implement shared interfaces
-
ConsensusConfiguses shared interfaces in order to acceptMockConsensusConfigin test_artifacts -
ConsensusGenesisStateuses shared interfaces in order to acceptMockConsensusGenesisStatein test_artifacts - Implemented shared validator interface for
validator_mapfunctionality
- Initial implementation of Basic Hotstuff
- Initial implementation Hotstuff Pacemaker
- Deterministic round robin leader election
- Skeletons, passthroughs and temporary variables for utility integration
- Initial implementation of the testing framework
- Tests with
make test_pacemakerandmake test_hostuff
- Tests with
make test_vrfandmake test_sortition - Benchmarking via
make benchmark_sortition - VRF Wrapper library in
consensus/leader_election/vrf/of github.com/ProtonMail/go-ecvrf/ecvrf - Implementation of Algorand's Leader Election sortition algorithm in
consensus/leader_election/sortition/
Contents
- Home
- Persistence
- Changelog
-
Persistence
- Indexer
- Rpc
- Runtime
- State_Machine
-
Guides
- Roadmap
-
Guides
- Learning
- Guides
-
Guides
- Contributing
- Devlog
-
Guides
- Dependencies
-
Guides
- Releases
- Guides
- P2P
-
Shared
- Crypto
- Shared
-
Shared
- Modules
-
Build
- Config
- Consensus
-
Guides
- Telemetry
- Utility
- Logger