-
Notifications
You must be signed in to change notification settings - Fork 75
feat: Add relayer repayment address #653
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
Changes from 5 commits
a2e4842
41bd6c0
fee79f3
7b9cd50
fa1d38f
e3b320c
7f31b38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,7 +134,7 @@ abstract contract SpokePool is | |
| uint256 public constant EMPTY_REPAYMENT_CHAIN_ID = 0; | ||
| // Default address used to signify that no relayer should be credited with a refund, for example | ||
| // when executing a slow fill. | ||
| address public constant EMPTY_RELAYER = address(0); | ||
| bytes32 public constant EMPTY_RELAYER = bytes32(0); | ||
| // This is the magic value that signals to the off-chain validator | ||
| // that this deposit can never expire. A deposit with this fill deadline should always be eligible for a | ||
| // slow fill, meaning that its output token and input token must be "equivalent". Therefore, this value is only | ||
|
|
@@ -830,12 +830,11 @@ abstract contract SpokePool is | |
| * @param repaymentChainId Chain of SpokePool where relayer wants to be refunded after the challenge window has | ||
| * passed. Will receive inputAmount of the equivalent token to inputToken on the repayment chain. | ||
| */ | ||
| function fillV3Relay(V3RelayData calldata relayData, uint256 repaymentChainId) | ||
| public | ||
| override | ||
| nonReentrant | ||
| unpausedFills | ||
| { | ||
| function fillV3Relay( | ||
| V3RelayData calldata relayData, | ||
| uint256 repaymentChainId, | ||
| bytes32 repaymentAddress | ||
| ) public override nonReentrant unpausedFills { | ||
| // Exclusivity deadline is inclusive and is the latest timestamp that the exclusive relayer has sole right | ||
| // to fill the relay. | ||
| if ( | ||
|
|
@@ -855,7 +854,7 @@ abstract contract SpokePool is | |
| repaymentChainId: repaymentChainId | ||
| }); | ||
|
|
||
| _fillRelayV3(relayExecution, msg.sender, false); | ||
| _fillRelayV3(relayExecution, repaymentAddress, false); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -878,6 +877,7 @@ abstract contract SpokePool is | |
| function fillV3RelayWithUpdatedDeposit( | ||
| V3RelayData calldata relayData, | ||
| uint256 repaymentChainId, | ||
| bytes32 repaymentAddress, | ||
| uint256 updatedOutputAmount, | ||
| address updatedRecipient, | ||
| bytes calldata updatedMessage, | ||
|
|
@@ -908,7 +908,7 @@ abstract contract SpokePool is | |
| depositorSignature | ||
| ); | ||
|
|
||
| _fillRelayV3(relayExecution, msg.sender, false); | ||
| _fillRelayV3(relayExecution, repaymentAddress, false); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -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, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we change this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could BUT it's called |
||
| bool isSlowFill | ||
| ) internal { | ||
| V3RelayData memory relayData = relayExecution.relay; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,7 +43,7 @@ const LARGE_CONTRACT_COMPILER_SETTINGS = { | |
| settings: { | ||
| optimizer: { enabled: true, runs: 1000 }, | ||
| viaIR: true, | ||
| debug: { revertStrings: isTest ? "default" : "strip" }, | ||
| debug: { revertStrings: isTest ? "debug" : "strip" }, | ||
| }, | ||
| }; | ||
| const DEFAULT_CONTRACT_COMPILER_SETTINGS = { | ||
|
|
@@ -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" }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very odd 🤔 |
||
| }, | ||
| }; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -260,7 +260,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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| depositor: relay_data.depositor, | ||
| recipient: relay_data.recipient, | ||
| message: relay_data.message, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^