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 - Server to Advertise Blocks #409

Closed
8 tasks
jessicadaugherty opened this issue Dec 19, 2022 · 0 comments · Fixed by #431
Closed
8 tasks

[Consensus] State Sync - Server to Advertise Blocks #409

jessicadaugherty opened this issue Dec 19, 2022 · 0 comments · Fixed by #431
Assignees
Labels
consensus Consensus specific changes

Comments

@jessicadaugherty
Copy link
Contributor

jessicadaugherty commented Dec 19, 2022

Objective

To sync to the blockchain, nodes need to be able to retrieve blocks from peers. These blocks must be advertised to peers to be validated and applied in chronological order against state data before participating in the network. In order to begin syncing, a sync server should be implemented to advertise blocks from peers for other peers to request.

Origin Document

V0 Client Side Challenge Mechanism

Goals

  • Build a sync server that advertises blocks from peers

Deliverable

  • Sync server that advertises its blocks and height for full sync (block 1)
  • Sync server that also provides requested blocks and height to peers

Non-goals / Non-deliverables

  • Implementation of block requests by the client
  • Implementation of block retrieval by the client

General issue deliverables

  • Update the appropriate CHANGELOG(s)
  • Update any relevant local/global README(s)
  • Update relevant source code tree explanations
  • Add or update any relevant or supporting mermaid diagrams

Testing Methodology

  • All tests: make test_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md

Creator: @jessicadaugherty

@jessicadaugherty jessicadaugherty added the consensus Consensus specific changes label Dec 19, 2022
@jessicadaugherty jessicadaugherty changed the title [Consensus] State Sync - Create Server to Advertise Blocks [Consensus] State Sync - Server to Advertise Blocks Dec 19, 2022
gokutheengineer added a commit that referenced this issue Feb 9, 2023
## Description

This PR aims to implement state sync server module.

## Issue

Fixes #409 

## Type of change

Please mark the relevant option(s):

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

## List of changes

<!-- REMOVE this comment block after following the instructions
 List out all the changes made
-->

-  Add `state_sync` submodule to Consensus Module
- Implement state sync server to advertise blocks and metadata
- Create new `state_snyc_handler.go` source file that handles
stateSyncMessages sent to the consensus module
- Write state sync server tests, update hotstuff test 
-  Add `ConsensusStateSync` interface to the shared module


## 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`

<!-- REMOVE this comment block after following the instructions
 If you added additional tests or infrastructure, describe it here.
 Bonus points for images and videos or gifs.
-->

## 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
- [ ] I have updated the corresponding README(s); local and/or global
- [X] I have added tests that prove my fix is effective or that my
feature works
- [ ] 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: 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.

2 participants