Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Add RadioOperator struct and refactor global variables #171

Merged
merged 1 commit into from
May 30, 2023

Conversation

hopeyen
Copy link
Collaborator

@hopeyen hopeyen commented May 29, 2023

Description

  • Creates a structure RadioOperator to track radio specific logics including radio config, persisted state, radio_msg_handler, control flow (program controller)
    • utilizes MPSC for sending radio message between threads
    • refactors attestation and operations functions, moving the ones accessing global variables to be part of RadioOperator
      • create_radio_message (unused atm, need to decouple from graphcast agent message_send)
      • gossip_poi
      • compare_poi
      • radio_msg_handler
    • Controller not used atm but instead creating and using the Intervals directly in run, due to trouble with control flows
    • Next step is to refactor the ones that make sense to be part of RadioOperator or other new structs; they require more work and time, but might not be the core of this refactor
  • Updates Radio config
    • metrics and http services now has the default host of 0.0.0.0
    • adds smart default and getter traits
    • creates and utilizes the refactored CallBook struct with radio specific extension trait
  • Updates Persisted state
    • methods to read a snapshot and updating fields underneath Arc Mutex
    • local attestation folded into a Arc std::sync::Mutex with preference to synchronous over async updates, and to be more consistency with remote_messages
  • Refactored Http server context for the new Persisted state struct
    • Next we can utilize MPSC for metrics tracking

Issue link (if applicable)

#159

Checklist

  • Are tests up-to-date with the new changes?
  • Are docs up-to-date with the new changes? (Open PR on docs repo if necessary)

@hopeyen hopeyen force-pushed the hope/radio-operator-struct branch 2 times, most recently from fb03326 to 4256321 Compare May 29, 2023 19:26
@hopeyen hopeyen self-assigned this May 29, 2023
@hopeyen hopeyen added the refactor Changes not visible to users label May 29, 2023
@hopeyen hopeyen added this to the 0.3.0 milestone May 29, 2023
@hopeyen hopeyen force-pushed the hope/radio-operator-struct branch from 4256321 to 5a02fa2 Compare May 30, 2023 16:34
@hopeyen hopeyen requested a review from petkodes May 30, 2023 16:34
@hopeyen hopeyen merged commit a603abe into dev May 30, 2023
6 checks passed
@hopeyen hopeyen deleted the hope/radio-operator-struct branch May 30, 2023 17:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
refactor Changes not visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants