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

Enable editing L2 gas on optimism #18217

Merged
merged 27 commits into from
Apr 26, 2023
Merged

Enable editing L2 gas on optimism #18217

merged 27 commits into from
Apr 26, 2023

Conversation

jpuri
Copy link
Contributor

@jpuri jpuri commented Mar 17, 2023

Fixes: #14735

@github-actions
Copy link
Contributor

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.

@metamaskbot
Copy link
Collaborator

Builds ready [a72f053]
Page Load Metrics (1597 ± 54 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint95143111147
domContentLoaded14531933157510952
load14741941159711254
domInteractive14531933157510952
Bundle size diffs
  • background: 0 bytes
  • ui: -519 bytes
  • common: 0 bytes

@metamaskbot
Copy link
Collaborator

Builds ready [b0be2e8]
Page Load Metrics (1714 ± 64 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint108154126147
domContentLoaded15181961169713163
load15181962171413464
domInteractive15181961169713163
Bundle size diffs
  • background: 0 bytes
  • ui: -519 bytes
  • common: 0 bytes

@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #18217 (0c12b15) into develop (f92e463) will decrease coverage by 1.13%.
The diff coverage is 78.57%.

❗ Current head 0c12b15 differs from pull request most recent head d51f446. Consider uploading reports for the commit d51f446 to get more accurate results

@@             Coverage Diff             @@
##           develop   #18217      +/-   ##
===========================================
- Coverage    65.15%   64.02%   -1.13%     
===========================================
  Files          936      914      -22     
  Lines        35965    35619     -346     
  Branches      9231     9032     -199     
===========================================
- Hits         23432    22804     -628     
- Misses       12533    12815     +282     
Impacted Files Coverage Δ
...ed-gas-controls/advanced-gas-controls.component.js 42.86% <ø> (-3.81%) ⬇️
...vanced-gas-inputs/advanced-gas-inputs.component.js 90.77% <ø> (+1.22%) ⬆️
...vanced-gas-inputs/advanced-gas-inputs.container.js 100.00% <ø> (ø)
.../pages/send/send-content/send-content.container.js 85.71% <ø> (ø)
ui/selectors/selectors.js 70.35% <ø> (-0.87%) ⬇️
.../multilayer-fee-message/multi-layer-fee-message.js 88.00% <66.67%> (+84.00%) ⬆️
...saction-base/confirm-transaction-base.component.js 50.00% <80.00%> (+1.24%) ⬆️
.../pages/send/send-content/send-content.component.js 97.37% <100.00%> (+0.07%) ⬆️

... and 227 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jpuri jpuri marked this pull request as ready for review March 20, 2023 04:16
@jpuri jpuri requested a review from a team as a code owner March 20, 2023 04:16
@jpuri jpuri requested a review from garrettbear March 20, 2023 04:16
@jpuri
Copy link
Contributor Author

jpuri commented Mar 20, 2023

@seaona : can you plz test optimism transactions on this PR.

@metamaskbot
Copy link
Collaborator

Builds ready [0c12b15]
Page Load Metrics (1741 ± 51 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint103143123105
domContentLoaded15381978171711354
load15381997174110651
domInteractive15381978171711354
Bundle size diffs
  • background: 0 bytes
  • ui: -519 bytes
  • common: 0 bytes

@jpuri jpuri requested review from NiranjanaBinoy and digiwand and removed request for garrettbear March 20, 2023 12:40
segun
segun previously approved these changes Mar 22, 2023
NiranjanaBinoy
NiranjanaBinoy previously approved these changes Apr 5, 2023
Copy link
Contributor

@NiranjanaBinoy NiranjanaBinoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -21,19 +21,21 @@ export default function MultilayerFeeMessage({
const [fetchedLayer1Total, setLayer1Total] = useState(null);

let layer1Total = 'unknown';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we're not using null or undefined here instead of the string unknown?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unknown is string displayed to the user is L1 gas estimates are not available:

Screenshot 2023-04-10 at 12 57 54 PM

I improved it to use internationalisation.

@jpuri jpuri added the needs-qa Label will automate into QA workspace label Apr 6, 2023
@seaona
Copy link
Contributor

seaona commented Apr 6, 2023

QA findings and comments:

  • Whenever I try to depoy a contract, I get an error Insufficient funds for gas. It seems that gas is not correctly calculated making the transaction always fail
optimism-insufficient-gas.mp4
  • Updating the gas on any dapp transaction, crashes MetaMask with the error
    Message: Invariant failed: A state mutation was detected between dispatches, in the path confirmTransaction.txData.simulationFails. This may cause incorrect behavior.
optimism-gas-update-crash.mp4
  • Approve ERC20 Custom screen displays the Layer 2 Gas Fees is always 0. For testing this you can go to this contract and click approve
approve-erc20-optimism.mp4
  • Layer 2 gas styling is different from Layer 1 gas styling. This happens to any dapp interaction. Seems Layer 2 should follow the same style as we have for Layer 1? @bschorchit

image

  • Whenever I set the gas limit lower than 21000 I get duplicated warnings/messages. I see a warning advising to set gas limit above 21000. This seems a recommendation, but at the same time, I see an input validation which errors and says value must be grater than 21000 and the button is disabled. Could we consolidate this messages so they are not duplicated/ indicating different things (one recommends, the other enforces)? No need to be in this PR, but something to consider. What do you think? @bschorchit @jpuri

image

  • Layer 2 gas fee does not display Fiat conversion. Should we also display it in the same way we do for Layer 1 fees and Total fields? @bschorchit

image

  • Whenever I deactivate the price checker, I still see the fiat conversion on the Send Confirmation screen. I think this is a pre-existing problem and can be solved separately
disable-fiat-conversion.mp4
optimism-failing-tx-gas-unknown.mp4

seaona
seaona previously requested changes Apr 6, 2023
Copy link
Contributor

@seaona seaona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the issues in my comment might need to be addressed in this PR and some we can open separate issues

@jpuri jpuri dismissed stale reviews from NiranjanaBinoy and segun via 35da64c April 6, 2023 14:57
@jpuri
Copy link
Contributor Author

jpuri commented Apr 6, 2023

Hello @seaona : I fixed these issues:

  1. display fiat value for L2 gas value
  2. Fix L2 on approval pages

But I am not able to replicate the errors reported above. Also, I could deploy contract successfully.

Screenshot 2023-04-06 at 5 09 53 PM

@jpuri
Copy link
Contributor Author

jpuri commented Apr 18, 2023

@seaona : thanks for the finding, I fixed the issue. There is a lot happening in develop simultaneously and updating the PR brings about more issues 😄

@metamaskbot
Copy link
Collaborator

Builds ready [edefce9]
Page Load Metrics (1528 ± 50 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint902951144622
domContentLoaded13181725150210349
load13341725152810550
domInteractive13181725150210350
Bundle size diffs
  • background: 0 bytes
  • ui: 2055 bytes
  • common: 0 bytes

@seaona
Copy link
Contributor

seaona commented Apr 18, 2023

@jpuri thank you for the fix!! Indeed there are a lot of changes that impact and it's a complex PR.
I see the above issue fixed. Unfortunately I found another issue, which happens whenever we trigger x2 transactions from a Dapp, the second one has default Layer 2 fees as 0.

Repro:

  1. Go to test dapp https://metamask.github.io/test-dapp/
  2. Click Send twice
  3. Navigate to the second trx
  4. See layer 2 fees are set to 0
optimism-fees-multiple-tx.webm

@jpuri
Copy link
Contributor Author

jpuri commented Apr 19, 2023

Hey @seaona : this seems to be issue in develop, may be related to recent gas fee display PR merged. The last transaction is showing 0 estimated gas even on goreli:

Screenshot 2023-04-19 at 10 27 33 AM

@metamaskbot
Copy link
Collaborator

Builds ready [6149836]
Page Load Metrics (1697 ± 53 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint97166125199
domContentLoaded15431968169310952
load15431968169711053
domInteractive15431968169310952
Bundle size diffs
  • background: 0 bytes
  • ui: 2055 bytes
  • common: 0 bytes

@seaona
Copy link
Contributor

seaona commented Apr 19, 2023

Great finding @jpuri ! I've opened a separate issue here [Bug]: Triggering a 2nd tx from a Dapp sets the gas Limit to 0

This PR looks good from QA 💯 great job!!

@metamaskbot
Copy link
Collaborator

Builds ready [78c766b]
Page Load Metrics (1683 ± 77 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint96162122189
domContentLoaded14432177166116479
load14432177168316077
domInteractive14432177166116479
Bundle size diffs
  • background: 0 bytes
  • ui: 2055 bytes
  • common: 0 bytes

danjm
danjm previously approved these changes Apr 21, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [91524fd]
Page Load Metrics (1732 ± 67 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint96161123157
domContentLoaded14462016170713665
load15312037173214067
domInteractive14462016170713665
Bundle size diffs
  • background: 0 bytes
  • ui: 2055 bytes
  • common: 0 bytes

@seaona seaona removed the needs-qa Label will automate into QA workspace label Apr 24, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [d51f446]
Page Load Metrics (1487 ± 44 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint90134105105
domContentLoaded1384169014667034
load1384177014879144
domInteractive1383169014667034
Bundle size diffs
  • background: 0 bytes
  • ui: 2275 bytes
  • common: 0 bytes

@jpuri jpuri requested review from danjm and segun April 25, 2023 07:28
Copy link
Contributor

@NiranjanaBinoy NiranjanaBinoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jpuri jpuri dismissed seaona’s stale review April 26, 2023 00:13

Change has been implemented.

@jpuri jpuri merged commit 82a6419 into develop Apr 26, 2023
@jpuri jpuri deleted the optimism_gas_editing_fix branch April 26, 2023 00:13
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2023
@danjm danjm added release-10.30.0 Issue or pull request that will be included in release 10.30.0 release-blocker This bug is blocking the next release labels May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-10.30.0 Issue or pull request that will be included in release 10.30.0 release-blocker This bug is blocking the next release team-confirmations-secure-ux-PR PRs from the confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-add ability to edit (L2) gas fee on Optimism transactions
8 participants