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): Batch query deposit fill status #1338

Merged
merged 27 commits into from
Mar 22, 2024
Merged

Conversation

pxrl
Copy link
Contributor

@pxrl pxrl commented Mar 21, 2024

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.

pxrl added 17 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.
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 is a nice idea and implementation. It's ok to query this for each fill since we only do it once per batch, unlike currently where we only check it for unfilled fills but sequentially

src/utils/FillUtils.ts Outdated Show resolved Hide resolved
Base automatically changed from pxrl/relayerRefactorEvaluate to master March 22, 2024 10:30
@pxrl pxrl merged commit f8e59f6 into master Mar 22, 2024
4 checks passed
@pxrl pxrl deleted the pxrl/batchFillStatus branch March 22, 2024 13:45
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.

2 participants