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

fix: do not modify signatures for fully signed txs when estimating #3335

Merged
merged 5 commits into from
Feb 28, 2024

Conversation

schmanu
Copy link
Member

@schmanu schmanu commented Feb 26, 2024

What it solves

Resolves #3332

How this PR fixes it

  • Checks if a signature is needed before adding a pre-validated-sig.

How to test it

  • Open a 1/2 Safe where you control both owners
  • Sign a transaction with the owner that has a higher address (higher hex number)
  • Switch to the other owner with a lower address
  • Try to execute the tx
  • Observe that the gas estimation now matches

Checklist

  • I've tested the branch on mobile πŸ“±
  • I've documented how it affects the analytics (if at all) πŸ“Š
  • I've written a unit/e2e test for it (if applicable) πŸ§‘β€πŸ’»

Copy link

github-actions bot commented Feb 26, 2024

Copy link

github-actions bot commented Feb 26, 2024

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

Copy link

github-actions bot commented Feb 26, 2024

πŸ“¦ Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. πŸ€–

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 1.03 MB (🟑 +2 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Copy link

github-actions bot commented Feb 26, 2024

Coverage report

St.❔
Category Percentage Covered / Total
🟑 Statements
78.97% (+0.01% πŸ”Ό)
11515/14581
πŸ”΄ Branches
57.96% (+0.17% πŸ”Ό)
2608/4500
🟑 Functions
64.05% (-0.07% πŸ”»)
1846/2882
🟒 Lines
80.33% (+0.01% πŸ”Ό)
10375/12915
Show new covered files 🐣
St.❔
File Statements Branches Functions Lines
πŸ”΄
... / contractManager.ts
43.33% 60% 14.29% 41.38%

Test suite run success

1408 tests passing in 194 suites.

Report generated by πŸ§ͺjest coverage report action from f0a6400

Copy link
Member

@usame-algan usame-algan left a comment

Choose a reason for hiding this comment

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

Looks good!

There is a lint warning about threshold missing in the deps array and a couple of unrelated? tests failing.

@francovenica
Copy link
Contributor

francovenica commented Feb 26, 2024

I still see the issue. Check the gif

For context:
The safe is in Sepolia, is a 1/2 safe, the tx is "Send funds" that is queued and with its creation is fully signed
The owner that created it was 0x8aEf2f5c3F17261F6F1C4dA058D022BE92776af8
In the gif I try to sign with that first owner and I have a gas limit of 65k
When I switch to the other owner "0x0D65139Da4B36a8A39BF1b63e950038D42231b2e" I get a gas limit of 67k. The same gas limit shows if I try to execute with a non-owner of the safe

gas estimation

@schmanu
Copy link
Member Author

schmanu commented Feb 27, 2024

Could you check again @francovenica?
Not sure if it was some deployment issue but for me I always see the same gas limit with the first signer, another owner who did not sign or some connected wallet that isn't an owner.

@francovenica
Copy link
Contributor

We tested with Manuel and we end up figuring out that if you send funds to yourself (so the receiver is the same EOA wallet as the one executing) the tx is slightly cheaper than if the person who execute is not the receiver. We also noticed that if the receiver is not an owner of the safe it also cost more.
We attribute all this to something on the contract that must control the gas limit for these different scenarios, so all of this is outside of the scope of this ticket and not considered an issue that must be fixed

I checked with other tx, like owner swapping and rejecting a tx and there I was able to confirm that, no matter who tries to sign the gas limit is always the same, so I consider this ticket done.

@schmanu schmanu merged commit c644d5b into dev Feb 28, 2024
13 checks passed
@schmanu schmanu deleted the fix/gas-estimation-2nd-owner branch February 28, 2024 08:23
@github-actions github-actions bot locked and limited conversation to collaborators Feb 28, 2024
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.

Different gaslimit is used for diff type of users during tx execution
3 participants