Skip to content

Conversation

@nicholaspai
Copy link
Member

No description provided.

nicholaspai and others added 24 commits December 25, 2023 12:59
This function handles most of the fill logic and this PR adds useful test infrastructure for future testing
Signed-off-by: nicholaspai <npai.nyc@gmail.com>
Signed-off-by: nicholaspai <npai.nyc@gmail.com>
Co-authored-by: Paul <108695806+pxrl@users.noreply.github.com>
Signed-off-by: nicholaspai <npai.nyc@gmail.com>
…into fillUSS functions

# Motivation

1. Reduce the number of params passed into fillUSS-related functions by 1 by removing `destinationChainId` from the passed in `struct`. This also has the added safety benefit of not allowing the caller to set the `destinationChainId` and instead forces them to reference a relay hash using the SpokePool's `chainId()`.

2. This additionally saves gas in these functions because it no longer needs to check the input `relayData.destinationChainId` against the contract's `chainId`.

# Side effects:

Changes implementation of how we construct relay hashes for USS fills by now hashing all of the `RelayData` params as a struct (i.e. as a DepositData struct) WITH the `chainId()` so that the destinationChainId is still hashed to protect against replay attacks
@nicholaspai nicholaspai changed the base branch from master to npai/deposit-data January 4, 2024 14:55
@nicholaspai nicholaspai changed the title feat: Add requestUSSSlowFill and executeUSSSlowFillLeaf unit tests feat: Add requestUSSSlowFill and executeUSS unit tests Jan 4, 2024
@nicholaspai nicholaspai requested review from mrice32 and pxrl January 4, 2024 15:44
Base automatically changed from npai/deposit-data to master January 4, 2024 16:21
@nicholaspai nicholaspai marked this pull request as ready for review January 4, 2024 16:26
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.

These look great -- can't think of a case that isn't covered

Signed-off-by: nicholaspai <npai.nyc@gmail.com>
@nicholaspai nicholaspai merged commit 9701c74 into master Jan 4, 2024
@nicholaspai nicholaspai deleted the npai/request-slow-fill branch January 4, 2024 19:36
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