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

abi/bind: workaround for OpenEthereum missing eth_maxPriorityFeePerGas for Kovan #23484

Closed

Conversation

shoenseiwaso
Copy link
Contributor

Resolves #23479

go-ethereum as a JSON RPC client may be used to connect to Kovan via OpenEthereum nodes, which do not currently support eth_maxPriorityFeePerGas, used by ethclient.SuggestGasTipCap(). This is called in bind.transact() and we receive a "Method not found" error from OpenEthereum.

In this case, we fall back to the logic suggested in this comment and compute tip = eth_gasPrice - baseFee.

One question is whether we should try to match the error string or just try for it on any error.

Tested on Kovan on both Infura and Alchemy.

Side note that I recently learned OpenEthereum has been deprecated, although I'm sure Kovan will be around for a while. There are probably other nodes that will not implement eth_maxPriorityFeePerGas that would benefit from this. A longer term fix might be to consider something involving eth_feeHistory, although I had a hard time following the various threads around EIP-1559 and what the best approach for this would be. Certainly open to suggestions in this PR.

@rjl493456442
Copy link
Member

Originally eth_maxPriorityFeePerGas was a part of standard JSONPRC spec but was abandoned later. We should use feeHistory instead since it's expected to be implemented by all clients.

@shoenseiwaso
Copy link
Contributor Author

Originally eth_maxPriorityFeePerGas was a part of standard JSONPRC spec but was abandoned later. We should use feeHistory instead since it's expected to be implemented by all clients.

Ok great! I can update the PR to use this.

Do you have a link to how we might use eth_feeHistory instead? I looked around online but it was hard to figure out what the "right" way to do this was.

@ligi
Copy link
Member

ligi commented Aug 31, 2021

@zsfelfoldi did this: https://github.com/zsfelfoldi/feehistory - maybe this can be used here?

@shoenseiwaso
Copy link
Contributor Author

shoenseiwaso commented Sep 12, 2021

@zsfelfoldi did this: https://github.com/zsfelfoldi/feehistory - maybe this can be used here?

@zsfelfoldi would you consider relicensing this under the LGPL so we can look at it for go-ethereum? (I am not a software licensing expert, just being cautious...)

@MariusVanDerWijden
Copy link
Member

Since OpenEthereum is officially deprecated and is not able to sync mainnet anymore, I'll close this PR.
Erigon, Besu and Nethermind all implement eth_maxPriorityFeePerGas afaict

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 this pull request may close these issues.

transact() attempts to use unsupported eth_maxPriorityFeePerGas via JSON RPC on Kovan
5 participants