-
Notifications
You must be signed in to change notification settings - Fork 104
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
[WIP] [fix]: Address UMIP-179 feedback #602
Draft
pxrl
wants to merge
4
commits into
master
Choose a base branch
from
pxrl-umip-179-clarification
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+18
−10
Draft
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -257,6 +257,11 @@ For a validated `FilledV3Relay` event, the relayer repayment amount shall be com | |||||
- `(inputAmount * (1 - realizedLpFeePct)) / 1e18`, where `realizedLpFeePct` is computed over the set of HubPool `l1Token`, `originChainId` and `repaymentChainId` at the HubPool block number corresponding to the relevant `V3FundsDeposited` `quoteTimestamp`. | ||||||
- The applicable rate model shall be sourced from the AcrossConfigStore contract for the relevant `l1Token`. | ||||||
|
||||||
If a validated `FilledV3Relay` event specifies an invalid `repaymentChainId`, the proposer shall issue repayment on the fill destination chain. | ||||||
Reasons for the `repaymentChainId` to be considered invalid are: | ||||||
- `repaymentChainId` is not supported by Across. | ||||||
- `inputToken` is not supported as a repayment token on `repaymentChainId`. | ||||||
|
||||||
### Computing Deposit Refunds | ||||||
For an expired `V3FundsDeposited` event, the depositor refund amount shall be computed as `inputAmount` units of `inputToken`. | ||||||
|
||||||
|
@@ -368,7 +373,7 @@ Each Relayer Refund Leaf shall be constructed as follows: | |||||
1. `refundAmount` descending order, then | ||||||
2. `relayerAddress` ascending order (in case of duplicate `refundAmount` values). | ||||||
|
||||||
In the event that the number of refunds contained within a Relayer Refund leaf should exceed [`MAX_RELAYER_REPAYMENT_LEAF_SIZE`]((https://github.com/UMAprotocol/UMIPs/blob/7b1a046098d3e2583abd0372c5e9c6003b46ad92/UMIPs/umip-157.md#global-constants) refunds: | ||||||
In the event that the number of refunds contained within a Relayer Refund leaf should exceed [`MAX_RELAYER_REPAYMENT_LEAF_SIZE`](https://github.com/UMAprotocol/UMIPs/blob/7b1a046098d3e2583abd0372c5e9c6003b46ad92/UMIPs/umip-157.md#global-constants) refunds: | ||||||
1. Additional `RelayerRefundLeaf` instances shall be produced to accomodate the excess. | ||||||
2. The ordering of `refundAddresses` and `refundAmounts` shall be maintained across the ordered array of leaves. | ||||||
3. Only the first leaf for a given `l2TokenAddress` shall contain a non-zero `amountToReturn`. | ||||||
|
@@ -380,6 +385,12 @@ The set of relayer refund leaves shall be ordered according to: | |||||
|
||||||
The Relayer Refund Leaf `leafId` field shall be numbered according to the ordering established above, starting at 0. | ||||||
|
||||||
If a Relayer Refund Leaf would be unable to be executed due to an ERC20 reversion when transferring the repayment token to the recipient on the destination chain, the proposer may exclude the relayer repayment from the Relayer Refund Root. | ||||||
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. Two things:
|
||||||
Note: | ||||||
- This is intended to deal with unlikely situations, such as a centralized token issuer censoring transactions concerning a relayer address, and is required to prevent deadlocking of all other relayer repayments in the same Relayer Refund Leaf. | ||||||
- In the event of relayer repayment exclusion, the proposer should provide reproducible evidence that the relayer repayment would fail as part of any subsequent dispute. | ||||||
|
||||||
|
||||||
Note: | ||||||
- Once these leaves are constructed, they can be used to form a merkle root as described in the previous section. | ||||||
|
||||||
|
@@ -413,7 +424,4 @@ The V3 rules defined in this UMIP will apply beginning when the VERSION field in | |||||
The Across v3 implementation is available in the Across [contracts-v2](https://github.com/across-protocol/contracts-v2) repository. | ||||||
|
||||||
# Security considerations | ||||||
Across v3 has been audited by OpenZeppelin. | ||||||
|
||||||
Note: | ||||||
- If a particular relayer refund is known to be unexecutable, it can be removed from the bundle by the proposer if a sufficient public justification is made before the proposal. This is intended to deal with unlikely situations, such as ag centralized token issuer blacklisting an address that is due a refund. If this leaf were to remain unaltered, this blacklisted address could block other addresses from recieving refunds. | ||||||
Across v3 has been [audited by OpenZeppelin](https://blog.openzeppelin.com/across-v3-incremental-audit). | ||||||
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.
Suggested change
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think forcing repayment on the destination chain is the only safe approach here, since if the relayer fills via a contract on zkSync and the proposer proposes repayment on some other chain then the relayer will never receive their repayment.
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.
Yeah, good point. I think that's right.