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

fix: remove unnecessary transaction proposals #3328

Merged
merged 1 commit into from
Jan 21, 2022
Merged

Conversation

iamacook
Copy link
Member

What it solves

Resolves #3326

How this PR fixes it

Transaction proposal now takes whether the transaction is being immediately created and executed into account. Proposals now only occur when a transaction is being created, created and immediately executed (1 threshold) or confirmed. (Execution should not propose).

An extra flag is now passed from processTransaction to our TxSender: approveAndExecute. This flag is referenced to determine isImmediateExecution (a 1/? threshold Safe creating and immediately execution a transaction):

    // Creation or confirmation
    const isOffChainSigning = !isExecution && signature

    // 1/? Safe is creating and executing transaction immediately
    const isOnChainSigning = isExecution && !signature
    const isImmediateExecution = isOnChainSigning && !approveAndExecute

    if (isOffChainSigning || isImmediateExecution) {
      // Propose
    }

How to test it

Please bear in mind that this touches upon all transaction types.

All reference data cases in the issue HAVE been successfully tested, but it should also be verified on hardware wallets.

There should be NO backend proposal network call when executing the following

  • A confirmed transaction on a 1/? Safe by a (non-)owner
  • A confirmed transaction on a 2+/? Safe by a (non-)owner

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

Report generated by eslint-plus-action

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1718227251

  • 0 of 8 (0.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 32.179%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/logic/safe/store/actions/processTransaction.ts 0 3 0.0%
src/logic/safe/store/actions/createTransaction.ts 0 5 0.0%
Files with Coverage Reduction New Missed Lines %
src/logic/safe/store/actions/createTransaction.ts 1 3.03%
Totals Coverage Status
Change from base Build 1717681956: -0.02%
Covered Lines: 3112
Relevant Lines: 8607

💛 - Coveralls

@github-actions
Copy link

Deployment links

🟠 Rinkeby Mainnet 🟣 Polygon 🟡 BSC Arbitrum 🟢 Gnosis Chain

@github-actions
Copy link

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

Failed tests:

  • ❌ Safe Apps List Safe Apps List
  • ❌ Safe Balances Safe Balances

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

Looks complicated with all the mini-conditions but I trust you know what you're doing. 👍

@francovenica
Copy link
Contributor

Looks good to me

Tried with WC, MM, Trezor and leger. Every tx that is just a confirm or confirm an execute creates a "propose" request
Used a safe with 1/x and 2/x.
Sole execution doesn't create a propose request

image

@iamacook iamacook merged commit 708c8d6 into dev Jan 21, 2022
@iamacook iamacook deleted the unnecessary-proposals branch January 21, 2022 10:30
@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 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.

Unnecessary transaction proposals
4 participants