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

[Consensus] State Sync - Configuration & Entrypoints for Node State #351

Closed
10 tasks
Olshansk opened this issue Nov 14, 2022 · 0 comments · Fixed by #528
Closed
10 tasks

[Consensus] State Sync - Configuration & Entrypoints for Node State #351

Olshansk opened this issue Nov 14, 2022 · 0 comments · Fixed by #528
Assignees
Labels
consensus Consensus specific changes

Comments

@Olshansk
Copy link
Member

Olshansk commented Nov 14, 2022

Objective

Maintain the state (e.g. synching, synched, etc...) of the node for state sync & execution purposes. the consensus module will have a variable that maintains state. This will require a constant that indicates its state (synced, syncing, pacemaker). The consensus module should still control state sync but there should be no validation as part of this implementation.

Origin Document

State sync block by block design: #125

Goals

  • A foundation for the full state sync implementation
  • Configurations & a rough "state machine" for all the states involved in state sync

Deliverables

  • Implementation of entrypoints into the different states required for state sync
    • Interfaces that show the lifecycle of syncing without implementing state sync fully
  • At a minimum, enable "synching" and "synced" states
  • Placeholders / TODOs for the real state sync implementation

Non-goals

  • Actual implementation of state sync

General issue checklist

  • Update the appropriate CHANGELOG
  • Update the README
  • If applicable, update the source code tree explanation
  • If applicable, add or update a state, sequence or flowchart diagram using mermaid
  • Update any relevant global documentation & references
  • Document small issues / TODOs along the way

Creators: @jessicadaugherty @Olshansk

@Olshansk Olshansk added the consensus Consensus specific changes label Nov 14, 2022
@Olshansk Olshansk assigned Olshansk and unassigned andrewnguyen22 Nov 23, 2022
@Olshansk Olshansk removed their assignment Feb 22, 2023
gokutheengineer added a commit that referenced this issue Mar 7, 2023
gokutheengineer added a commit that referenced this issue Apr 3, 2023
## Description

Defines entry points and transitions of the state machine for the
following modes:

- Unsynched mode
- Sync Mode
- Synced Mode
- Pacemaker Mode

This PR aims to define state transitions between different modes.
Currently, server mode is not represented by the node's FSM, but rather
it is set through a config variable, and it can be turned on and off via
exported `EnableServerMode` and `DisableServerMode` functions

## Issue

Fixes #351 

## Type of change

Please mark the relevant option(s):

- [X] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [ ] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

## List of changes

- Added `fsm_handler.go` to the consensus module to trigger business
logic in consensus module accordingly to the FSM events
- Added `FSMConsensusEvents` interface to the shared module
- Updated and added FSM states, events, state transitions

## Testing

- [x] `make develop_test`
- [x]
[LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md)
w/ all of the steps outlined in the `README`


## Required Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have tested my changes using the available tooling
- [x] I have updated the corresponding CHANGELOG

### If Applicable Checklist

- [x] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added, or updated,
[mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding
README(s)
- [ ] I have added, or updated, documentation and
[mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*`
if I updated `shared/*`README(s)

---------

Co-authored-by: Alessandro De Blasis <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus Consensus specific changes
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants