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

feat: Add relayer repayment address #653

Merged
merged 7 commits into from
Oct 22, 2024

Conversation

chrismaree
Copy link
Member

@chrismaree chrismaree commented Oct 11, 2024

This PR changes the interface of two existing EVM functions: fillV3Relay & fillV3RelayWithUpdatedDeposit. They are extended to now contain repaymentAddress as the address the relayer wants to get repaid on on chain repaymentChainId.

one open question: do we want to support the old fillV3Relay interface, without this new prop, that just internally maps this address to msg.sender on EVM? this will enable current relayers to continue to work without requiring them to upgrade. main reason against having this backwards compatibility is we are adding breaking changes in other places (eg here: #650) that will also force relayes to upgrade so it could be argued that we should simple upgrade all the things at once without backwards compatibility in any location.

Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
@chrismaree chrismaree changed the title Add relayer repayment address feat: Add relayer repayment address Oct 14, 2024
Signed-off-by: chrismaree <[email protected]>
@chrismaree chrismaree marked this pull request as ready for review October 14, 2024 12:16
@pxrl
Copy link
Contributor

pxrl commented Oct 15, 2024

This change looks clean to me; I don't have any comments to the changes. Will leave opportunity for others to comment before approving.

one open question: do we want to support the old fillV3Relay interface, without this new prop, that just internally maps this address to msg.sender on EVM? this will enable current relayers to continue to work without requiring them to upgrade. main reason against having this backwards compatibility is we are adding breaking changes in other places (eg here: #650) that will also force relayes to upgrade so it could be argued that we should simple upgrade all the things at once without backwards compatibility in any location.

I think relayers will just deal with this but it's a headache for other integrators who are running infra against Across. Aggregators are an example - Socket and Li.Fi both have their own explorer implementations and they have specific knowledge about Across events. Wallet integrations is probably another stakeholder - Rabby can for instance decode Across transactions, so it'll probably impose some subtle breakage for them.

It's unfortunate they we'll be breaking some integrations and will be imposing re-work, though I should note it's not the first time that this will be happening because we already have an ABI break for events in the current audit (RE deterministic deposit IDs). I don't think there's necessarily anything to do differently here - we should just be extra persuasive in encouraging integrators to migrate to our new app SDK, which will permit us to handle the breakage internally, such that others can make the transition by upgrading their package.

@nicholaspai nicholaspai added the do not merge do not merge label Oct 15, 2024
@@ -1311,7 +1311,7 @@ abstract contract SpokePool is
// exclusiveRelayer if passed exclusivityDeadline or if slow fill.
function _fillRelayV3(
Copy link
Member Author

Choose a reason for hiding this comment

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

^

@chrismaree chrismaree changed the base branch from master to svm-dev October 16, 2024 12:39
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.

Only one comment

@@ -1311,7 +1311,7 @@ abstract contract SpokePool is
// exclusiveRelayer if passed exclusivityDeadline or if slow fill.
function _fillRelayV3(
V3RelayExecutionParams memory relayExecution,
address relayer,
bytes32 relayer,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we change this to repaymentAddress for consistency?

Copy link
Member Author

Choose a reason for hiding this comment

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

we could BUT it's called relayer in the event and we don't really want to change the name there, do we?

@mrice32
Copy link
Contributor

mrice32 commented Oct 16, 2024

This change looks clean to me; I don't have any comments to the changes. Will leave opportunity for others to comment before approving.

one open question: do we want to support the old fillV3Relay interface, without this new prop, that just internally maps this address to msg.sender on EVM? this will enable current relayers to continue to work without requiring them to upgrade. main reason against having this backwards compatibility is we are adding breaking changes in other places (eg here: #650) that will also force relayes to upgrade so it could be argued that we should simple upgrade all the things at once without backwards compatibility in any location.

I think relayers will just deal with this but it's a headache for other integrators who are running infra against Across. Aggregators are an example - Socket and Li.Fi both have their own explorer implementations and they have specific knowledge about Across events. Wallet integrations is probably another stakeholder - Rabby can for instance decode Across transactions, so it'll probably impose some subtle breakage for them.

It's unfortunate they we'll be breaking some integrations and will be imposing re-work, though I should note it's not the first time that this will be happening because we already have an ABI break for events in the current audit (RE deterministic deposit IDs). I don't think there's necessarily anything to do differently here - we should just be extra persuasive in encouraging integrators to migrate to our new app SDK, which will permit us to handle the breakage internally, such that others can make the transition by upgrading their package.

I agree. I think we should batch any updates to interfaces/abis.

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.

One open question is whether we should keep a backwards compatible fill interface.

This ties into how we're planning to orchestrate the migration. My straw man:

  • We keep RelayData hash abi compatible (I think we can do this), so we know that old deposits and new deposits will collide if they have the same info.
  • Both fill functions can still work with both the old deposit event and new deposit event.
  • We keep both fill functions even after we do the deposit event upgrade, so relayers must start watching the new event, but can migrate the fill function they call at their own leisure. Old fill function is considered deprecated.
  • We remove the old fill function in a later upgrade.

Thoughts?

@chrismaree
Copy link
Member Author

One open question is whether we should keep a backwards compatible fill interface.

This ties into how we're planning to orchestrate the migration. My straw man:

  • We keep RelayData hash abi compatible (I think we can do this), so we know that old deposits and new deposits will collide if they have the same info.
  • Both fill functions can still work with both the old deposit event and new deposit event.
  • We keep both fill functions even after we do the deposit event upgrade, so relayers must start watching the new event, but can migrate the fill function they call at their own leisure. Old fill function is considered deprecated.
  • We remove the old fill function in a later upgrade.

Thoughts?

I like this and it leans into why I wanted to keep the event structure the same and only change the relayer field :)

@@ -256,7 +256,7 @@ pub fn execute_v3_slow_relay_leaf(
fill_deadline: relay_data.fill_deadline,
exclusivity_deadline: relay_data.exclusivity_deadline,
exclusive_relayer: relay_data.exclusive_relayer,
relayer: *ctx.accounts.signer.key,
relayer: Pubkey::default(), // There is no repayment address for slow
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Why are we moving from the relayer public key to address_zero here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we had it wrong and EVM implementation passes empty address as well

Copy link
Contributor

@md0x md0x left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just had a question

Copy link
Contributor

@Reinis-FRP Reinis-FRP left a comment

Choose a reason for hiding this comment

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

looking good

@@ -52,7 +52,7 @@ const DEFAULT_CONTRACT_COMPILER_SETTINGS = {
optimizer: { enabled: true, runs: 1000000 },
viaIR: true,
// Only strip revert strings if not testing or in ci.
debug: { revertStrings: isTest ? "default" : "strip" },
debug: { revertStrings: isTest ? "debug" : "strip" },
Copy link
Member Author

Choose a reason for hiding this comment

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

^

Copy link
Contributor

Choose a reason for hiding this comment

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

Very odd 🤔

Signed-off-by: chrismaree <[email protected]>
@chrismaree chrismaree merged commit aa36eb6 into svm-dev Oct 22, 2024
9 checks passed
@chrismaree chrismaree deleted the chrismaree/add-repayment-address branch October 22, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge do not merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants