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

Use app context classifier in relayer submitter queues #3385

Merged
merged 11 commits into from
Mar 13, 2024

Conversation

daniel-savu
Copy link
Contributor

@daniel-savu daniel-savu commented Mar 11, 2024

Description

Includes the app_context classification in PendingMessage, and adds trait methods on PendingOperation to require always having such a label on OpQueue operations. This is done by reusing the matching list logic from the validator checkpoint labels (#3057).

The nice thing is that this enables later support for retrying a group of OpQueue operations just by specifying the app_context label, without adding any new logic, since these labels are essentially matching list results. One downside to using app_context for retries is that the endpoint caller is constrained to only the matching lists defined by the relayer operator - however imo only the relayer operator that should be able to trigger retries.

Drive-by changes

The OpQueue type alias is converted to an actual struct, that stores the queue label (for metrics purposes), and also the IntGaugeVec metric: the generic group of metrics associated with that queue (basically only submitter_queue_length currently).

Related issues

Backward compatibility

Yes

Testing

Manual, by spinning up a relayer for injective and inevm. Sample metrics, from --metricAppContexts '[{"name": "injectivelabel", "matchingList": [{"destination_domain": 6909546 }] }, {"name": "inevmlabel", "matchingList": [{"destination_domain": 2525 }] }]'

hyperlane_submitter_queue_length{agent="relayer",app_context="inevmlabel",hyperlane_baselib_version="0.1.0",queue_name="confirm_queue",remote="inevm"} 11
hyperlane_submitter_queue_length{agent="relayer",app_context="inevmlabel",hyperlane_baselib_version="0.1.0",queue_name="prepare_queue",remote="inevm"} 0
hyperlane_submitter_queue_length{agent="relayer",app_context="injectivelabel",hyperlane_baselib_version="0.1.0",queue_name="confirm_queue",remote="injective"} 63
hyperlane_submitter_queue_length{agent="relayer",app_context="injectivelabel",hyperlane_baselib_version="0.1.0",queue_name="prepare_queue",remote="injective"} 13281

Copy link

changeset-bot bot commented Mar 11, 2024

⚠️ No Changeset found

Latest commit: b015bb3

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

@daniel-savu daniel-savu marked this pull request as ready for review March 11, 2024 18:31
@daniel-savu daniel-savu changed the title wip: use app context classifier in relayer prep queue Use app context classifier in relayer submitter queues Mar 11, 2024
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Merging #3385 (b015bb3) into main (d1ce4fe) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3385   +/-   ##
=======================================
  Coverage   68.02%   68.02%           
=======================================
  Files          99       99           
  Lines        1032     1032           
  Branches      107      107           
=======================================
  Hits          702      702           
  Misses        284      284           
  Partials       46       46           
Components Coverage Δ
core 56.25% <ø> (ø)
hooks 68.79% <ø> (ø)
isms 65.94% <ø> (ø)
token 58.41% <ø> (ø)
middlewares 80.18% <ø> (ø)

rust/agents/relayer/src/msg/pending_message.rs Outdated Show resolved Hide resolved
rust/agents/relayer/src/msg/processor.rs Outdated Show resolved Hide resolved
@daniel-savu daniel-savu enabled auto-merge (squash) March 13, 2024 15:52
@daniel-savu daniel-savu merged commit 8ea0bde into main Mar 13, 2024
34 checks passed
@daniel-savu daniel-savu deleted the dan/prep-queue-labels branch March 13, 2024 16:10
yorhodes pushed a commit that referenced this pull request Mar 22, 2024
### Description

Includes the `app_context` classification in `PendingMessage`, and adds
trait methods on `PendingOperation` to require always having such a
label on `OpQueue` operations. This is done by reusing the matching list
logic from the validator checkpoint labels
(#3057).

The nice thing is that this enables later support for retrying a group
of `OpQueue` operations just by specifying the `app_context` label,
without adding any new logic, since these labels are essentially
matching list results. One downside to using `app_context` for retries
is that the endpoint caller is constrained to only the matching lists
defined by the relayer operator - however imo only the relayer operator
that should be able to trigger retries.

### Drive-by changes

The `OpQueue` type alias is converted to an actual struct, that stores
the queue label (for metrics purposes), and also the `IntGaugeVec`
metric: the generic group of metrics associated with that queue
(basically only `submitter_queue_length` currently).

### Related issues

- Fixes #3240


### Backward compatibility

Yes

### Testing

Manual, by spinning up a relayer for injective and inevm. Sample
metrics, from `--metricAppContexts '[{"name": "injectivelabel",
"matchingList": [{"destination_domain": 6909546 }] }, {"name":
"inevmlabel", "matchingList": [{"destination_domain": 2525 }] }]'`
```
hyperlane_submitter_queue_length{agent="relayer",app_context="inevmlabel",hyperlane_baselib_version="0.1.0",queue_name="confirm_queue",remote="inevm"} 11
hyperlane_submitter_queue_length{agent="relayer",app_context="inevmlabel",hyperlane_baselib_version="0.1.0",queue_name="prepare_queue",remote="inevm"} 0
hyperlane_submitter_queue_length{agent="relayer",app_context="injectivelabel",hyperlane_baselib_version="0.1.0",queue_name="confirm_queue",remote="injective"} 63
hyperlane_submitter_queue_length{agent="relayer",app_context="injectivelabel",hyperlane_baselib_version="0.1.0",queue_name="prepare_queue",remote="injective"} 13281
```
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.

Use metricAppContexts in the relayer to give more granularity on the contents of the prepare queue
2 participants