Update the hardfork in the transaction common used to estimate L1 opt… #22997
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…imism fees to London, fixing display of Layer 1 optimsim fees
Description
The bug was that Layer 1 fees were not being displayed on the confirmation screen for transactions on Optimism.
This was because
estimatedL1Feeswas null, becausefetchEstimatedL1Feewas failing, becauseTransactionFactory.fromTxData(txParams, { common })inbuildUnserializedTransactionwas throwing an error, becausetxParamshas atype===2, but EIP-1559 transactions are not supported on the spurious dragon hardfork, which is what was being used in thecommonconfiguration of thatTransactionFactory.fromTxDatacall.This became a problem after https://github.com/MetaMask/core/pull/3817/files. That PR correctly fixed a bug which could result in the transaction type being removed from the
txMeta.txParamswhenaddTransactionin the tx controller was called. With that bug fix, there was now atypepresent on thetxParamsthat got passed to the aforementionedTransactionFactory.fromTxDatacall. Prior to that bug fix, there was notypeontxParamsat that point, the ethereumjs-tx TransactionFactory was treating these transactions as legacy transactions, and so was constructing a type 0 transaction, and the fact that the hardfork was spurious dragon was not a problemThis PR fixes the problem by updating the hardfork param used in the
commonconfiguration of thatTransactionFactory.fromTxDatacall. This should not have a functional effect, as this will cause no change in data and value of the tx passed to the smart contract to generate an fee estimate, except that this may result in more accurate L1 fee estimates (that is not certain though).Related issues
Fixes: #22945
Manual testing steps
Screenshots/Recordings
After
Pre-merge author checklist
Pre-merge reviewer checklist