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

Chore: don't use safeTxGas on Safes >=1.3.0 #3052

Merged
merged 1 commit into from
Nov 24, 2021
Merged

Chore: don't use safeTxGas on Safes >=1.3.0 #3052

merged 1 commit into from
Nov 24, 2021

Conversation

katspaugh
Copy link
Member

@katspaugh katspaugh commented Nov 23, 2021

What it solves

Resolves #2878

How this PR fixes it

I've added a new versioned "feature", FEATURES.SAFE_TX_GAS_OPTIONAL.
If we detect a 1.3.0 Safe, don't request safeTxGas from backend, and don't show it in the UI.

NB: when we migrate to the /chains endpoint, the FEATURES logic will have to be refactored.

How to test it

  • Make a tx on a 1.3.0 Safe
  • Make a tx on a 1.1.1 Safe

Screenshots

Look ma, no safeTxGas!

Screenshot 2021-11-23 at 18 05 04

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

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 5 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1495843146

  • 8 of 13 (61.54%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 31.933%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/logic/hooks/useEstimateTransactionGas.tsx 0 1 0.0%
src/logic/safe/store/actions/createTransaction.ts 0 1 0.0%
src/routes/safe/components/Transactions/helpers/EditTxParametersForm/index.tsx 0 1 0.0%
src/logic/safe/transactions/gas.ts 1 3 33.33%
Totals Coverage Status
Change from base Build 1495508268: 0.06%
Covered Lines: 2991
Relevant Lines: 8363

💛 - Coveralls

@github-actions
Copy link

Deployment links

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

@github-actions
Copy link

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

@francovenica
Copy link
Contributor

francovenica commented Nov 23, 2021

When the tx is created the SafeTxGas still has a value != 0 and it can be edited. There is no reason for that, we could force to be = 0 and a non editable input (or if it is possible to hide the input here it and still send the 0 when the tx is created/executed works as well)

This is the creation of a tx of a safe with a policy of 2 or more owners
image

@katspaugh
Copy link
Member Author

@francovenica you sure you were looking at a 1.3.0 Safe?

SafeTxGas isn't displayed for me.
Screenshot 2021-11-24 at 10 30 29

@francovenica
Copy link
Contributor

Sorry, didn't paste the safe address:
https://pr3052--safereact.review-safe.gnosisdev.com/app/rin:0x5A7140f5DEabc7e211Da114081d9b0Fc4bf4cAf2/settings/details

Pretty sure, is a safe 1.0.0.
image

Give me an address so I can make you owner of that safe so you can check it

@katspaugh
Copy link
Member Author

Yes, it's an old Safe indeed:
Screenshot 2021-11-24 at 13 23 39

For anything older than 1.3.0, we'll still calculate and show the safeTxGas.

@francovenica
Copy link
Contributor

I missunderstood the ticket. I thought that 1.3.0 were not passing the parameter at all and other versions were passing a fixed 0 for safeTxGas.

Ok, the ticket is fine then:
Safes 1.3.0 are not showing the input and passing a 0 as SafeTxGas
Safes < 1.3.0 are showing the safeTxGas as normal then.

@katspaugh katspaugh merged commit 9a76909 into dev Nov 24, 2021
@katspaugh katspaugh deleted the safe-tx-gas branch November 24, 2021 12:30
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2021
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.

Send 0 for safeTxGas
4 participants