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(relayer): Drop slow fill request queries #1340

Merged
merged 36 commits into from
Apr 9, 2024
Merged

Conversation

pxrl
Copy link
Contributor

@pxrl pxrl commented Mar 21, 2024

By retaining the deposit FillStatus on the destination chain it's possible to skip scraping for RequestedV3SpeedUp events. This reduces the RPC load during SpokePoolClient update.

pxrl added 23 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.
By retaining the deposit FillStatus on the destination chain it's
possible to skip scraping for RequestedV3SpeedUp events. This reduces
the RPC load during SpokePoolClient update.
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.

This also seems good

src/relayer/Relayer.ts Show resolved Hide resolved
Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

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

Although I agree that a slow depositor should trigger a slow relay every time, I'm not sure we want to remove the configuration to be able to disable slow relays from a given relayer.

@pxrl
Copy link
Contributor Author

pxrl commented Mar 21, 2024

Although I agree that a slow depositor should trigger a slow relay every time, I'm not sure we want to remove the configuration to be able to disable slow relays from a given relayer.

Agree - that's not changed here and it remains as-is 👍 Slow relays is still 100% opt-in.

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 this will also cause bundle refund construction problematic since we need slow fill requests to compute bundle data correctly

@nicholaspai nicholaspai added the do not merge Don't merge until label is removed label Mar 22, 2024
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 SlowFillRequest events

@pxrl
Copy link
Contributor Author

pxrl commented Mar 22, 2024

I think this will also cause bundle refund construction problematic since we need slow fill requests to compute bundle data correctly

That's important for the proposer/disputer, but is relevant for the relayer? This PR only affects the relayer's SpokePoolClient update, and deposit update requests don't affect relayer repayments so I can't see any obvious problem with ignoring them.

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 revisit this now that we load most bundle data from arweave. I also think this probably wasn't an issue affecting bundle refund computation

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

pxrl commented Apr 5, 2024

I think we can revisit this now that we load most bundle data from arweave. I also think this probably wasn't an issue affecting bundle refund computation

Yeah - I also wasn't able to reason my way to any problem with dropping these events. I'll merge this on Monday 👍

@pxrl pxrl merged commit c03a92d into master Apr 9, 2024
4 checks passed
@pxrl pxrl deleted the pxrl/slowFillRequests branch April 9, 2024 07:49
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