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

Node code architecture #30

Open
1 of 4 tasks
michielbdejong opened this issue Mar 15, 2024 · 0 comments
Open
1 of 4 tasks

Node code architecture #30

michielbdejong opened this issue Mar 15, 2024 · 0 comments

Comments

@michielbdejong
Copy link
Contributor

We need a number of components:

  • simnet, basically the MessageForwarder from strategy-pit. We assume nodes can send messages to neighbours, they may be delayed or (if so configured) dropped by the MessageForwarder, but if they arrive, then they arrive intact and (if so configured) in the same order. So imperfections to simulate:
    • delay
    • [~] reordering
    • [?] dropping
    • alteration
    • repetition
    • creation
  • HandRaiser - layer that sits in-between the agent and its sending/receiving of messages, making sure that:
    • the agent raises its hand before sending a message
    • the agent then waits for the other agent to give them the mike
    • no message is sent unless the agent has the mike
  • Observer - component that receives incoming messages and internal events, draws conclusions from those events and the current state, and generates the next state. It should implement the following rules:
    • a Probe or Trace comes in from a sender -> log this
    • a Probe or Trace is minted -> log this
    • a Probe or Trace is sent to a recipient -> log this
    • a Probe comes in that was never seen before -> raise a NewProbeArrival(probeId) event
    • a home-minted Probe comes in that was seen before but is virgin for this sender -> raise a ProofOfComms(sender, probeId, strong: true) event
    • a foreign-minted Probe comes in that was seen before but is virgin for this sender -> raise a ProofOfComms(sender, probeId, strong: false) event
    • a Trace comes in that was never seen before -> raise a NewTraceArrival(probeId, traceId) event
    • a home-minted Trace comes in -> raise a ProofOfTraceBack(probeId, traceId) event
    • a foreign-minted Trace comes in that was seen before -> raise a RepeatedTraceArrival(probeId, traceId) event
  • Strategy - component that processes events from the observer and can push MintFloodProbe(), MintPinProbe(recipient), MintTrace(probeId, recipient), ForwardProbe(probeId) ForwardTrace(probeId, traceId, recipient) actions onto the ActionQueue
    • for each NewProbeArrival(probeId), trigger Forward(probeId)
    • for each ProofOfComms(sender, probeId, strong: false), trigger MintPinProbe(sender)
    • for each ProofOfComms(sender, probeId, strong: true), trigger MintTrace(probeId, sender)
    • for each NewTraceArrival(probeId, traceId) if the Probe for that probeId has exactly 1 from, trigger ForwardTrace(probeId, traceId, probeFrom)
    • for each NewTraceArrival(probeId, traceId) if the Probe for that probeId has zero or 2 or more from, do nothing
    • for each ProofOfTraceBack(probeId, traceId), do nothing
    • for each RepeatedTraceArrival(probeId, traceId), do nothing
  • Actor that can read the state from the Observer and translate actions into words.
  • ActionQueue that processes QueueForAction events from the Strategy and Pop events from the HandRaiser/Actor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant