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

improve: simulate relay gas fees for messages #862

Conversation

james-a-morris
Copy link
Contributor

@james-a-morris james-a-morris commented Oct 5, 2023

We will require the following PR to be merged first: across-protocol/sdk#427

Fixes ACX-1529, ACX-1575, and ACX-1574

@linear
Copy link

linear bot commented Oct 5, 2023

ACX-1571 Estimate fill gas costs with non-empty message fields

For most cases, use the main RL relayer (0x428…) as the simulated EOA

This only applies to situations where the message ≠ 0x and recipient is a contract

@james-a-morris james-a-morris requested a review from dohaki October 5, 2023 18:05
@vercel
Copy link

vercel bot commented Oct 5, 2023

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

Name Status Preview Comments Updated (UTC)
frontend-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2023 10:30pm
goerli-frontend-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2023 10:30pm

@linear
Copy link

linear bot commented Oct 5, 2023

ACX-1529 Avoid await on non-async functions.

ACX-1575 Allow caller to pass optional custom EOA param

extra query parameter ?relayer=x that can be used to change the EOA we use for simulations.

Note, this might produce situations where the caller gets a fee quote successfully but our relayers are not able to fill it. This should only be used if the caller knows that the relayer they pass in will fill their deposit

ACX-1574 Return 4xx error if simulation reverts because of insufficient token balance or insufficient gas funds

This is important because we will never slow fill a deposit with a message, so we shouldn't be quoting these deposits.

Copy link
Contributor

@mrice32 mrice32 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, just a few comments!

api/suggested-fees.ts Outdated Show resolved Hide resolved
api/_utils.ts Outdated Show resolved Hide resolved
api/suggested-fees.ts Outdated Show resolved Hide resolved
api/suggested-fees.ts Outdated Show resolved Hide resolved
api/suggested-fees.ts Outdated Show resolved Hide resolved
Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

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

Nice, just some nits

api/account-balance.ts Outdated Show resolved Hide resolved
Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

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

@james-a-morris
Copy link
Contributor Author

@nicholaspai rerequested due to needing a UI change to accommodate the new request.

Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

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

LGTM but do we need to make changes to the relayer or let other callers of the API know before we merge and deploy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants