Skip to content

feature: Get all Invalid Fills #1085

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

dijanin-brat
Copy link
Contributor

Get all invalid fills

@dijanin-brat dijanin-brat self-assigned this Jun 13, 2025
@dijanin-brat dijanin-brat marked this pull request as ready for review June 17, 2025 13:05
@dijanin-brat dijanin-brat requested a review from pxrl June 17, 2025 13:06
Copy link
Contributor

@pxrl pxrl left a comment

Choose a reason for hiding this comment

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

@dijanin-brat Looks good! I ended up commenting on some of the pre-existing code that's getting moved around; this isn't related to your work but probably makes sense to address it as part of this refactor.

Comment on lines 255 to 266
const enrichedDeposits = await Promise.all(
deposits.map(async (deposit: DepositWithBlock) => ({
...deposit,
quoteBlockNumber: await this.getBlockNumber(Number(deposit.quoteTimestamp)),
originChainId: this.chainId,
fromLiteChain: this.isOriginLiteChain(deposit),
toLiteChain: this.isDestinationLiteChain(deposit),
outputToken: isZeroAddress(deposit.outputToken)
? this.getDestinationTokenForDeposit(deposit)
: deposit.outputToken,
}))
);
Copy link
Contributor

Choose a reason for hiding this comment

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

@dijanin-brat ooc, should this be 1:1 with the EVM implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They work with 2 different types of data (EVM has Log and SVM has DepositWithBlock). In SVM we are just adding values for few more fields, in EVM we are creating whole new structure. I guess this can be refactored in a way that both EVM and SVM use the same functiom/method for this. Do you think that should be done?

Copy link
Contributor

Choose a reason for hiding this comment

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

For follow-up after this PR, yeah. I'm pretty sure they should using the same underlying types, since DepositWithBlock is the product of processing a Log type. So the fact that these are different hints at some unexpected asymmetry between the implementations.

Copy link
Contributor

Choose a reason for hiding this comment

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

@melisaguevara @bmzig You're both strong on the SVMSpokePoolClient - possible to take a pass over this file?

// First do all synchronous operations
deposits = events.map((event) => {
const deposit = {
...spreadEventWithBlockNumber(event),
Copy link
Contributor

Choose a reason for hiding this comment

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

This PR looks fine to me. I'd prefer if we can merge this after we do the address migration though. Once we do that, you'd need to manually cast the address args here (like depositor, recipient, etc.) to an Address type.

Comment on lines 269 to 271
if (isZeroAddress(deposit.outputToken)) {
deposit.outputToken = this.getDestinationTokenForDeposit(deposit);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

fwiw I think this needs to be re-worked following the Address class updates that were merged on Friday.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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