masa-finance / masa-oracle

Masa Oracle: Decentralized Data Protocol 🌐
https://developers.masa.ai/docs/masa-protocol/welcome
MIT License
25 stars 19 forks source link

feat: move `nodeData` to the ledger #518

Open mudler opened 3 months ago

mudler commented 3 months ago

Problem

Currently the nodeData is stored into the node's DHT which is transient and not guaranteed to always be accessible.

Proposed solution

As now we have a ledger implementation ( #380 ) we want to re-use that to store the nodeData information about the nodes instead of using DHT to make sure the data is consistently available to all nodes ( especially relevant in sight of #496 )

Acceptance criteria

mudler commented 3 months ago

From an initial investigation on the current state of the code:


also, on a side node for the blockchain work - looks like even if it's a struct that is subscribed ( https://github.com/masa-finance/masa-oracle/blob/6dae3fe5c4aca9b6a1540b89a3399da34f84f87b/pkg/subscriptions.go#L19 ) , there is a single channel for the blockchain which is package-scoped: https://github.com/masa-finance/masa-oracle/blob/6dae3fe5c4aca9b6a1540b89a3399da34f84f87b/pkg/oracle_node.go#L345 so it is acting actually as a singleton