Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Feature: allow editing EIP-1559 max priority fee + refactor tx modals #3297

Merged
merged 39 commits into from
Jan 26, 2022

Conversation

katspaugh
Copy link
Member

@katspaugh katspaugh commented Jan 13, 2022

What it solves

Resolves #3185

How this PR fixes it

  • Adds an editable Max Prio field in the "editable tx params" component, and passes it to the wallet. Defaults to 2.5 GWei.
  • Refactored tx modals to not repeat this logic in each of the 20ish modals

How to test it

Affected modals

Issues Found:

No new tickets, just listing the comments with the reported issues. All the issues apply to rinkeby, xdai, eth

issues tested and fixed

  • Wrong type of tx show when executing a tx (fixed)
  • Warning message when unchecking the "execute now" checkbox
  • Policies allow to set the same policies already present
  • Tx in policies execute even when the "Execute tx" checkbox is not checked

Safes used so far:
rin:0x9913B9180C20C6b0F21B6480c84422F6ebc4B808
rin:0x51c125bb0D2FB3394129e4AAa97BbF91e737d9b2
rin:0xFfDC1BcdeC18b1196e7FA04246295DE3A17972Ac
rin:0x37A53791b3667c803318D083D339C236781D57D1
gno:0xB8d760a90a5ed54D3c2b3EFC231277e99188642A

@katspaugh katspaugh marked this pull request as draft January 13, 2022 10:15
@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Jan 13, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 1 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@coveralls
Copy link

coveralls commented Jan 13, 2022

Pull Request Test Coverage Report for Build 1744348605

  • 55 of 148 (37.16%) changed or added relevant lines in 31 files are covered.
  • 16 unchanged lines in 12 files lost coverage.
  • Overall coverage increased (+1.3%) to 33.635%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/logic/safe/store/actions/createTransaction.ts 0 1 0.0%
src/routes/CreateSafePage/components/SafeCreationProcess.tsx 0 1 0.0%
src/routes/safe/components/Settings/Advanced/RemoveModuleModal.tsx 0 1 0.0%
src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.tsx 0 1 0.0%
src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/index.tsx 0 1 0.0%
src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.tsx 0 1 0.0%
src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/index.tsx 0 1 0.0%
src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.tsx 0 1 0.0%
src/routes/safe/components/Settings/SpendingLimit/RemoveLimitModal.tsx 0 1 0.0%
src/routes/safe/components/Settings/UpdateSafeModal/index.tsx 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
src/components/TransactionsFees/index.tsx 1 75.0%
src/logic/hooks/useEstimateTransactionGas.tsx 1 20.54%
src/routes/CreateSafePage/components/SafeCreationProcess.tsx 1 4.76%
src/routes/safe/components/Apps/components/SignMessageModal/ReviewMessage.tsx 1 76.19%
src/routes/safe/components/Settings/Advanced/RemoveGuardModal.tsx 1 70.0%
src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/index.tsx 1 0%
src/routes/safe/components/Transactions/helpers/EditTxParametersForm/index.tsx 1 18.52%
src/routes/safe/components/Transactions/TxList/modals/ApproveTxModal.tsx 1 2.69%
src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/Review/index.tsx 2 0%
src/routes/safe/components/Settings/SpendingLimit/RemoveLimitModal.tsx 2 0%
Totals Coverage Status
Change from base Build 1740925373: 1.3%
Covered Lines: 3178
Relevant Lines: 8459

💛 - Coveralls

@github-actions
Copy link

Deployment links

🟠 Safe Rinkeby Safe Mainnet 🟣 Safe Polygon 🟡 Safe BSC Safe Arbitrum 🟢 Safe xDai

@github-actions
Copy link

github-actions bot commented Jan 13, 2022

E2E Tests Failed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1744373500

Failed tests:

  • ❌ Address book Address book
  • ❌ Safe Apps List Safe Apps List
  • ❌ Read-only transaction creation and review Read-only transaction creation and review

Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

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

Looking good guys but your recent push didn't let me complete my review. I will continue now.

Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

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

Looking good boys!

@francovenica
Copy link
Contributor

This PR still has the issue of the wrong type of tx signature being shown:

Updated to the latest code, it should be good now.

Yes, is fixed now. Thanks

@francovenica
Copy link
Contributor

In the "change policies" modal, in a safe 1/x, unchecking the "Execute tx" checkbox does nothing, the tx executes no matter what (you cannot queue this tx)
See in this gif how the checkbox is un marked as the tx is submitted, but the MM pop up is a onchain type of tx. submitting that executes the tx.
01-22-2022_x(4033)

@francovenica
Copy link
Contributor

francovenica commented Jan 24, 2022

Ignore this. The field is shown for trezor and ledger as well in rinkeby
Question: For trezor, it seems that Trezor T should be able to support EIP1559 according to this
I don't have a trezor T to check if it works, but assuming it doesn't, should we deal with it separately right?

@DiogoSoaress
Copy link
Member

@gnosis/safe-web By unifying the modals we are displaying in every modal the option to “Execute Transaction”. However, this option is not available in all the PROD modals, for example it does not exist in the Safe owner management ones (add owner, ...).
Shall we keep the same UX and not enable these transaction types to delay execution or should we enable the option to delay execution in all the modals?

@katspaugh
Copy link
Member Author

All modals should behave the same wrt execution/gas info.

@katspaugh
Copy link
Member Author

katspaugh commented Jan 24, 2022

It looks like delayExection isn't passed to createTransaction.

It should be passed like this.

@DiogoSoaress please check that all the modals are passing it.

@DiogoSoaress
Copy link
Member

It looks like delayExection isn't passed to createTransaction.

It should be passed like this.

@DiogoSoaress please check that all the modals are passing it.

@katspaugh Please review the last commit. Addresses all the modals that didn't have the flag in the onSubmit callback

@katspaugh
Copy link
Member Author

Perfect, thank you 👍

@DiogoSoaress
Copy link
Member

DiogoSoaress commented Jan 24, 2022

This bug is already present in DEV. I've created a new issue for it #3358 .

@iamacook
Copy link
Member

This bug is already present in DEV. I've created a new issue for it #3358 .

Probably makese sense to include it in the reafctor of the approval window, no?

@DiogoSoaress
Copy link
Member

DiogoSoaress commented Jan 24, 2022

I say we should fix it in the current sprint @johannesmoormann

I've created a separate bug for it as it is already in dev and thus not tightly related with this PR

@iamacook
Copy link
Member

I've created a separate bug for it as it is already in dev and thus not tightly related with this PR

Are you not refactoring the approval modals in the sprint as well?

@katspaugh
Copy link
Member Author

katspaugh commented Jan 24, 2022

Warning message when unchecking the "execute now" checkbox
Gas price/gas limit is set to default values when unchecking the "execute now" tx

This'll be fixed in #3363.

…3363)

* fix: Dont estimate gas in ApproveTxModal if checkbox is not checked

* fix: revert to using custom hook for canTxExecute

* fix: Remove local state from useCanTxExecute custom hook
@DiogoSoaress
Copy link
Member

@francovenica this issue #2935 is solved by this PR 🎉

@francovenica
Copy link
Contributor

All these issues have been fix so far
Wrong type of tx show when executing a tx (fixed)
Warning message when unchecking the "execute now" checkbox
Policies allow to set the same policies already present
Tx in policies execute even when the "Execute tx" checkbox is not checked

New issue:

The max priority fee can be left empty. MM still receives the default value of 2.5 if this happens
The max priority fee has an error message that is too long when a value <0 is set. The problem is that the error message won't allow the user to click the field to correct the value (unless it clicks almost at end bottom of the input)
image
01-25-2022_x(4032)

@DiogoSoaress
Copy link
Member

Hey @francovenica , regarding your last comments:

The max priority fee can be left empty. MM still receives the default value of 2.5 if this happens

We are sending 2.5 as the default value. I will add this information to the PR description.

The max priority fee has an error message that is too long when a value <0 is set. The problem is that the error message won't allow the user to click the field to correct the value (unless it clicks almost at end bottom of the input)

This issue occurs in all the other modal inputs. I suggest to open a ticket to address it.

@usame-algan usame-algan mentioned this pull request Jan 26, 2022
18 tasks
@DiogoSoaress DiogoSoaress merged commit f1c0c49 into dev Jan 26, 2022
@DiogoSoaress DiogoSoaress deleted the max-fee branch January 26, 2022 10:15
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic gas price settings based on network (EIP-1559) for transaction execution
6 participants