safe-global / safe-wallet-web

Safe{Wallet} – multisig EVM wallet
https://app.safe.global
GNU General Public License v3.0
343 stars 407 forks source link

feat: relaying for native swaps only [SWAP-100] #3809

Closed schmanu closed 3 months ago

schmanu commented 3 months ago

What it solves

Resolves SWAP-100

How this PR fixes it

New feature flag to offer relaying for native swaps only.

How to test it

Checklist

notion-workspace[bot] commented 3 months ago

Relay swap widget transactions on arbitrum

github-actions[bot] commented 3 months ago

Branch preview

βœ… Deploy successful!

Website: https://relay_swaps--walletweb.review.5afe.dev/home?safe=eth:0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6

Storybook: https://relay_swaps--walletweb.review.5afe.dev/storybook/

github-actions[bot] commented 3 months ago

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

Report generated by eslint-plus-action

github-actions[bot] commented 3 months ago

πŸ“¦ 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 950.36 KB (🟑 +10 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!

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/new-safe/create 26.71 KB (🟑 +39 B) 977.07 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

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

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

github-actions[bot] commented 3 months ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
79.49% (-0.02% πŸ”»)
11509/14479
πŸ”΄ Branches
58.61% (+0.01% πŸ”Ό)
2771/4728
🟑 Functions
66.77% (-0.04% πŸ”»)
1851/2772
🟒 Lines
80.84% (-0.02% πŸ”»)
10381/12842
Show files with reduced coverage πŸ”»
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :-: | :- | :- | :- | :- | :- | | 🟒 |
`...` / index.tsx
|
82.35% (-8.82% πŸ”»)
|
66.67% (-16.67% πŸ”»)
|
50% (-12.5% πŸ”»)
|
83.87% (-9.68% πŸ”»)
|

Test suite run success

1445 tests passing in 199 suites.

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

francovenica commented 3 months ago

I've checked the Relayer feature is only enabled for native swap, you can access it by the swap button on the sidebar or the Swap button in the "New tx" modal. Any other tx, even a CowSwap tx from the "Safe apps" page doesn't offer using relayer.

Looks good to me

Note: (Probably not part of the scope of this ticket) I tried a relayed swapping and it worked on the cowswap side (the order was filled), but on our side the tx never finished to be signed, still reads as 0 out 1 and with an "Expired" status even tho the order was filled. I understand that gnosis chain in stg is not really staging, but is using prod backend, so that might be a factor in all this. Here is the tx, see in which state is tomorrow: https://relay_swaps--walletweb.review.5afe.dev/transactions/tx?safe=gno:0xB8d760a90a5ed54D3c2b3EFC231277e99188642A&id=multisig_0xB8d760a90a5ed54D3c2b3EFC231277e99188642A_0xed4b9d156121e6a01b1b86fc4945d9a7e9819658e3c106de876ff61d65ec4724

schmanu commented 3 months ago

@francovenica The transaction you shared is displayed correctly to me: fully signed and with a fulfilled order. That might have been an caching issue on our backend, but def. not related to this change.