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

Question on error when running on polygon #23

Open
TatisLois opened this issue Jan 25, 2022 · 5 comments
Open

Question on error when running on polygon #23

TatisLois opened this issue Jan 25, 2022 · 5 comments

Comments

@TatisLois
Copy link

This is a great lib! I was wondering if this utility supports polygon mainnet?

When I import this library and use it to get suggestions for tx on polygon (as a provider) an error is throw with

node_modules/@rainbow-me/fee-suggestions/dist/index.js:133
                        throw new Error('Error: ema was undefined');

An example implementation

const provider = ethers.getDefaultProvider('https://polygon-mainnet.infura.io/v3/008a971363b748c7bdfb80bfe3df977e');
feeSuggestions.suggestFees(provider).then(console.log);

even stranger is that it works on the mumbai test net. Any clarity or support would be appreciated. Thank you

@cybercorey
Copy link

Hey mate, I believe this only work on the eth chain as it using EIP-1559 and the basefee math
I could be wrong tho!

@TatisLois
Copy link
Author

Hey mate, I believe this only work on the eth chain as it using EIP-1559 and the basefee math

I could be wrong tho!

Good point, I believe polygon is also on EIP-1559 now so I was hoping it would have worked all the same.

@kraikov
Copy link

kraikov commented Jun 23, 2022

Any workarounds? We have the same issue.

@welps
Copy link
Member

welps commented Nov 22, 2022

Hi,

I took a look to see if there was a quick win in this regard, but there are some barriers to using this for polygon. We currently don't have capacity to exhaustively test these changes since there is significant data analysis that needs to be done on retroactive data:

Immediate issues that would need to be fixed:

  • getOutlierBlocksToRemove currently has a hardcoded 5 gwei cutoff for priority fees which would need to be updated to use quantiles, median absolute deviation, or a more appropriate statistical function for outlier detection
  • suggestMaxPriorityFee looks at only the past ten blocks which does not work for polygon due to higher block production

@benjlevesque
Copy link

Hey,

any update on this? Why is there a hard-coded limit of 5 gwei?
Here is a reproduction code, with a block that has only rewards above 5 gwei

const provider = new providers.JsonRpcProvider("https://rpc.ankr.com/gnosis");
await suggestMaxPriorityFee(provider, "28704700");

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

No branches or pull requests

5 participants