Coder Social home page Coder Social logo

oracle-client's People

Contributors

alextes avatar ckoopmann avatar dependabot[bot] avatar konstantinzolotarev avatar

Stargazers

 avatar

Watchers

 avatar  avatar

oracle-client's Issues

Implement propper logging

Currently there are a few println! statements scattered in the code but no proper logging.
We should change that.

Add integration test pipeline

It'd be cool if we had a ci workflow that:

  1. Installs / builds gofer
  2. Runs oracle-server instance
  3. Runs / tests the oracle-client in integration with gofer and oracle-server

Finalize Message format and adjust implementation

Currently the messages have the following format:
PriceMessage = { value: u64 } with the price being represented as a fixed point number with 6 decimals of precision.

This is likely not the final format we want so we should decide on a message format including:

  1. Additional fields that we want to add (timestamp, slot number, validator public key)
  2. Additional types of messages ("price is within x% of certain value", "price is above certain value")
  3. Granularity of price data(especially if we want to efficiently bls-aggregate some of the messages mentioned in 2. we need a sufficiently coarse granualrity to ensure we have many messages with identical content)
  4. Signature scheme: What parts of each message are going to be signed (timestamp?, slot number ? ). Are certain parts of the messages going to be signed individually or everything together ?

Replace `SlotProvider` with a correct implementation

Currently as a "slot_provider" we use a placeholder implementation that executes the oracle code for every mined block as returned by a ws connection to an json rpc provider.

Instead it should probably trigger the price reporting at the beginning of each slot, before the block is mined.
Also it should trigger the oracle even if a slot is missed and no block mined for that slot.

Options for implementing this:

  1. Subscribing to a WS rpc method that has the corresponding cadence ( if it exists on any rpc / client method)
  2. Determining the next slot number using the system time
  3. Exposing an api endpoint that can be called from the outside to trigger each slots calculation
  4. Listening to respective messages on the p2p network that indicate a new slot has started

Containerize the application

We should add a Dockerfile that containerizes the application to make it easier to run.

In particular this Dockerfile should include installation of gofer and all required configuration.

Improve interfacing with `gofer`

Currently we interface with the gofer tool by executing a cli command from rust.
This is inefficient as well as brittle and probably should be changed.

One way to do it would be to call the json_rpc endpoint of the gofer agent service.
In this context we should also revisit the handling of gofer configuration / customization which is currently saved in config.hcl in the top level of this repo.

Improve Error handling

Currently there are way to many expect and unwrap calls in the code leading to panic / crash if anything goes wrong.

We should implement proper error handling that makes sure we recover from any recoverable error and enable transparent debugging.

Probably has some overlap with #5

Implement message_broadcaster

Currently for the message_broadcaster we only have a dummy placeholder that just prints the messages to stdout.

Instead we need an implementation that reports the messages to our server (or some p2p network in the future).

This Probably depends on finishing #3 first

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.