farcaster-node icon indicating copy to clipboard operation
farcaster-node copied to clipboard

Swap event processor: Msg and Clt buses (excluding syncer)

Open zkao opened this issue 3 years ago • 2 comments

Messages received by the service buses in runtime.rs are now processed in process_msgs.rs

Events are created (event.rs). They contain the machinery for replying, forwarding, sending msgs etc, in a more abstracted manner with a nice API (barelly used so far, not to modify behavior as of yet)

There are predicates in swap_state.rs that inputs Events + State + SyncerState + Pending requests etc, and compute the variant of the Awaiting enum that encodes abstractly a valid state where some response from the daemon can be elicited. Thus each variant represents an overall state in which that event can elicit a response.

This PR completes all the message processing in the Msg bus and particially for the Ctl bus (Syncer messages missing)

The code moved from runtime.rs to process_msgs.rs was largely unchanged except when needed.

Because of the large code move, I signed the commits

zkao avatar Aug 18 '22 18:08 zkao

@TheCharlatan can you please let us know what still needs to be changed on this PR? And how we can proceed in getting it on main?

zkao avatar Aug 23 '22 08:08 zkao

@TheCharlatan can you please let us know what still needs to be changed on this PR? And how we can proceed in getting it on main?

I'll look through it again now.

sedited avatar Aug 23 '22 09:08 sedited

The swap state has been refactored into a state machine independent of this PR, so closing this.

sedited avatar Dec 14 '22 20:12 sedited