Closed rstormsf closed 6 years ago
:) 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:
My suggestion are
gasPrice
in both contracts HomeBridge
and ForeignBridge
;gasPrice
as part of deployment of contracts.This will be Phase I
Later in Phase II we will:
updateGasPrice
method in both contracts to set new gasPrice
with some consensus;updateGasPrice
periodically.@rstormsf if you agree let's change the label to solidity and modify the title to reflect the idea of the changing.
@rstormsf @igorbarinov did you discuss it? should we have a call together to discuss it?
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.
@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
@igorbarinov please check out this dashboard https://www.site24x7.com/public/dashboard/8s1wsTAc/g8Ipq0FBcZ91xw291jfLWVBkJ0jC5DLujR/xAyNIDrraYAkxnvoKUBHlauhy7dDGbQxteFTkHMOoiMhfYD63Eyzl6uNzRhBp6KHZIsTkfWPbhiydvLmPEfG
Nice, could we have outage number? duration? disk space also will be good to know
Pashi, nice dashboard! But gasprice oracle is out of sync 🙈😬
OK. Here is my suggestion:
gasPrice
in both contracts HomeBridge
and ForeignBridge
;HomeBridge
ForeignBridge
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.withdraw_relay
, gasPrice
of HomeBridge
will be requested.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)
Here is the recent requirements based on discussions:
[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
{"block_number":5559089,"block_time":14.824,"instant":50.0,"standard":4.0,"slow":2.0,"fast":5.0,"health":true}
default_gas_price
in [home]and
[foreign]` gas_price
from [transactions]
for deposit_relay
, withdraw_confirm
and withdraw_relay
.The logic is as follows:
gas_price_update_timeout
.default_gas_price
) is used for the corresponding network.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:
health: false
gas_price_oracle_url
has exceeded gas_price_update_timeout
?health: false
means the node is not fully synced and the numbers are off.
Ok, cool. Thanks!
As an example, ICO wizard makes an API call to https://gasprice.poa.network/, get the fastest or lowest(@igorbarinov ) IF service is not available, use hardcoded value. I'd recommend using
standard
value from https://gasprice.poa.network/Should be done on Rust side
https://gasprice.poa.network/
@akolotov please approve