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: hook-store): create bundle hooks tenderly simulation #4943

Conversation

yvesfracari
Copy link
Contributor

@yvesfracari yvesfracari commented Oct 3, 2024

Summary

Add bundle simulations on the hook store feature. This enhances the hooks simulations by considering all the previous hooks and the swap (in case of post hooks).

https://www.loom.com/share/37cf070b4f7b41f896966c469941c406?sid=c183f6f3-f611-4d2f-8d7d-0015bb8d374a

To Test

Since we still don't have a Tenderly account, it is expected to have to login on Tenderly to see the simulation links.

  1. Run the bff locally on port 3001. For more information check: Add simulation and token holder endpoints bff#88

  2. Change the bff connection by editing the file: libs/common-const/src/bff.ts. Change the default URL to http://localhost:3001

  3. Run the cowswap app locally.

  4. Go to the hooks tab of the swap widget and add some hooks.

  • Should be able to see Tenderly links for failing transactions.
  • Should auto refresh simulations on hook or token changes.
  • Check the simulation for different tokens to sell and buy.
  • Should be able to create order even if hooks are falling.

Background

@alfetopito @shoom3301 In order to merge this PR we will have to add the .env keys. Let me know if you think that we should wait for the refactoring to the backend for the frontend repo.

Copy link

vercel bot commented Oct 3, 2024

@yvesfracari is attempting to deploy a commit to the cow Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Oct 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
swap-dev ✅ Ready (Inspect) Visit Preview Oct 18, 2024 0:50am

@yvesfracari
Copy link
Contributor Author

Hey everyone! I've refactored this to work with the bff and updated the PR description to include new instructions for testing it.

However, I am wondering if the bundle simulation feature would work better on a separate page after the swap definition. I believe we should revalidate on token amount changes, but this would trigger many requests in my opinion. For now, I'm just revalidating the simulation on token and hook changes (not amounts).

I look forward to your ideas.

Copy link

socket-security bot commented Oct 17, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Protestware or potentially unwanted behavior npm/[email protected]
  • Note: The script attempts to run a local post-install script, which could potentially contain malicious code. The error handling suggests that it is designed to fail silently, which is a common tactic in malicious scripts.
⚠︎
Protestware or potentially unwanted behavior npm/[email protected]
  • Note: This package prints a protestware console message on install regarding Ukraine for users with Russian language locale
⚠︎
Critical CVE npm/[email protected] ⚠︎

View full report↗︎

Next steps

What is protestware?

This package is a joke, parody, or includes undocumented or hidden behavior unrelated to its primary function.

Consider that consuming this package may come along with functionality unrelated to its primary purpose.

What is a critical CVE?

Contains a Critical Common Vulnerability and Exposure (CVE).

Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

One more comment, otherwise looks good

Copy link

Report too large to display inline

View full report↗︎

@shoom3301 shoom3301 merged commit 435bfdf into cowprotocol:develop Oct 23, 2024
6 of 12 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants