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

getGasPrice can return 0 #6505

Closed
goranjovic opened this issue Oct 24, 2018 · 31 comments
Closed

getGasPrice can return 0 #6505

goranjovic opened this issue Oct 24, 2018 · 31 comments

Comments

@goranjovic
Copy link
Contributor

goranjovic commented Oct 24, 2018

User Story

As a user I want useful default gas price settings on all networks when I send transactions.

Description

Type: Bug

Summary: For some reason, on xDAI chain getGasPrice sometimes gives 0 as the result (openethereum/parity-ethereum#9795). This means that the default gas price in Send Transaction screen is going to be 0 and unless user changes that value manually, that transaction is always going to fail.

We should include a sentinel value of 1 wei either in the enclosing wrapper function in status-react when the underlying web3 function gives a 0 result. (Or alternatively, change getGasPrice to include the same logic on the status-go side.

Issue was originally found in PR #6388 - point 6

Expected behavior

Default gas price is never 0.

Actual behavior

Default gas price is sometimes 0 on xDAI chain.

Reproduction

  • Switch to xDAI chain
  • Wallet > Send Transaction
  • Check default gas price
@goranjovic goranjovic self-assigned this Oct 31, 2018
@goranjovic
Copy link
Contributor Author

Tried this out in local and it doesn't look like a good idea any more. What happens is that if 0 is silently replaced by 1 wei, then the transaction is also going to fail (e.g. on xdai 1 gwei looks like a good gas cost at the moment), but the reason for it is obscured by the replacement.

@annadanchenko
Copy link

have same issue (default Gas price is 0 Gwei) on #7407

@StatusSceptre
Copy link
Member

This is particularly important for networks like xdai which don’t have an api to pull gas estimates

@pablanopete
Copy link
Contributor

pablanopete commented Feb 11, 2019

@goranjovic can we put a bounty on this? When trying to send XDAI or any other assets on the XDAI network I have to manually set a gas price. No Bueno. Maybe we either hardcode or implement an alternative that's better maybe with https://blockscout.com ?

LMK what you think.

BlockScout provides analytics data, API, and Smart Contract tools for the Ethereum Mainnet

@StatusSceptre
Copy link
Member

@goranjovic any thoughts here?

@StatusSceptre
Copy link
Member

@goranjovic do you still want a bounty for this?

@goranjovic
Copy link
Contributor Author

@StatusSceptre yes, let's do that. Size S seems appropriate

@StatusSceptre
Copy link
Member

k

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 80.0 DAI (80.0 USD @ $1.0/DAI) attached to it.

@gitcoinbot
Copy link

@ab320012 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@kuhnchris
Copy link

Hmm. As previously seen in the discussion - Price 1 sometimes causes problems aswell - is there any API we could query instead that would give us a "valid 24h gas price" for example, or just a wild guess in the range within the last 24-48h? We could also just set a default value of like... 3-5 gwei, and add a user setting to override a default whenever 0 is returned or the gas service is unreachable? Maybe add an alternative gas service somewhere in the settings aswell?
Else... you know... we can just set it to 1, which is at least more likely to success than 0...

... or do we have access to transaction history? If so, we could use the gas-gwei from the last transaction per default.

@janus
Copy link

janus commented May 28, 2019

Is this issue still open?

@StatusSceptre
Copy link
Member

@rachelhamlin wdyt? Not sure where this falls these days tbh.

@rachelhamlin
Copy link
Contributor

rachelhamlin commented May 28, 2019 via email

@StatusSceptre
Copy link
Member

ok @janus @kuhnchris feel free to apply on Gitcoin then - work is stopped, so you should be able to.

@kuhnchris
Copy link

I'll let @janus try for now, if he cannot manage to pull through I may aswell join in. ;-)

Thanks,
Chris

@janus
Copy link

janus commented Jun 18, 2019

@goranjovic Accept by expression if you still want this to be tackled

@rachelhamlin
Copy link
Contributor

Thanks @janus - sorry about the delay! @StatusSceptre can we approve @janus?

@krisc
Copy link

krisc commented Sep 25, 2019

What's up with this issue? I'd like to give it a shot if possible.

@gitcoinbot
Copy link

gitcoinbot commented Sep 25, 2019

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Workers have applied to start work.

These users each claimed they can complete the work by 10 months, 2 weeks ago.
Please review their action plans below:

1) krisc has applied to start work (Funders only: approve worker | reject worker).

Will begin by reproducing the unwanted behavior then modify the code to implement the expected behavior.
2) buicaocuong9595 has applied to start work (Funders only: approve worker | reject worker).

https://www.notion.so/Privacy-Policy-e7f23fb15ece4cf5b0586f9629e08b3f

Learn more on the Gitcoin Issue Details page.

@rachelhamlin
Copy link
Contributor

@krisc hey there! Thank you for applying. From my perspective, this is a rather low priority. What is it that interests you about this issue? We have a backlog of more pressing items & I might suggest that we scan that for a match for your skills, and create a new bounty for you instead. :)

@krisc
Copy link

krisc commented Sep 30, 2019

@rachelhamlin I just browsed through open bounties for Status in the Gitcoin explorer. I wanted to work on this one as a way to warm up to the Status codebase since haven't worked on Status for a couple months.

Is there a way for me to browse through issues by priority?

@janus
Copy link

janus commented Sep 30, 2019

@rachelhamlin

@krisc hey there! Thank you for applying. From my perspective, this is a rather low priority. What is it that interests you about this issue? We have a backlog of more pressing items & I might suggest that we scan that for a match for your skills, and create a new bounty for you instead. :)

Please I have free time and would like to get involved in your pressing items. Where is the list of pressing items?

@rachelhamlin
Copy link
Contributor

Hi there @krisc and @janus! Thanks for your patience. Here's a selection of our open v1 release blockers. Let me know if any are a match for your skills/interests and we can put a price on them?

#8998
#8951
#8940
#8930
#8877
#8718
#8662

@janus
Copy link

janus commented Oct 3, 2019

Hi there @krisc and @janus! Thanks for your patience. Here's a selection of our open v1 release blockers. Let me know if any are a match for your skills/interests and we can put a price on them?

#8998
#8951
#8940
#8930
#8877
#8718
#8662

I have some Clojure skill and a bit of go. But I am not greatly involved in React Native. I use only Android phones. You did not indicate the OS of interest.

@rachelhamlin
Copy link
Contributor

All issues in status-react are for iOS & Android, RN mobile @janus :)

We will manually test bounty PRs on multiple devices. Here's our quick start for getting set up: https://status.im/build_status/status_react_quickstart.html

@krisc
Copy link

krisc commented Oct 4, 2019

@rachelhamlin thanks for posting those issues. Can we chat in Status? Here's my contact code:
0x04825abbccf20caa211e1564dc566222278f3f08a5d0013f9277d643a8e10e52e48486248d432a31ce3832ce7eb51d44a62503e54f8088595310b28c0a2a3016c3

@goranjovic goranjovic removed their assignment Sep 16, 2020
@StatusSceptre
Copy link
Member

@churik I can't reproduce this issue, but it might still be relevant and important as some projects are moving to xdai.

cc @richard-ramos for any insight on how gas estimation might be handled on xDai

@churik
Copy link
Member

churik commented Sep 24, 2020

I can't reproduce it consitantly as well, I saw it few times in e2e when gas price was calculated on Ropsten.
It is very rare but happens.

@richard-ramos
Copy link
Member

Igor Barinov from POA/XDai says:

1 Gwei is a minimum accepted by validators from users. There are some applications working wit 0 Gwei gas price.
also, 1 Gwei is returned by default on eth_gasPrice request from RPCs supported by xDai team

so, probably returning 1 gwei as default for xdai if price is not available is the way to go?

@churik
Copy link
Member

churik commented May 4, 2021

Issue is not reproducible on release 1.13

@churik churik closed this as completed May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.