-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: CCIPConfig, adding exhaustive checks for p2pIds and bootstrapP2…
…PIds (#1178) ## Motivation In `CCIPConfig._validateConfig` we try to do an exhaustive amount of validations, the following validations remained 1. Check whether a duplicate bootstrap P2P id, P2P id, signer, or transmitter was passed in. 2. Check that p2p ids in cfg.bootstrapP2PIds are included in cfg.p2pIds Ticket [CCIP-2595](https://smartcontract-it.atlassian.net/browse/CCIP-2595) ## Solution Created a library `SortedSetValidationUtil` in chainlink main-repo smartcontractkit/chainlink#13774 to support these sort, duplicate and subset check in `CCIPConfig`. These changes are cherry-picked This library can also be used in the optimisation of `CCIPConfigArraysValidation._ensureInRegistry` Regarding 1 : Since each p2pId at index i corresponds to the signer at index i both arrays can't be sorted at the same time. Hence, we are going the enforce that p2pIds and bootstrapP2PIds are sent sorted on function calls to in `CCIPConfig ` contract. This means that these exhaustive checks for ` bytes[] signers` and ` bytes[] transmitters` needs to be done in off-chain tooling. [CCIP-2595]: https://smartcontract-it.atlassian.net/browse/CCIP-2595?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Signed-off-by: 0xsuryansh <[email protected]>
- Loading branch information
1 parent
560a5f3
commit 2bb582b
Showing
11 changed files
with
441 additions
and
30 deletions.
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 @@ | ||
--- | ||
'@chainlink/contracts': minor | ||
--- | ||
|
||
We have multiple validation use-cases on-chain which requires the inputs to be a set, sorted-set or we need to do subset checks.Adding a library for these validations |
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
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
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
Oops, something went wrong.