forked from informalsystems/hermes
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a filter for memo and receiver field size (informalsystems#3765)
* New configuration for max memo and receiver size * Do not relay packets which have memo or receiver field too big * Update defaults * Rename configurations max_memo_size and max_receiver_size to ics20_max_memo_size and ics20_max_receiver_size * Improve max memo and receiver configuration * Add changelog entry * Change type of ics20_max_memo_size and ics20_max_receiver_size to byte_unit Byte type * Pass LinkParameters to new method for Link and RelayPath * Refactor memo and receiver field validation for ICS20 packets * Update crates/relayer-types/src/core/ics04_channel/packet.rs Co-authored-by: Romain Ruetschi <[email protected]> Signed-off-by: Luca Joss <[email protected]> * Remove unnecessary errors and error maping * Apply suggestions from code review Co-authored-by: Romain Ruetschi <[email protected]> Signed-off-by: Luca Joss <[email protected]> * Change max_memo_size and max_receiver_size fields from u64 to usize * Improve doc for 'are_fields_valid' method * Improve logging when validating memo and receiver fields * Apply suggestions from code review Co-authored-by: Romain Ruetschi <[email protected]> Signed-off-by: Luca Joss <[email protected]> * Refactor ICS20 memo and receiver field configuration and validation * Improve documentation of memo and receiver filter configuration * Fix clippy error * Add test for memo filter * Formatting * Revert formatting change to otherwise untouched file * Simplify ICS-20 checks a little bit * Perform ICS-20 checks on all packet events * Improve comment in memo filter test --------- Signed-off-by: Luca Joss <[email protected]> Co-authored-by: Romain Ruetschi <[email protected]>
- Loading branch information
Showing
19 changed files
with
342 additions
and
9 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
.changelog/unreleased/features/ibc-relayer/3766-max-memo-receiver-config.md
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,6 @@ | ||
- Add two new packet configurations: | ||
* `ics20_max_memo_size` which filters ICS20 packets with memo | ||
field bigger than the configured value | ||
* `ics20_max_receiver_size` which filters ICS20 packets with receiver | ||
field bigger than the configured value | ||
([\#3766](https://github.com/informalsystems/hermes/issues/3766)) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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.