Title: Node Operators & Adapter Should Run Independently (Architecture Design)

Date: 2023-01-14

Status: Draft

Context

Original KlayOracle architecture & its problems

In KlayOracle’s original architecture, data feeds, oracle contracts, and nodes were tightly coupled. Node operators were required to set up data feeds and define adapters (a list of data feeds) directly within their nodes.

The challenge this brings up is that: (i) there is an additional cost & time responsibility on node operators to source and pay for data sources in order to run data feeds. (ii) in cases where they are unable to acquire enough data sources, CPU resources will be wasted due to a low number of data feeds, hence making the idea of running nodes unattractive.

It would be more difficult to achieve true scale and decentralization if one party (the node runner) is responsible for providing computational resources as well as paying for different APIs to use as off-chain data sources.

Deprecated Design of KlayOracle v0.0.1

Deprecated Design of KlayOracle v0.0.1

Decision

Summary of Proposed Solution

Our proposed architecture update focuses on one key theme — the separation of concerns in order to maximize the resources of each participant in the network. In the new KlayOracle, adapters have been renamed as Data Providers and will run independently from nodes.

What if Data Providers focus on sourcing data feeds and adding more over time, while node operators run as many data providers as are willing to use them, so far as their node(s) have the capacity to fulfill their requests?

<aside> 💡 In KlayOracle’s new architecture, data providers can now configure their respective data feeds and oracle contracts and subscribe to one or several verified nodes to fetch & compute these data based on the provider’s configuration.

They subscribe to these node runners by paying them a monthly fee to run the computations necessary to fetch data feeds and maintain their truthiness on-chain.

Data providers and nodes will communicate and exchange information via gRPC and Protocol Buffer.

</aside>

Data subscribers (smart contract, API services, Wallets) in turn subscribe to Data Providers in order to access on-chain data, by being whitelisted on the Oracle Contract deployed by the Data Provider.

Components of the new Architecture

The following section highlights how the main components of KlayOracle’s new architecture interact with each other.

Architechture KlayOracle V1.png

Nodes