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

(Fix) Transaction underpriced #393

Closed
vbaranov opened this issue Dec 7, 2017 · 22 comments
Closed

(Fix) Transaction underpriced #393

vbaranov opened this issue Dec 7, 2017 · 22 comments
Assignees

Comments

@vbaranov
Copy link
Collaborator

vbaranov commented Dec 7, 2017

If you are reporting a problem with ICO Wizard, please include the following information:

Which network did you use? (Mainnet, Kovan, Rinkeby, etc.)

Mainnet

If you were able to create it, what is the URL of your crowdsale?

There is no crowdsale. Issue happens on the first transaction.

Do you have screenshots showing the problem?

image

Do you see errors in the dev console? If yes, please include a screenshot

(To open the dev console in Google Chrome, press F12, or go to View -> Developer -> Developer Tools, and open the Console tab)

No


@igorbarinov
Copy link
Member

Safe price is 50 Gwei now.. https://ethgasstation.info/

Can we get safe price by API and show an alert if safe price is > selected price?

@fvictorio
Copy link
Contributor

fvictorio commented Dec 7, 2017

Etherscan doesn't seem to have a public API to get that information. The endpoint they use does not support CORS, so I don't think we can use it.

I looked around for an alternative, but didn't find anything. If someone finds a public API for this, it should be an easy addition.

@fvictorio
Copy link
Contributor

@fernandomg found this https://etherscan.io/apis#proxy

The second to last method, eth_gasPrice, gives a result like this:

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

(That's 60000000000 in hex)

Maybe we can use that as the basis of the "slow, normal, fast" options for gas price. Say, 1.0x, 1.25x and 1.5x times the result of the current gas price?

@fvictorio
Copy link
Contributor

Btw, it has a limit of 5 requests per second for each token. If we make sure that only one request is done in the whole wizard, we should be good. But if a lot of users connect at the same time, or if a malicious user copies the token from the devtools and does a lot of requests, the token will be blocked and the app will stop working.

@igorbarinov
Copy link
Member

@igorbarinov
Copy link
Member

Franco, they released onchain oracle

Do you feel that you can integrate it with Wizard on main net? https://twitter.com/ethgasstation/status/938951134399647744

@igorbarinov
Copy link
Member

@igorbarinov
Copy link
Member

@fvictorio
Copy link
Contributor

ethgasstation/ethgasstation-adaptive-oracle

I tried to get that working but couldn't do it. I opened an issue in the repo about my problem, so I'll try later when they answer me.

I'm not sure how this would work, though. Would we be responsible to run the script and point it to some contract that holds the last gas price?

@igorbarinov
Copy link
Member

For the reference ethgasstation/ethgasstation-backend#4

We will host the oracle, will get information from it (onchain) to estimate a safe price.

@igorbarinov
Copy link
Member

@fvictorio what is our plan with deploying gas price oracle.. I think we need it for mainnet

@fvictorio
Copy link
Contributor

@igorbarinov, sorry, I just saw your message, I must have missed it in my inbox.

I'll give another chance to run it locally. I don't understand the 'onchain' part of this, though. Can we just use it as a sort of backend service, so that the ICO Wizard uses it to ask the gas price?

I'm not sure I understand how it would work onchain. Some sort of smart contract that just holds the gas price, and a setter function for the oracle to update it periodically?

@igorbarinov
Copy link
Member

The plan I thought about:

  • Wizard queries smart contract with gas price and use it as safe threshold
  • Gas oracle runs on a VM and updates gas price/ or we use deployed gas oracle. Should ask author of the product if he has it onchain with regular updates

@fvictorio
Copy link
Contributor

It would be awesome if there already is a contract we can query. I'm going to ask them.

@igorbarinov
Copy link
Member

@fvictorio they have a simpler oracle. Roman added a simple API and monitoring to it.
please try it in your local dev environment https://github.com/poanetwork/ethgasstation-gasPrice-estimate

results of API call will be parameters for gas estimates in the dapp. if API is not available we'll use only custom field and show an alert to the user

@fvictorio
Copy link
Contributor

Cool, I'll check it out.

@igorbarinov
Copy link
Member

@fvictorio please abandon the last link
the service was rewritten here https://github.com/banteg/gasprice

@fvictorio
Copy link
Contributor

I checked it but I wasn't able to make it work (see banteg/gasprice#1). I'll give it another try, using an Infura node.

@igorbarinov
Copy link
Member

I deployed it here https://gasprice.poa.network/
please use it for integration

@fvictorio
Copy link
Contributor

Awesome, thanks.

@fvictorio
Copy link
Contributor

Just for the record, that endpoint doesn't support CORS. That means that (I think) it will work on https://wizard.poa.network, but probably won't in https://wizard.oracles.org.

@igorbarinov
Copy link
Member

thank you for mentioning, added cors *
the chain is not fully synced but we can the oracle

@fernandomg fernandomg self-assigned this Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants