pokt-network / pocket

Official implementation of the Pocket Network Protocol v1
https://pokt.network
MIT License
63 stars 33 forks source link

[SPIKE] State Sync Explorations w/ LibP2P and w/o the FSM #816

Open Olshansk opened 1 year ago

Olshansk commented 1 year ago

Objective

Simplify the architecture around state sync.

Origin Document

In #352, we added the first functional (but basic) implementation of state sync touching many different parts of the codebase.

FSM Dependencies

For example, fsm_handler in consensus is dependant on fsm.go to implement consensus/doc/PROTOCOL_STATE_SYNC.md, but the E2E codeflow is hard to follow.

There may be ways to encapsulate 100% of the logic in consensus/state_sync consensus/state_sync

Lack of P2P Dependencies Dependencies

The business logic for the state sync client and server requests is spread across different places and is dependent on the consensus.server_mode_enabled config and consensus/types/proto/state_sync.proto proto. As explained in the deliverable below, there might be a way to leverage libp2p gossip to simply an asynchronous process of requesting/receiving metadata & blocks over these channels.

Goals

Deliverable

Non-goals / Non-deliverables

General issue deliverables

Testing Methodology


Creator: @Olshansk Co-Owners: @bryanchriswhite