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

refactor: optional mailbox on warp config #5500

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

mshojaei-txfusion
Copy link
Collaborator

Description

This PR updates the warp route deployment configuration to handle mailbox addresses more consistently. Key changes:

  • Makes mailbox optional in the WarpRouteDeployConfig schema
  • Introduces a new WarpRouteDeployConfigMailboxRequired type for internal use
  • Updates the config filling logic to handle mailbox addresses through the context
  • Removes direct mailbox address prompting during config creation

Drive-by changes

  • Cleaned up some unused imports
  • Improved type safety around mailbox requirements
  • Updated tests to reflect new mailbox handling

Related issues

#5258

Backward compatibility

Yes - This change maintains backward compatibility while improving the internal handling of mailbox addresses.

Testing

Unit Tests - Existing tests have been updated to accommodate the new mailbox handling approach

Copy link

changeset-bot bot commented Feb 18, 2025

🦋 Changeset detected

Latest commit: 1c322ec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@hyperlane-xyz/cli Minor
@hyperlane-xyz/sdk Minor
@hyperlane-xyz/infra Minor
@hyperlane-xyz/helloworld Minor
@hyperlane-xyz/widgets Minor
@hyperlane-xyz/ccip-server Minor
@hyperlane-xyz/github-proxy Minor
@hyperlane-xyz/utils Minor
@hyperlane-xyz/core Patch

Not sure what this means? Click here to learn what changesets are.

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

@mshojaei-txfusion mshojaei-txfusion changed the title Refactor/optional mailbox on warp config refactor: optional mailbox on warp config Feb 18, 2025
@@ -125,6 +125,8 @@ async function getConfigFromMergedRegistry(
true,
).getWarpDeployConfig(warpRouteId);
assert(warpRoute, `Warp route Config not found for ${warpRouteId}`);
//TODO: fix this and manage mailbox
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nambrot Can you please take a look at this?
should I handle mailbox on infra side or on registry itself?
So I need to do similar thing fillDefaults did on cli.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As mailbox may not return when we call getWarpDeployConfig from registry

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the Registry should handle this, given that the mailbox address comes from the Registry

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Make sense, so we would return required mailbox deploy config type on registry.
And registry would get it from warp config in case provided, otherwise would get it from core contracts.
can you both approve this?
@ltyu @nambrot

Copy link
Contributor

Choose a reason for hiding this comment

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

on second thought, i am kind of leaning towards keeping that Registry function as is i.e. to fetch the non-derived.

do the callers actually need the mailbox here?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a great question, I'm inclined to change the return type here and then see where it breaks. Generally speaking would prefer to pass around the "simpler" version and then only "hydrate" the config when necessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe this would be needed on deploy script of infra, so we really needed and should decide for the way we get it.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah lets keep the Registry as is and then do some sort of filldefault() here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

got it, done!

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.53%. Comparing base (ea429f5) to head (1ee2802).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5500   +/-   ##
=======================================
  Coverage   77.53%   77.53%           
=======================================
  Files         103      103           
  Lines        2110     2110           
  Branches      190      190           
=======================================
  Hits         1636     1636           
  Misses        453      453           
  Partials       21       21           
Components Coverage Δ
core 87.80% <ø> (ø)
hooks 79.39% <ø> (ø)
isms 83.68% <ø> (ø)
token 91.27% <ø> (ø)
middlewares 79.80% <ø> (ø)
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@nambrot nambrot left a comment

Choose a reason for hiding this comment

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

Would like explicit approval from @ltyu as well but lgtm

@nambrot nambrot enabled auto-merge March 7, 2025 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants