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

feat: paraswap permit #1399

Merged
merged 17 commits into from
Jan 18, 2023
Merged

feat: paraswap permit #1399

merged 17 commits into from
Jan 18, 2023

Conversation

defispartan
Copy link
Collaborator

@defispartan defispartan commented Jan 6, 2023

General Changes

  • Add support to approve repay with collateral and collateral swap transactions with gasless signature in place of approval tx.

Developer Notes

Signature request is generated in new helper function in poolSlice. This should be moved to @aave/contract-helpers, bundled with approval tx building, and re-used for pool permit functions, staking, and migration tool as started here

Refactoring this before the migration PR will cause large conflicts though, so this approach is temporary.


Author Checklist

Please ensure you, the author, have gone through this checklist to ensure there is an efficient workflow for the reviewers.

  • The base branch is set to main
  • The title is using Conventional Commit formatting
  • The Github issue has been linked to the PR in the Development section
  • The General Changes section has been filled out
  • Developer Notes have been added (optional)

If the PR is ready for review:

  • The PR is in Open state and not in Draft mode
  • The Ready for Dev Review label has been added

Reviewer Checklist

Please ensure you, as the reviewer(s), have gone through this checklist to ensure that the code changes are ready to ship safely and to help mitigate any downstream issues that may occur.

  • End-to-end tests are passing without any errors
  • Code style generally follows existing patterns
  • Code changes do not significantly increase the application bundle size
  • If there are new 3rd-party packages, they do not introduce potential security threats
  • If there are new environment variables being added, they have been added to the .env.example file as well as the pertinant .github/actions/* files
  • There are no CI changes, or they have been approved by the DevOps and Engineering team(s)
  • Code changes have been quality checked in the ephemeral URL
  • QA verification has been completed
  • There are two or more approvals from the core team
  • Squash and merge has been checked

@height
Copy link

height bot commented Jan 6, 2023

This pull request has been linked to 1 task:

💡Tip: Add "Close T-1876" to the pull request title or description, to a commit message, or in a comment to mark this task as "Done" when the pull request is merged.

@github-actions
Copy link

github-actions bot commented Jan 6, 2023

@github-actions
Copy link

github-actions bot commented Jan 6, 2023

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 482.21 KB (🟡 +3.3 KB)
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!

Four Pages Changed Size

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

Page Size (compressed) First Load
/faucet 22.15 KB (🟡 +85 B) 504.36 KB
/governance/ipfs-preview 105.46 KB (-3 B) 587.67 KB
/governance/proposal 105.62 KB (-3 B) 587.83 KB
/governance/proposal/[proposalId] 60.32 KB (-3 B) 542.53 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.

@grothem
Copy link
Collaborator

grothem commented Jan 6, 2023

link T-1876

@MareskoY
Copy link
Contributor

MareskoY commented Jan 6, 2023

@defispartan all actions related to paraswap and usdt on any market failing (for repay as collateral and swap )

@defispartan defispartan marked this pull request as ready for review January 10, 2023 02:26
@defispartan defispartan added Ready for QA Review Ready for QA engineer reviews Ready for Dev Review Read for frontend engineer reviews labels Jan 10, 2023
@github-actions
Copy link

@github-actions
Copy link

@iamanastasia
Copy link
Contributor

iamanastasia commented Jan 10, 2023

Not sure if that's critical, but might be confusing in UI — error message stays on the screen, even when I'm trying to do a new action.

Path:

  1. Decided to swap collateral and opened modal window.
  2. Selected asset I want to swap to.
  3. Clicked APPROVE (via signed message).
  4. Clicked CANCEL in the wallet because I changed my mind.
  5. Got an error message 'You canceled the transaction', which is fine.
  6. Changed asset in 'Swap to'.
  7. And I still see the old error message 'You canceled the transaction' even though all other details were updated.

Should we hide old errors since I'm trying to perform a new action?

Screenshot 2023-01-10 at 15 20 20

@bojanaave bojanaave added QC Failed and removed Ready for QA Review Ready for QA engineer reviews labels Jan 10, 2023
@defispartan
Copy link
Collaborator Author

Not sure if that's critical, but might be confusing in UI — error message stays on the screen, even when I'm trying to do a new action.

Path:

  1. Decided to swap collateral and opened modal window.
  2. Selected asset I want to swap to.
  3. Clicked APPROVE (via signed message).
  4. Clicked CANCEL in the wallet because I changed my mind.
  5. Got an error message 'You canceled the transaction', which is fine.
  6. Changed asset in 'Swap to'.
  7. And I still see the old error message 'You canceled the transaction' even though all other details were updated.

Should we hide old errors since I'm trying to perform a new action?

Screenshot 2023-01-10 at 15 20 20

Pushed an update, the error and approval state should be correctly updated on any changes to the selected asset or amount

@github-actions
Copy link

@github-actions
Copy link

@defispartan defispartan added Ready for QA Review Ready for QA engineer reviews and removed QC Failed labels Jan 11, 2023
@iamanastasia
Copy link
Contributor

@defispartan Looks great! thanks

@MareskoY MareskoY added QC Failed and removed Ready for QA Review Ready for QA engineer reviews labels Jan 11, 2023
@MareskoY
Copy link
Contributor

there is a problem with swap action for USDT on ETH and avalanche market, only on fork

it's every time failing with

cannot estimate gas; transaction may fail or may require manual gas limit (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"id\":152,\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32000,\"message\":\"execution reverted\",\"data\":{\"error_id\":\"fbb18036-3e4e-40ef-ab0e-dea6cbd4b11a\"}}}","error":{"code":-32000,"data":{"error_id":"fbb18036-3e4e-40ef-ab0e-dea6cbd4b11a"}},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"value\":\"0x0\",\"from\":\"0x9effcf18637ad365a5240b1b2db6ca7b46a5c98a\",\"to\":\"0x80aca0c645fedabaa20fd2bf0daf57885a309fe6\",\"data\":\"0x4db9dc97000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000001a9d3facc3d3500000000000000000000000000000000000000000000000000000000000989680000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000001cfc002fec71d90000000000000000000000000000000000000000000000000000000063beb003000000000000000000000000000000000000000000000000000000000000001b4daaed2b88ecdf25bae8cd7662d3902b51a1e2e66cf159c083ebbc638bc6d63743061e5f10ba587bf3a0fa5a7b0e9cc49185254929ce41ec1e986388cb48c71c00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000040000000000000000000000000def171fe48cf0115b1d80b88dc8eab59176fee5700000000000000000000000000000000000000000000000000000000000000e4b2f1e6db000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000001a9d3facc3d3500000000000000000000000000000000000000000000000000000000000989680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000004de4703b120f15ab77b986a24c6f9262364d02f9432f00000000000000000000000000000000000000000000000000000000\"}],\"id\":152,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://rpc.tenderly.co/fork/ea6b30db-9e93-4c2d-952b-6cb71dde8ac6"}, method="estimateGas", transaction={"from":"0x9efFCf18637ad365A5240B1b2Db6CA7B46a5C98a","to":"0x80Aca0C645fEdABaa20fd2Bf0Daf57885A309FE6","value":{"type":"BigNumber","hex":"0x00"},"data":"0x4db9dc97000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000001a9d3facc3d3500000000000000000000000000000000000000000000000000000000000989680000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000001cfc002fec71d90000000000000000000000000000000000000000000000000000000063beb003000000000000000000000000000000000000000000000000000000000000001b4daaed2b88ecdf25bae8cd7662d3902b51a1e2e66cf159c083ebbc638bc6d63743061e5f10ba587bf3a0fa5a7b0e9cc49185254929ce41ec1e986388cb48c71c00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000040000000000000000000000000def171fe48cf0115b1d80b88dc8eab59176fee5700000000000000000000000000000000000000000000000000000000000000e4b2f1e6db000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000001a9d3facc3d3500000000000000000000000000000000000000000000000000000000000989680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000004de4703b120f15ab77b986a24c6f9262364d02f9432f00000000000000000000000000000000000000000000000000000000","accessList":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.5.3)

by this reason Ci failing, at same time on mainnet it's work fine

@MareskoY
Copy link
Contributor

@defispartan also found one more problem but on mainnet with swaping MATIC to DAI

tx failing

[ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"code":-32603,"message":"Internal error"}}}'

Screenshot 2023-01-11 at 12 25 49

Screenshot 2023-01-11 at 12 25 01

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@defispartan defispartan merged commit fe8a113 into main Jan 18, 2023
@defispartan defispartan deleted the feat/paraswap-permit branch January 18, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QC Passed Ready for Dev Review Read for frontend engineer reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants