Neo: [Oracles] Native Oracle Policy

Created on 25 Nov 2019  ·  8Comments  ·  Source: neo-project/neo

For the use of the Oracles we must contemplate a new native contract (or use the current one) that stores the oracle policy and the agreed values, such as authorized nodes, fee, protocols and active filters, blocked endpoints, ...

The idea is that all Oracle nodes share the same policy to obtain homogeneous behavior, but leaving the door open for Oracle node owners to specify a specific policy (for example of supported protocols).

It must be able to add and remove authorized nodes and other values.

This topic is closely linked to Oracle nodes election https://github.com/neo-project/neo/issues/1278

discussion oracles

All 8 comments

Can you list what needs to be included in the policy?

I believe Oracle Policy should be the same as Native Policy. Maybe a new class just to better organize, but the class could be initialized inside the Native Policy.
Initially, maybe something like that:

  • Get Available oracles services: Ex: [native, neofs, freeoracles, payedoraclesupperhighspeed, etc..]
  • Get Number of Registered ON of service: Ex: [10]
  • Register a new service...
  • Add a new ON to a service...
  • Get Service default threshold...
  • etc...

It's a good idea to use the same native contract, it would be a way to have all the network operating parameters in the same contract. But it is not strictly necessary.

Currently, we will need to save the authorized Oracle Nodes (current validators), Allowed Protocols/Filters and base cost of oracles use.

We can start with the implementation of the policy contract, this must include at least:

  • Current Oracles Nodes (read: all / write: consensus)
  • Number of oracles, how many Oracles can authorize a consensus node. (read: all / write: consensus majority)

The only question we have left before implementation is to decide if we prefer a new contract or include it in the current policy contract.

👍 Current policy contract.
👎 New oracle policy contract.

I begin to implement the code of OraclePolicy.
Currently I have written the following functions:

  1. Register as an Oracle Node
  2. Modify the Oracle node
  3. Get the currently authorized Oracle nodes
  4. Get the current number of authorized Oracle nodes

What else need to be added?
@belane

Great @doubiliu, that would be enough for now.
Just leave the door open to include other values ​​such as fee, timeouts, ... (if we finally include them in the policy contract).

Maybe we need add a DistributeFee function.We cannot guarantee that the costs will be divisible.Number of nodes is not fixed.

Also, we may need to consider the timeliness of Oracle nodes. We cannot guarantee that Oracle nodes will still be authorized when CN make consensus.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shargon picture shargon  ·  3Comments

igormcoelho picture igormcoelho  ·  4Comments

shargon picture shargon  ·  4Comments

lock9 picture lock9  ·  4Comments

borovik96 picture borovik96  ·  4Comments