Git Product home page Git Product logo

Comments (13)

banteg avatar banteg commented on July 20, 2024 2

health: false means the node is not fully synced and the numbers are off.

from poa-bridge.

akolotov avatar akolotov commented on July 20, 2024

:) it was in my todo of issues to create for the projects.

Since personally I don't like the idea of yet another service to be requested, I thought about an oracle which will put gas price into the bridge contract. My rationales are:

  • we need two different prices: one for POA and another for Foundation;
  • we are tying with POA in the core of the bridge without strict necessity.

My suggestion are

  1. create public fields gasPrice in both contracts HomeBridge and ForeignBridge;
  2. initialize gasPrice as part of deployment of contracts.

This will be Phase I

Later in Phase II we will:

  1. provide updateGasPrice method in both contracts to set new gasPrice with some consensus;
  2. develop a tool or the bridge subsystem which will call updateGasPrice periodically.

@rstormsf if you agree let's change the label to solidity and modify the title to reflect the idea of the changing.

from poa-bridge.

akolotov avatar akolotov commented on July 20, 2024

@rstormsf @igorbarinov did you discuss it? should we have a call together to discuss it?

from poa-bridge.

igorbarinov avatar igorbarinov commented on July 20, 2024

We have gasprice.poa.network on support and monitoring. It's as good as a supported onchain oracle. I'd like to stick with it with an option to hardcode gasprice if that host is not available. I suggest having 21Gwei as a hardcoded parameter.

from poa-bridge.

igorbarinov avatar igorbarinov commented on July 20, 2024

@phahulin could you create a public dashboard in site24x7 for gasprice oracle
for host health and API health

@banteg thank you for the code https://github.com/banteg/gasprice

from poa-bridge.

phahulin avatar phahulin commented on July 20, 2024

@igorbarinov please check out this dashboard https://www.site24x7.com/public/dashboard/8s1wsTAc/g8Ipq0FBcZ91xw291jfLWVBkJ0jC5DLujR/xAyNIDrraYAkxnvoKUBHlauhy7dDGbQxteFTkHMOoiMhfYD63Eyzl6uNzRhBp6KHZIsTkfWPbhiydvLmPEfG

from poa-bridge.

igorbarinov avatar igorbarinov commented on July 20, 2024

Nice, could we have outage number? duration?
disk space also will be good to know

from poa-bridge.

igorbarinov avatar igorbarinov commented on July 20, 2024

Pashi, nice dashboard! But gasprice oracle is out of sync 🙈😬

  • please add logging for gasprice and parity service
  • add corresponding checks on log files

from poa-bridge.

akolotov avatar akolotov commented on July 20, 2024

OK. Here is my suggestion:

  1. we introduce public fields gasPrice in both contracts HomeBridge and ForeignBridge;
  2. gasPrice will be initialized as part of deployment of contracts:
    • it equals 1 gwei in HomeBridge
    • it equals 21 gwei in ForeignBridge
  3. In order to perform deposit_relay or withdraw_confirm the bridge will request http://gasprice.poa.network and if it is not available gasPrice of ForeignBridge will be requested.
  4. In order to perform withdraw_relay, gasPrice of HomeBridge will be requested.

from poa-bridge.

rstormsf avatar rstormsf commented on July 20, 2024

Bridge should read from config.toml

gas_price_oracle_url = "https://gasprice.poa.network/"
gas_price_speed_type = "fast"

and receive this value in gwei, convert to hex value in wei for signing tx on foreign.
this value could be cached only for short period of time ( 5-10min)

from poa-bridge.

akolotov avatar akolotov commented on July 20, 2024

Here is the recent requirements based on discussions:

  1. We do provide options in [home] and [foreign] of configuration file to allow configure a JSON source of gas price:
gas_price_oracle_url = "https://gasprice.poa.network/"
gas_price_speed_type = "fast"
gas_price_update_timeout = 600
  1. We expect that the gas price oracle will return information in the following form:
    {"block_number":5559089,"block_time":14.824,"instant":50.0,"standard":4.0,"slow":2.0,"fast":5.0,"health":true}
  2. We add the parameter default_gas_price in [home]and[foreign]`
  3. We remove gas_price from [transactions] for deposit_relay, withdraw_confirm and withdraw_relay.

The logic is as follows:

  1. Try to get gas price from the oracle for the corresponding network. It needs to be done on regular basis with usage of gas_price_update_timeout.
  2. If the oracle is not accessible or returns incorrect information, the default gas price (default_gas_price) is used for the corresponding network.

from poa-bridge.

DrPeterVanNostrand avatar DrPeterVanNostrand commented on July 20, 2024

In the JSON returned from GET https://gasprice.poa.network:

{
  "block_number": 5584026,
  "block_time": 14.307,
  "instant": 41,
  "standard": 5,
  "slow": 4,
  "fast": 6,
  "health": true
}

does anyone know what does the "health" key-value pair means? Does health: true indicate that the gas prices values returned from the API are trustworthy, while health: false indicates otherwise? If that is the case, then we should use the default gas price in the cases of:

  1. health: false
  2. request duration to gas_price_oracle_url has exceeded gas_price_update_timeout?

from poa-bridge.

DrPeterVanNostrand avatar DrPeterVanNostrand commented on July 20, 2024

Ok, cool. Thanks!

from poa-bridge.

Related Issues (20)

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.