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

Metamask should give a setting for get gas price directly from node using JSONRPC #7263

Closed
helderjnpinto opened this issue Oct 8, 2019 · 10 comments

Comments

@helderjnpinto
Copy link

What problem are you trying to solve?
There is a bunch of blockchains based on ethereum, like Hyperledger Besu, this blockchains have own gas price and inclusive its possible define 0 as gas price.

Describe the solution you'd like
Metamask should be able when adding a new custom network define the eth_gasPrice if the source is from default metamask source or request to node.
In the Advanced configuration if this setting is defined should be permit 0 gas price.

Additional context
The JSON RPC is this.
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gasprice

If i have some time this week i will implement this if metamask team give-me a green light to this feature.

Thanks in advance.

@helderjnpinto helderjnpinto changed the title Metamask should give a setting for get gas price directly to node using JSONRPC Metamask should give a setting for get gas price directly from node using JSONRPC Oct 8, 2019
@d10r
Copy link

d10r commented Dec 23, 2019

How does Metamask currently determine the pre-set gas price for a transaction?

@helderjnpinto
Copy link
Author

i think this issue is not important :D !!!

@msuard
Copy link

msuard commented Feb 18, 2020

We are having the same issue plugging metamask into a different blockchain based on ethereum. It seems that gas price is fetched from https://ethgasstation.info/ which results in too low gas prices in our case. It would be useful to have the option to get it directly from the connected node via RPC.

@d10r
Copy link

d10r commented Feb 20, 2020

@helderjnpinto in your opening message you mentioned that you'd be able to implement this yourself.
I think you should just go forward and prepare a PR. This project seems to be open to PRs from the community, thus I see no reason to wait for some explicit permission to go forward.
I'd be happy to help testing a preliminary dev build with the change included if that's helpful.

@helderjnpinto
Copy link
Author

@d10r yes you maybe rigth, i will try get some time to do this PR.

@Gudahtt
Copy link
Member

Gudahtt commented Mar 11, 2020

We use https://ethgasstation.info/ for the suggested gas prices in the UI, but the default gas price is set using a price calculator that looks at the gas prices for the last 40 blocks. That calculator is here.

@helderjnpinto I just want to make sure I understand - does it sound like this gas price calculator based on recent blocks would work with the network you're using? Or would you still require it to use eth_gasPrice?

@helderjnpinto
Copy link
Author

@Gudahtt Hi, this calculator is great for PoW consensus, in "private" consortium blockchains like in our case, and many companies that use consensus algorithm like IBFT 2.0 Proof-of-Authority (PoA) in case of Hyperledger Besu its a blockchain based on ethereum protocol but the gasPrice is defined this private organization and is like a "fixed" value (can change, but it doesn't vary like gas ethereum mainnet). What i did in this PR #8160 is just configure on network tab one toggle option to get only gasPrice from JSONRPC by default is disabled using metamask logic, and on send transaction get this option in network setting and overwrite all logic of price calculator that metamask have maybe only needs a css ajustments i think.

@Gudahtt
Copy link
Member

Gudahtt commented Mar 13, 2020

I see, that makes sense. Thanks for explaining!

@Gudahtt
Copy link
Member

Gudahtt commented Jun 1, 2020

As of #8575, eth_gasPrice is used exclusively for the initial gas estimates of transactions suggested by dapps. We still use ethgasstation in our UI though, so that still needs to get disabled for non-mainnet networks.

@Gudahtt
Copy link
Member

Gudahtt commented Jan 7, 2021

Closing, as we now rely almost exclusively upon eth_gasPrice for custom networks.

The only exception to this is a bug, which is tracked here: #10003

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.

4 participants