-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
[FeeHistory] Allow test chains with few blocks #699
Conversation
Hi @peak3d, thanks for this PR. The changes you're suggesting make sense. Would you be willing to update the corresponding tests? |
done |
33e489f
to
1a34ad3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@peak3d Apologies — do you mind rebasing this again? I will make sure to get this in today. |
@peak3d we'll be cutting a release within the next hour, and it would be great to have your work included. In the future, we recommend allowing edits from maintainers so that we can rebase / update your PRs. |
I selected "Update" instead "rebase", hope this is still Ok ?? If not let me know, then I'll have to fix it Edit: Sorry, forced pushed to get rid of the "merge main" commit - but this eliminates your "stale review status" :-( |
@peak3d Okay, the other PR is merged, feel free to rebase this! |
The (gas)controller requests 20.000 long range results when opening the FeeMarket. New chains / test chains normally don't have that amount of blocks, and in this case the controller requests feeHistory with a wrong hex value (0x-4756) which pollutes the node logs. Beside this such a chain can return fewer results than requested, the current code doesn't handle this case correctly when analyzing feeHistory results. This leads to fallback to eth_gas mode. FIXED: (Gas)Controller does not detect FeeMarket mode for test chains, even the chain supports EIP1559.
The (gas)controller requests 20.000 long range results when opening the FeeMarket. New chains / test chains normally don't have that amount of blocks, and in this case the controller requests feeHistory with a wrong hex value (0x-4756) which pollutes the node logs. Beside this such a chain can return fewer results than requested, the current code doesn't handle this case correctly when analyzing feeHistory results. This leads to fallback to eth_gas mode. FIXED: (Gas)Controller does not detect FeeMarket mode for test chains, even the chain supports EIP1559.
The (gas)controller requests 20.000 long range results when opening the FeeMarket. New chains / test chains normally don't have that amount of blocks, and in this case the controller requests feeHistory with a wrong hex value (0x-4756) which pollutes the node logs. Beside this such a chain can return fewer results than requested, the current code doesn't handle this case correctly when analyzing feeHistory results. This leads to fallback to eth_gas mode. FIXED: (Gas)Controller does not detect FeeMarket mode for test chains, even the chain supports EIP1559.
Allow FeeHistory queries for (test) chains with only few blocks
Description
The (gas)controller requests 20.000 long range results when opening the FeeMarket.
New chains / test chains normally don't have that amount of blocks, and in this case the controller requests feeHistory with a wrong hex value (0x-4756) which pollutes the node logs.
Beside this such a chain can return fewer results than requested, the current code doesn't handle this case correctly when analyzing feeHistory results. This leads to fallback to eth_gas mode.
(Gas)Controller does not detect FeeMarket mode for test chains, even the chain supports EIP1559.
Checklist
Note
I tracked the traffic send from Metamask to a node, and I asked myself if it is really required to request 20.000 blocks.
Maybe this value can be exposed, and MM extension can set something lower. I doubt that for a wallet functionallity 20.000 blocks is required. Node owner (Infura) will maybe thank you for reducing.
From node owners POV I would prefer max of 1024 bacause this is the comon cashe size. Requesting more invalidates the cache.