-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Ensure that eth_estimateGas is called to estimate gas limit for simple sends on custom networks #11418
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…e sends on custom networks
cce7d84
to
972a46a
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.
looks good to me, minor fix that should fix e2e
ui/selectors/selectors.js
Outdated
@@ -376,6 +376,10 @@ export function getIsTestnet(state) { | |||
return TEST_CHAINS.includes(chainId); | |||
} | |||
|
|||
export function getIsNonStandardEthChain(state) { | |||
return !(getIsMainnet(state) || getIsTestnet(state)); |
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.
you should probably return false if IN_TEST to match some of our other logic to treat ganache as mainnet in tests.
Builds ready [5fafef1]
Page Load Metrics (523 ± 53 ms)
|
); | ||
} | ||
|
||
const bufferMultiplier = isSimpleSendOnNonStandardNetwork ? 1 : 1.5; |
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.
Would it be possible to add a comment explaining the variance in the bufferMultiplier?
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.
@adonesky1 added in the latest commit
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! Code looks great and functions as described!
Builds ready [be48eda]
Page Load Metrics (680 ± 57 ms)
|
This PR updates our gas estimation logic so that if we are doing a simple send on a network that is not one of the default/standard networks in metamask (e.g. eth mainnet, or the test networks supported by infura), then we set the gas estimate to the result of calling
eth_gasEstimate
This will enable custom networks to set gas prices for simple sends that are different than
21000