Skip to content

[Peers] Tech Debt: Revisit InitialSyncState behavior and object relationships #708

Open
@julianknutsen

Description

@julianknutsen

The sync message generation and subsequent Peer state updates are done as a side effect of flushing the outbound queue.

This could use a cleaner design and is hard to test through the front door of the PeerManager.

Should the OutboundQueue be separated into a SocketDescriptorWriter object that handles the sync generation post-Init so it can be tested?

Should the Peer state updates that happen as a side-effect be replaced by turning InitSyncState into a real object that can be tested in isolation?

from @ariard
Just a side-note, but I think in the future we would like to move the sync status inside NetGraphMsgHandler. IMO this logic doesn't belong to the peer handler as it's already concerned with processing state.

It would be easier to implement more-agressive syncing logic like fetching valid node_announcement and start thinking with them.
#692 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions