Skip to content
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

Fix parsing sequences of H256s in a matchinglist via agent settings #3180

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

tkporter
Copy link
Collaborator

Description

Upon trying to use a blacklist with an array of H256s as the recipientAddress, was getting a panic:

running 1 test
parse_value: Array [Object {"destinationdomain": Number(11155111), "origindomain": Number(1399811151), "recipientaddress": Array [String("0x6AD4DEBA8A147d000C09de6465267a9047d1c217"), String("0x6AD4DEBA8A147d000C09de6465267a9047d1c218")], "senderaddress": Array [String("0x6AD4DEBA8A147d000C09de6465267a9047d1c217"), String("0x6AD4DEBA8A147d000C09de6465267a9047d1c218")]}] "Expected matching list"
thread 'settings::matching_list::test::supports_sequence_h256s' panicked at 'called `Result::unwrap()` on an `Err` value: ConfigParsingError([(ConfigPath([]), Expected matching list

Caused by:
    invalid type: string "0x6AD4DEBA8A147d000C09de6465267a9047d1c217", expected a borrowed string

Location:
    /Users/trevor/abacus-monorepo/rust/hyperlane-base/src/settings/parser/json_value_parser.rs:259:14)])', agents/relayer/src/settings/matching_list.rs:473:60
stack backtrace:
   0: rust_begin_unwind
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:593:5
   1: core::panicking::panic_fmt
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/result.rs:1651:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/result.rs:1076:23
   4: relayer::settings::matching_list::test::supports_sequence_h256s
             at ./src/settings/matching_list.rs:473:9
   5: relayer::settings::matching_list::test::supports_sequence_h256s::{{closure}}
             at ./src/settings/matching_list.rs:459:34
   6: core::ops::function::FnOnce::call_once
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/ops/function.rs:250:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test settings::matching_list::test::supports_sequence_h256s ... FAILED

Honestly not too sure about the implications of this being a String vs &str

Drive-by changes

Related issues

Backward compatibility

Testing

@tkporter tkporter requested a review from daniel-savu as a code owner January 24, 2024 16:35
Copy link

changeset-bot bot commented Jan 24, 2024

⚠️ No Changeset found

Latest commit: 9fe56a3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@daniel-savu daniel-savu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

codecov bot commented Jan 24, 2024

Codecov Report

Merging #3180 (9fe56a3) into main (528a190) will not change coverage.
Report is 1 commits behind head on main.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3180   +/-   ##
=======================================
  Coverage   67.18%   67.18%           
=======================================
  Files         101      101           
  Lines        1021     1021           
  Branches      106      106           
=======================================
  Hits          686      686           
  Misses        291      291           
  Partials       44       44           
Components Coverage Δ
core 50.00% <ø> (ø)
hooks 68.79% <ø> (ø)
isms 65.94% <ø> (ø)
token 54.62% <ø> (ø)
middlewares 81.46% <ø> (ø)

@tkporter tkporter enabled auto-merge (squash) January 24, 2024 16:45
@tkporter tkporter merged commit 6845f9f into main Jan 24, 2024
23 of 24 checks passed
@tkporter tkporter deleted the trevor/fix-matchinglist-seq-h256 branch January 24, 2024 17:01
ltyu pushed a commit to ltyu/hyperlane-monorepo that referenced this pull request Mar 13, 2024
…yperlane-xyz#3180)

### Description

Upon trying to use a blacklist with an array of H256s as the
`recipientAddress`, was getting a panic:
```
running 1 test
parse_value: Array [Object {"destinationdomain": Number(11155111), "origindomain": Number(1399811151), "recipientaddress": Array [String("0x6AD4DEBA8A147d000C09de6465267a9047d1c217"), String("0x6AD4DEBA8A147d000C09de6465267a9047d1c218")], "senderaddress": Array [String("0x6AD4DEBA8A147d000C09de6465267a9047d1c217"), String("0x6AD4DEBA8A147d000C09de6465267a9047d1c218")]}] "Expected matching list"
thread 'settings::matching_list::test::supports_sequence_h256s' panicked at 'called `Result::unwrap()` on an `Err` value: ConfigParsingError([(ConfigPath([]), Expected matching list

Caused by:
    invalid type: string "0x6AD4DEBA8A147d000C09de6465267a9047d1c217", expected a borrowed string

Location:
    /Users/trevor/abacus-monorepo/rust/hyperlane-base/src/settings/parser/json_value_parser.rs:259:14)])', agents/relayer/src/settings/matching_list.rs:473:60
stack backtrace:
   0: rust_begin_unwind
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:593:5
   1: core::panicking::panic_fmt
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/result.rs:1651:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/result.rs:1076:23
   4: relayer::settings::matching_list::test::supports_sequence_h256s
             at ./src/settings/matching_list.rs:473:9
   5: relayer::settings::matching_list::test::supports_sequence_h256s::{{closure}}
             at ./src/settings/matching_list.rs:459:34
   6: core::ops::function::FnOnce::call_once
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/ops/function.rs:250:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test settings::matching_list::test::supports_sequence_h256s ... FAILED
```

Honestly not too sure about the implications of this being a String vs
&str

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants