-
Notifications
You must be signed in to change notification settings - Fork 34
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
MultiAggregateRateLimiter - validation based contract with OffRamp implementation #916
Merged
Merged
Changes from 11 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8526467
feat: replace ARL with message validation hook on multi-offramp
elatoskinas 5499569
feat: create multi-arl contract
elatoskinas f3f9899
feat: convert multi-arl contract to message validator
elatoskinas 9843abe
perf: remove PriceRegistry from MultiOffRamp
elatoskinas f53a3bc
refactor: move multi-ARL to validators
elatoskinas 18b7125
perf: remove PriceRegistry param from getTokenValue
elatoskinas ea6d0cd
feat: catch all validation failures and create IMessageValidator helper
elatoskinas 6e15136
test: message validation in offramp
elatoskinas 54d86d1
test: multi-arl tests
elatoskinas 0841537
chore: create wrappers, snapshot & changesets
elatoskinas b67f9c2
refactor: move multi-arl back to root contracts dir
elatoskinas b56c0e8
perf: remove unnecessary variable caching and style changes
elatoskinas 74717ed
style: rename chainSelector to remoteChainSelector
elatoskinas c0e4414
feat: remove admin from multi-arl
elatoskinas d09db46
refactor: remove duplicated RateLimiter lib
elatoskinas 4183828
refactor: convert authorized callers to set with getter
elatoskinas 184ed13
refactor: rename tokens to local / remote
elatoskinas 6add009
feat: separate rate limits for incoming and outgoing lanes
elatoskinas ba202a7
refactor: rename validator to IMessageInterceptor
elatoskinas 27efcd7
refactor: replace bit manipulation approach with structs for lane sta…
elatoskinas f3b7b81
chore: generate wrappers
elatoskinas 9da9e68
Merge branch 'ccip-develop' into feat/multi-offramp-arl-hook
elatoskinas 4bb71ef
chore: re-gen snapshots and wrappers
elatoskinas 49d28b4
fix: non-ccip receiver message validation for offramp
elatoskinas f2a5195
Merge branch 'ccip-develop' into feat/multi-offramp-arl-hook
RensR 0faa19f
Merge branch 'ccip-develop' into feat/multi-offramp-arl-hook
elatoskinas 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"ccip": minor | ||
--- | ||
|
||
#changed Implement hook-based multi-aggregate rate limiter |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@chainlink/contracts-ccip": minor | ||
--- | ||
|
||
#changed Implement hook-based multi-aggregate rate limiter |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {Client} from "../libraries/Client.sol"; | ||
|
||
/// @notice Interface for plug-in message validator contracts that intercept OffRamp & OnRamp messages | ||
/// and perform validations on top of the messages. All validation functions are expected to | ||
/// revert on validation failures. | ||
interface IMessageValidator { | ||
/// @notice Common error that can be thrown on validation failures and used by consumers | ||
/// @param errorReason abi encoded revert reason | ||
error MessageValidationError(bytes errorReason); | ||
|
||
/// @notice Validates the given OffRamp message. Reverts on validation failure | ||
/// @param message to validate | ||
function validateIncomingMessage(Client.Any2EVMMessage memory message) external; | ||
elatoskinas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// @notice Validates the given OnRamp message. Reverts on validation failure | ||
/// @param message to valdidate | ||
/// @param destChainSelector dest chain selector where the message is being sent to | ||
function validateOutgoingMessage(Client.EVM2AnyMessage memory message, uint64 destChainSelector) external; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
note: would like to move this under a separate folder group (under
validators/
) - keeping in root for diff