-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
[GasController] Check for undefined basefeePerGas #703
Conversation
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.
Good catch! I tried to read the geth source code when implementing this file but I obviously didn't see this. Makes total sense though. Would you be willing to add tests for this?
done |
Looks like this is out of date, would you mind rebasing? Thanks. |
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. |
NP, but I guess I'll have to rebase one of my two commits depending which one you merge first because they affect the same file..... |
go-ethereum based chains never return empty baseFeePerGas because this is omitted in the serializer: ``` type feeHistoryResult struct { OldestBlock *hexutil.Big `json:"oldestBlock"` Reward [][]*hexutil.Big `json:"reward,omitempty"` BaseFee []*hexutil.Big `json:"baseFeePerGas,omitempty"` <--- GasUsedRatio []float64 `json:"gasUsedRatio"` } ``` Current code checks for baseFeePerGas.length > 0 without checking for the occurence of this element. This leads to an exception and in later flow to fallback to eth_gasPrice mode FIXED: no feeMarket mode available in case one of past requests return no results
go-ethereum based chains never return empty baseFeePerGas because this is omitted in the serializer: ``` type feeHistoryResult struct { OldestBlock *hexutil.Big `json:"oldestBlock"` Reward [][]*hexutil.Big `json:"reward,omitempty"` BaseFee []*hexutil.Big `json:"baseFeePerGas,omitempty"` <--- GasUsedRatio []float64 `json:"gasUsedRatio"` } ``` Current code checks for baseFeePerGas.length > 0 without checking for the occurence of this element. This leads to an exception and in later flow to fallback to eth_gasPrice mode FIXED: no feeMarket mode available in case one of past requests return no results
go-ethereum based chains never return empty baseFeePerGas because this is omitted in the serializer: ``` type feeHistoryResult struct { OldestBlock *hexutil.Big `json:"oldestBlock"` Reward [][]*hexutil.Big `json:"reward,omitempty"` BaseFee []*hexutil.Big `json:"baseFeePerGas,omitempty"` <--- GasUsedRatio []float64 `json:"gasUsedRatio"` } ``` Current code checks for baseFeePerGas.length > 0 without checking for the occurence of this element. This leads to an exception and in later flow to fallback to eth_gasPrice mode FIXED: no feeMarket mode available in case one of past requests return no results
PR Title
GasController: Don't fall back to eth_gasPrice if node returns empty fee history
Description
go-ethereum based chains never return empty baseFeePerGas because this is omitted in the serializer:
Current code checks for
baseFeePerGas.length > 0
without checking for the occurence of this element.This leads to an exception and in later flow to fallback to eth_gasPrice mode
no feeMarket mode available in case one of past requests return no results
Checklist
Issue