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(relayer): Support ignoring FilledV3Relay events #1339

Closed
wants to merge 27 commits into from
Closed

Conversation

pxrl
Copy link
Contributor

@pxrl pxrl commented Mar 21, 2024

This commit makes the SpokePoolClient FilledV3Relay query optional, subject to the ACCEPT_INVALID_FILLS env var being defined true. This ensures that the behaviour is opt-in.

This is enabled by the recent change to query the fill status of all outstanding deposits. Since there's no need to submit the LP fee onchain in Across v3, the risks of opting into this setting are significantly reduced, whilst the benefits are:

  • Reduced SpokePoolClient update times.
  • Reduced overheads in matchind deposits with fills.

pxrl added 20 commits March 20, 2024 22:26
Making room for follow-up changes to improve relayer performance.
Rather than duplicating the array of unfilled deposits, just check it as
the first conditional in the subsequent loop. This allows the entire
function to be subsequently factored away, which will occur in a
follow-up commit.
Factoring out this functionality permits it to be executed in parallel
per destination chain.
The relayer currently implements late-stage checking of the fill status
on a per-deposit basis. This is fairly slow and inefficient, but does
successfully protect against an avalanche of failed fill simulations
that result from overlapping bot runs.

This change implements batched querying of all deposits for each
destination chain. This is significantly more efficient in terms of RPC
consumption, and should allow for subsequent "already filled" filtering
to occur much faster. It's also a key enabler for some subsequent
efficiency improvements.
This commit makes the SpokePoolClient FilledV3Relay query optional,
subject to the ACCEPT_INVALID_FILLS env var being defined true. This
ensures that the behaviour is opt-in.

This is enabled by the recent change to query the fill status of all
outstanding deposits. Since there's no need to submit the LP fee onchain
in Across v3, the risks of opting into this setting are significantly
reduced, whilst the benefits are:
- Reduced SpokePoolClient update times.
- Reduced overheads in matchind deposits with fills.
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!

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.

LGTM!

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.

Mentioned IRL, but repeating here: will this cause any issues with the relayer determining what refunds it expects in the next bundle?

@pxrl pxrl added the do not merge Don't merge until label is removed label Mar 21, 2024
@pxrl
Copy link
Contributor Author

pxrl commented Mar 21, 2024

Mentioned IRL, but repeating here: will this cause any issues with the relayer determining what refunds it expects in the next bundle?

Really good consideration - it would.

It's a useful feature for third-parties to have so I think it's probably worth having, but I wonder if it should also be conditional on inventory management being disabled. I've marked it do not merge for the time being and will think over it for a little while.

@nicholaspai
Copy link
Member

We can probably re review this again after changing how bundle refunds are computed in the InventoryManager. If we can fetch them from Arweave then this PR can be useful even with InventoryManager enabled

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.

do not merge yet until bundle data can be fetched without using FilledV3Relay events

Base automatically changed from pxrl/batchFillStatus to master March 22, 2024 13:45
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.

I think we can evaluate this after local testing now that we load most bundle data from arweave. However, there is still a case where we'd want to comute bundles from events when there is no bundle pending. This happens in the short window (~15 mins max) between last bundle execution and next bundle proposed.

This PR would cause the Inventory Manager to not count any bundle refunds in that time, which probably is not a big deal and worth the speed up if it is signficiant

@nicholaspai nicholaspai removed the do not merge Don't merge until label is removed label Apr 5, 2024
@nicholaspai
Copy link
Member

I think we can evaluate this after local testing now that we load most bundle data from arweave. However, there is still a case where we'd want to comute bundles from events when there is no bundle pending. This happens in the short window (~15 mins max) between last bundle execution and next bundle proposed.

This PR would cause the Inventory Manager to not count any bundle refunds in that time, which probably is not a big deal and worth the speed up if it is signficiant

I think this pr is now intractable if we're going to go with the bundle refund approximation approach in #1382

@pxrl
Copy link
Contributor Author

pxrl commented Apr 9, 2024

I think we can evaluate this after local testing now that we load most bundle data from arweave. However, there is still a case where we'd want to comute bundles from events when there is no bundle pending. This happens in the short window (~15 mins max) between last bundle execution and next bundle proposed.
This PR would cause the Inventory Manager to not count any bundle refunds in that time, which probably is not a big deal and worth the speed up if it is signficiant

I think this pr is now intractable if we're going to go with the bundle refund approximation approach in #1382

Yep, agreed. Time for it to be closed.

@pxrl pxrl closed this Apr 9, 2024
@pxrl pxrl deleted the pxrl/spicy branch April 9, 2024 23:18
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