Skip to content

Conversation

@nicholaspai
Copy link
Member

@nicholaspai nicholaspai commented Nov 9, 2023

Breaking changes from existing SpokePool types of same name:

Fixes ACX-1672

RelayData

  • relayerFeePct/ realizedLpFeePct replaced with outputAmount. The total fee is implied to be difference between inputAmount - outputAmount * exchangeRateInputOutputTokens
  • Fill expiryTimestamp/fillDeadline
  • Exclusive relayer

RelayExecution

  • No maxCount
  • Updatable deposit fields are optimistically set to:
    • outputAmount
    • recipient
    • message

Optimizing compilation of contracts

Unfortunately, adding more functions to the SpokePool will push it over the contract bytecode size unless we decrease the optimizer. Not sure how to get around this since we want to maintain old functionality so we can only add to the size. I've bumped it down by 100x to the point where the compiler doesn't warn anymore

# Breaking changes from existing `SpokePool` types of same name:

## RelayData
- `relayerFeePct`/ `realizedLpFeePct` replaced with `outputAmount`. The total fee is implied to be difference between `inputAmount` - `outputAmount` * `exchangeRateInputOutputTokens`
- Fill `expiryTimestamp`
- Exclusive `relayer`

## RelayExecution
- No `maxCount`
- `bool isSlowRelay` has been replaced with an enum `executionType` which is also added to the `SlowFill` struct so that creator of SlowFill leaf can specify whether this is a deposit refund or a normal slow fill. This is designed to be used by the executor to filter out slow fills with messages that it *shouldn't* execute versus deposit refunds that it *should* execute.
- Updatable deposit fields are optimistically set to:
    - outputAmount
    - recipient
    - message

## SlowFill
- Allow slow fill creator to specify `executionType` to distinguish between deposit refunds and normal slow fills. Deposit refunds should have a `message` field set to help the `depositCallbackAddress` determine the deposit that was refunded but this should still be executed by executor. Typically executors won't execute slow fills with messages.

## FundsDeposited
- Adds `depositRefundCallbackAddress` to rest of `RelayData` params. Can be used by dataworker to create a deposit refund as a slow fill leaf.

# Optimizing compilation of contracts

Unfortunately, adding more functions to the `SpokePool` will push it over the contract bytecode size unless we decrease the optimizer. Not sure how to get around this since we want to maintain old functionality so we can only add to the size. I've bumped it down by 100x to the point where the compiler doesn't warn anymore
@nicholaspai nicholaspai requested review from mrice32 and pxrl November 9, 2023 16:06
@linear
Copy link

linear bot commented Nov 9, 2023

ACX-1672 Add new contract structs

There will be a new RelayData struct for new Deposits, which means that the relayHash for new fills will be different.

  • Add new structs:
    • RelayData2
    • RelayExecution2
    • RelayExecutionInfo2
    • SlowFill2
    • RelayData2
    • The best way to organize these might be put them into a new library/interface file. For example, SpokePoolLib2.RelayData might be cleaner than RelayData2…

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.

Looks awesome! Just a few questions.

@nicholaspai nicholaspai requested a review from mrice32 November 14, 2023 01:01
Co-authored-by: Paul <108695806+pxrl@users.noreply.github.com>
@nicholaspai nicholaspai requested a review from pxrl November 14, 2023 12:08
nicholaspai and others added 2 commits November 14, 2023 09:57
Co-authored-by: Paul <108695806+pxrl@users.noreply.github.com>
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.

Responded to your responses!

@nicholaspai nicholaspai requested a review from mrice32 November 14, 2023 20:19
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.

This scaffolding looks great! LGTM!

@nicholaspai nicholaspai merged commit 4f33de1 into master Nov 26, 2023
@nicholaspai nicholaspai deleted the npai/usslib branch November 26, 2023 14:44
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.

4 participants