feat(infra): implemented litkey warp route config getter#7224
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7224 +/- ##
=======================================
Coverage 75.52% 75.52%
=======================================
Files 108 108
Lines 2349 2349
Branches 206 206
=======================================
Hits 1774 1774
Misses 557 557
Partials 18 18
🚀 New features to boost your workflow:
|
📝 WalkthroughWalkthroughA new Warp route for Litchain LITKEY is added: a config getter constructs and exports a ChainMap of HypTokenRouterConfig across collateral, native, and synthetic chains; two utility helpers for per-chain token/native configs were added; the route ID and getter are registered in the global warp config map. Data-only tweaks updated Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant WarpRegistry as warpConfigGetterMap
participant Getter as getLitchainLITKEYWarpConfig
participant Utils as utils (collateral/native helpers)
participant RouterCfg as routerConfigByChain
participant Owners as ownersByChain
Caller->>WarpRegistry: request config for WarpRouteIds.LitchainLITKEY
WarpRegistry->>Getter: invoke getter(routerConfig)
Getter->>RouterCfg: read per-chain router configs
Getter->>Owners: read per-chain owners map
alt collateral chain
Getter->>Utils: call getCollateralTokenConfigForChain(chain,...)
else native chain
Getter->>Utils: call getNativeTokenConfigForChain(chain,...)
end
Utils->>RouterCfg: select mailbox/token
Utils->>Owners: assert owner exists
Utils-->>Getter: return HypTokenRouterConfig
Getter-->>WarpRegistry: return ChainMap<HypTokenRouterConfig>
WarpRegistry-->>Caller: deliver warp config
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (55)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
typescript/infra/config/environments/mainnet3/warp/configGetters/getLitLitchainWarpConfig.ts (2)
12-22: Nice type constraint for deployment chains.The
DeploymentChainstype provides good type safety by explicitly defining which chains are involved in this warp route. If this pattern shows up in multiple config getters, it might be worth extractin' a generic version, but for now this is perfectly fine.
24-32: Add a comment to clarify the collateral token addresses.The function name
getLitchainLITKEYWarpConfigtells us what's happening, but the code itself could use a bit more guidance. Similar to how theownersByChainhas a comment, thecollateralsByChainwould benefit from one too—just a simple note explaining these are LITKEY token addresses across those chains. Helps keep future maintainers from wondering.// LITKEY token addresses on respective chains const collateralsByChain: Pick< DeploymentChains<Address>, 'arbitrum' | 'base' | 'optimism' | 'ethereum' > = { arbitrum: '0xC7603786470F04D33E35f9E9B56bD0Ca8803fB95', base: '0xF732A566121Fa6362E9E0FBdd6D66E5c8C925E49', ethereum: '0x4D4eb0E8B160f6EbF63cC6d36060ffec09301B42', optimism: '0x0633E91f64C22d4FEa53dbE6e77B7BA4093177B8', };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
typescript/infra/config/environments/mainnet3/warp/configGetters/getLitLitchainWarpConfig.ts(1 hunks)typescript/infra/config/environments/mainnet3/warp/configGetters/utils.ts(2 hunks)typescript/infra/config/environments/mainnet3/warp/warpIds.ts(1 hunks)typescript/infra/config/warp.ts(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
typescript/infra/config/environments/mainnet3/warp/configGetters/getLitLitchainWarpConfig.ts (2)
typescript/infra/src/config/warp.ts (1)
RouterConfigWithoutOwner(84-84)typescript/infra/config/environments/mainnet3/warp/configGetters/utils.ts (3)
getCollateralTokenConfigForChain(106-129)getNativeTokenConfigForChain(148-163)getSyntheticTokenConfigForChain(131-146)
typescript/infra/config/warp.ts (1)
typescript/infra/config/environments/mainnet3/warp/configGetters/getLitLitchainWarpConfig.ts (1)
getLitchainLITKEYWarpConfig(50-105)
typescript/infra/config/environments/mainnet3/warp/configGetters/utils.ts (2)
typescript/sdk/src/index.ts (4)
ChainMap(741-741)ChainName(742-742)HypTokenRouterConfig(708-708)TokenType(644-644)typescript/infra/src/config/warp.ts (1)
RouterConfigWithoutOwner(84-84)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (54)
- GitHub Check: cli-evm-e2e-matrix (core-check)
- GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
- GitHub Check: cli-evm-e2e-matrix (warp-send)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-2)
- GitHub Check: cli-evm-e2e-matrix (warp-deploy)
- GitHub Check: cli-evm-e2e-matrix (warp-check-1)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
- GitHub Check: cli-evm-e2e-matrix (warp-read)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
- GitHub Check: cli-evm-e2e-matrix (relay)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
- GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
- GitHub Check: cli-evm-e2e-matrix (warp-check-3)
- GitHub Check: cli-evm-e2e-matrix (warp-init)
- GitHub Check: cli-evm-e2e-matrix (warp-check-2)
- GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-1)
- GitHub Check: env-test-matrix (mainnet3, inevm, core)
- GitHub Check: cli-evm-e2e-matrix (core-init)
- GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
- GitHub Check: env-test-matrix (testnet4, sepolia, core)
- GitHub Check: cli-evm-e2e-matrix (core-deploy)
- GitHub Check: env-test-matrix (mainnet3, inevm, igp)
- GitHub Check: env-test-matrix (mainnet3, optimism, igp)
- GitHub Check: cli-evm-e2e-matrix (core-apply)
- GitHub Check: env-test-matrix (mainnet3, ethereum, core)
- GitHub Check: cli-evm-e2e-matrix (core-read)
- GitHub Check: env-test-matrix (mainnet3, optimism, core)
- GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
- GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
- GitHub Check: cli-cosmos-e2e-matrix (warp-read)
- GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (core-check)
- GitHub Check: cli-cosmos-e2e-matrix (core-apply)
- GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (core-read)
- GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
- GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
- GitHub Check: cosmos-sdk-e2e-run
- GitHub Check: yarn-test-run
- GitHub Check: build-and-push-to-gcr
- GitHub Check: e2e-matrix (evm)
- GitHub Check: e2e-matrix (starknet)
- GitHub Check: e2e-matrix (radix)
- GitHub Check: lint-prettier
- GitHub Check: e2e-matrix (cosmosnative)
- GitHub Check: e2e-matrix (sealevel)
- GitHub Check: agent-configs (mainnet3)
- GitHub Check: yarn-install
- GitHub Check: agent-configs (testnet4)
- GitHub Check: lint-rs
- GitHub Check: test-rs
- GitHub Check: lander-coverage
🔇 Additional comments (7)
typescript/infra/config/environments/mainnet3/warp/warpIds.ts (1)
120-121: LGTM! Clean enum addition.The new
LitchainLITKEYmember follows the established naming pattern and fits right in with the other warp route identifiers.typescript/infra/config/warp.ts (2)
65-65: Good import placement.The import is positioned alphabetically among the other config getter imports, keepin' things organized.
182-182: Proper wiring into the config map.The new route is correctly registered in the
warpConfigGetterMap, making it accessible through the standard config retrieval flow.typescript/infra/config/environments/mainnet3/warp/configGetters/getLitLitchainWarpConfig.ts (2)
50-105: Well-structured config builder function.The function clearly separates collateral, native, and synthetic chain configurations using the utility helpers. The approach is consistent with other warp config getters in the codebase and makes the deployment topology easy to understand.
34-48: Manual verification of Safe wallet addresses required.The addresses are scoped only to this configuration file and don't create ripple effects elsewhere. However, confirming these are the actual correct Safe multisig wallets will need off-chain verification—checking team records or the addresses on-chain to make sure they line up with reality.
typescript/infra/config/environments/mainnet3/warp/configGetters/utils.ts (2)
106-129: Solid collateral config helper.This new utility follows the same pattern as the existing synthetic token helper and includes proper assertions for required fields. The generic type constraint ensures type safety across different owner address maps.
148-163: Proper native token config helper.This helper correctly handles native token configuration by omitting the
tokenfield (native tokens don't need a separate contract address) while still including the necessary mailbox and owner fields. Consistent with the pattern established by the other helpers.
…to xeno/lit-lithcain-deployment
Description
LITKEY warp route config getter
related registry PR: hyperlane-xyz/hyperlane-registry#1198
Drive-by changes
Related issues
Backward compatibility
Testing
Summary by CodeRabbit
New Features
Chores