Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goerli Gas Estimation Issue #360

Closed
0xSpuddy opened this issue Feb 23, 2023 · 8 comments
Closed

Goerli Gas Estimation Issue #360

0xSpuddy opened this issue Feb 23, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@0xSpuddy
Copy link
Collaborator

0xSpuddy commented Feb 23, 2023

In recent days, when Telliot calls submitValue on goerli, the transactions are frequently failing with Send transaction failed: ValueError({'code': -32000, 'message': 'replacement transaction underpriced'}). I believe this might be because we're using a mainnet gas station api to estimate the goerli gas, and the gas price on goerli can actually be higher than it is on mainnet sometimes.

start command: telliot report -a goerli6 -p YOLO -wp 10000 -qt eth-usd-spot

INFO    | telliot_feeds.reporters.tellor_flex | Estimated profit: $421.38
INFO    | telliot_feeds.reporters.tellor_flex | tip price: 452.25, gas costs: 30.874156250000002
INFO    | telliot_feeds.reporters.tellor_flex | Estimated percent profit: 1364.82%
INFO    | telliot_feeds.sources.price_aggregator | Running median on [1664.03, 1664.72, 1663.75, 1664.82]
INFO    | telliot_feeds.sources.price_aggregator | Feed Price: 1664.375 reported at time 2023-02-23 10:00:21.381446+00:00
INFO    | telliot_feeds.sources.price_aggregator | Number of sources used in aggregate: 4
DEBUG   | telliot_feeds.reporters.interval | IntervalReporter Encoded value: 00000000000000000000000000000000000000000000005a39d7d44368c58000
DEBUG   | telliot_feeds.reporters.interval | Sending submitValue transaction
ERROR   | telliot_feeds.reporters.interval | Send transaction failed: ValueError({'code': -32000, 'message': 'replacement transaction underpriced'})
INFO    | telliot_feeds.reporters.interval | Sleeping for 10000 seconds
INFO    | telliot_feeds.reporters.tellor_360 | Current Oracle stakeAmount: 100.0
INFO    | telliot_feeds.reporters.tellor_360 |
            STAKER INFO
            start date: 1674496020
            stake_balance: 10000.0
            locked_balance: 0
            last report: 1677131664
            reports count: 314

INFO    | telliot_feeds.reporters.interval | Current query: {"type":"SpotPrice","asset":"eth","currency":"usd"}
INFO    | telliot_feeds.sources.price_aggregator | Running median on [1641.86, 1641.8, 1639.66, 1643.09]
INFO    | telliot_feeds.sources.price_aggregator | Feed Price: 1641.83 reported at time 2023-02-23 12:47:05.104314+00:00
INFO    | telliot_feeds.sources.price_aggregator | Number of sources used in aggregate: 4
INFO    | telliot_feeds.sources.price_aggregator | Running median on [18.72, 18.68]
INFO    | telliot_feeds.sources.price_aggregator | Feed Price: 18.7 reported at time 2023-02-23 12:47:05.104602+00:00
INFO    | telliot_feeds.sources.price_aggregator | Number of sources used in aggregate: 2
INFO    | telliot_feeds.reporters.tellor_flex |
                tips: 40.32666666666666 TRB
                gas limit: 350000
                legacy gas price: 53

INFO    | telliot_feeds.reporters.tellor_flex | Estimated profit: $723.65
INFO    | telliot_feeds.reporters.tellor_flex | tip price: 754.11, gas costs: 30.4559465
INFO    | telliot_feeds.reporters.tellor_flex | Estimated percent profit: 2376.06%
INFO    | telliot_feeds.sources.price_aggregator | Running median on [1641.86, 1641.83, 1639.66, 1643.09]
INFO    | telliot_feeds.sources.price_aggregator | Feed Price: 1641.8449999999998 reported at time 2023-02-23 12:47:05.525731+00:00
INFO    | telliot_feeds.sources.price_aggregator | Number of sources used in aggregate: 4
DEBUG   | telliot_feeds.reporters.interval | IntervalReporter Encoded value: 000000000000000000000000000000000000000000000059012d30a1e3357267
DEBUG   | telliot_feeds.reporters.interval | Sending submitValue transaction
ERROR   | telliot_feeds.reporters.interval | Send transaction failed: ValueError({'code': -32000, 'message': 'replacement transaction underpriced'})
INFO    | telliot_feeds.reporters.interval | Sleeping for 10000 seconds
^CERROR   | telliot_core | Exception occurred in telliot-core app
ERROR   | telliot_core | <class 'asyncio.exceptions.CancelledError'>
ERROR   | telliot_core | 
@0xSpuddy 0xSpuddy added the bug Something isn't working label Feb 23, 2023
@oraclown
Copy link
Collaborator

@oraclown
Copy link
Collaborator

It returns this JSON, where apparently "result" is the gas price in wei:

{
   "jsonrpc":"2.0",
   "result":"0x7029fe63",
   "id":73
}

Would need to figure out how to convert to int. Maybe something like

int(bytes.fromhex(rps["result"]))

@oraclown
Copy link
Collaborator

Or maybe there's one w/o api key from here: https://explorer.bitquery.io/goerli/gas

@0xSpuddy
Copy link
Collaborator Author

Forgive me if I'm missing something here, but could we use a node / RPC call for gas prices estimation on some of these chains?

@akremstudy
Copy link
Collaborator

there is also this, https://api.owlracle.info/v3/goerli/gas, not sure how much we can rely on that api though, since we just started using but for gas price it doesn't seem to require an api key.

@akremstudy
Copy link
Collaborator

Forgive me if I'm missing something here, but could we use a node / RPC call for gas prices estimation on some of these chains?

Good question. I'm not sure why we don't use web3.eth.gas_price to get the price of gas. Was there a reason to go with other API's, @oraclown?

@oraclown
Copy link
Collaborator

oraclown commented Mar 1, 2023

Forgive me if I'm missing something here, but could we use a node / RPC call for gas prices estimation on some of these chains?

Good question. I'm not sure why we don't use web3.eth.gas_price to get the price of gas. Was there a reason to go with other API's, @oraclown?

Discussed on discord, but I think bc it was unreliable when I tested it. Happy to try again, or maybe I just never tried it..

@oraclown
Copy link
Collaborator

oraclown commented Mar 7, 2023

I think this can be closed bc of #364

@oraclown oraclown closed this as completed Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants