@hyperlane-xyz/sdk 41.3.1 → 42.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ccip/consts.d.ts.map +1 -1
- package/dist/ccip/consts.js +20 -0
- package/dist/ccip/consts.js.map +1 -1
- package/dist/consts/multisigIsm.d.ts.map +1 -1
- package/dist/consts/multisigIsm.js +20 -0
- package/dist/consts/multisigIsm.js.map +1 -1
- package/dist/contracts/contracts.d.ts.map +1 -1
- package/dist/contracts/contracts.js +15 -0
- package/dist/contracts/contracts.js.map +1 -1
- package/dist/contracts/contracts.test.d.ts +2 -0
- package/dist/contracts/contracts.test.d.ts.map +1 -0
- package/dist/contracts/contracts.test.js +88 -0
- package/dist/contracts/contracts.test.js.map +1 -0
- package/dist/core/types.d.ts +80 -2602
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +19 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/types.test.js +58 -0
- package/dist/core/types.test.js.map +1 -1
- package/dist/deploy/warp.d.ts +119 -3
- package/dist/deploy/warp.d.ts.map +1 -1
- package/dist/deploy/warp.js +696 -33
- package/dist/deploy/warp.js.map +1 -1
- package/dist/deploy/warp.test.d.ts +2 -0
- package/dist/deploy/warp.test.d.ts.map +1 -0
- package/dist/deploy/warp.test.js +358 -0
- package/dist/deploy/warp.test.js.map +1 -0
- package/dist/deploy/warpHybridPlan.d.ts +104 -0
- package/dist/deploy/warpHybridPlan.d.ts.map +1 -0
- package/dist/deploy/warpHybridPlan.js +178 -0
- package/dist/deploy/warpHybridPlan.js.map +1 -0
- package/dist/deploy/warpHybridPlan.test.d.ts +2 -0
- package/dist/deploy/warpHybridPlan.test.d.ts.map +1 -0
- package/dist/deploy/warpHybridPlan.test.js +141 -0
- package/dist/deploy/warpHybridPlan.test.js.map +1 -0
- package/dist/hook/EvmHookModule.d.ts +1 -1
- package/dist/hook/EvmHookModule.d.ts.map +1 -1
- package/dist/hook/EvmHookModule.js +16 -3
- package/dist/hook/EvmHookModule.js.map +1 -1
- package/dist/hook/EvmHookReader.d.ts +10 -0
- package/dist/hook/EvmHookReader.d.ts.map +1 -1
- package/dist/hook/EvmHookReader.js +92 -11
- package/dist/hook/EvmHookReader.js.map +1 -1
- package/dist/hook/EvmHookReader.test.js +155 -1
- package/dist/hook/EvmHookReader.test.js.map +1 -1
- package/dist/hook/types.d.ts +107 -1983
- package/dist/hook/types.d.ts.map +1 -1
- package/dist/hook/types.js +49 -0
- package/dist/hook/types.js.map +1 -1
- package/dist/hook/types.test.js +21 -1
- package/dist/hook/types.test.js.map +1 -1
- package/dist/hook/updates.d.ts +1 -0
- package/dist/hook/updates.d.ts.map +1 -1
- package/dist/hook/updates.js +2 -2
- package/dist/hook/updates.js.map +1 -1
- package/dist/hook/utils.d.ts +28 -1
- package/dist/hook/utils.d.ts.map +1 -1
- package/dist/hook/utils.js +89 -0
- package/dist/hook/utils.js.map +1 -1
- package/dist/ica/types.d.ts +4 -674
- package/dist/ica/types.d.ts.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/ism/EvmIsmModule.d.ts +28 -2
- package/dist/ism/EvmIsmModule.d.ts.map +1 -1
- package/dist/ism/EvmIsmModule.hardhat-test.js +478 -3
- package/dist/ism/EvmIsmModule.hardhat-test.js.map +1 -1
- package/dist/ism/EvmIsmModule.js +224 -10
- package/dist/ism/EvmIsmModule.js.map +1 -1
- package/dist/ism/EvmIsmReader.d.ts.map +1 -1
- package/dist/ism/EvmIsmReader.js +77 -1
- package/dist/ism/EvmIsmReader.js.map +1 -1
- package/dist/ism/EvmIsmReader.test.js +245 -4
- package/dist/ism/EvmIsmReader.test.js.map +1 -1
- package/dist/ism/HyperlaneIsmFactory.d.ts +14 -4
- package/dist/ism/HyperlaneIsmFactory.d.ts.map +1 -1
- package/dist/ism/HyperlaneIsmFactory.hardhat-test.js +372 -3
- package/dist/ism/HyperlaneIsmFactory.hardhat-test.js.map +1 -1
- package/dist/ism/HyperlaneIsmFactory.js +80 -6
- package/dist/ism/HyperlaneIsmFactory.js.map +1 -1
- package/dist/ism/delayedFlow.d.ts +31 -0
- package/dist/ism/delayedFlow.d.ts.map +1 -0
- package/dist/ism/delayedFlow.js +33 -0
- package/dist/ism/delayedFlow.js.map +1 -0
- package/dist/ism/types.d.ts +135 -4
- package/dist/ism/types.d.ts.map +1 -1
- package/dist/ism/types.js +263 -11
- package/dist/ism/types.js.map +1 -1
- package/dist/ism/types.test.js +433 -1
- package/dist/ism/types.test.js.map +1 -1
- package/dist/ism/utils.d.ts.map +1 -1
- package/dist/ism/utils.js +113 -3
- package/dist/ism/utils.js.map +1 -1
- package/dist/ism/utils.test.js +44 -0
- package/dist/ism/utils.test.js.map +1 -1
- package/dist/providers/MultiProviderAdapter.d.ts +3 -3
- package/dist/providers/MultiProviderAdapter.d.ts.map +1 -1
- package/dist/providers/MultiProviderAdapter.js +2 -1
- package/dist/providers/MultiProviderAdapter.js.map +1 -1
- package/dist/providers/SmartProvider/HyperlaneJsonRpcProvider.d.ts.map +1 -1
- package/dist/providers/SmartProvider/HyperlaneJsonRpcProvider.js +4 -0
- package/dist/providers/SmartProvider/HyperlaneJsonRpcProvider.js.map +1 -1
- package/dist/providers/transactionFeeEstimators.d.ts +16 -9
- package/dist/providers/transactionFeeEstimators.d.ts.map +1 -1
- package/dist/providers/transactionFeeEstimators.js +66 -17
- package/dist/providers/transactionFeeEstimators.js.map +1 -1
- package/dist/providers/transactionFeeEstimators.test.js +153 -1
- package/dist/providers/transactionFeeEstimators.test.js.map +1 -1
- package/dist/providers/transactions/submitter/ethersV5/EV5JsonRpcTxSubmitter.d.ts +14 -1
- package/dist/providers/transactions/submitter/ethersV5/EV5JsonRpcTxSubmitter.d.ts.map +1 -1
- package/dist/providers/transactions/submitter/ethersV5/EV5JsonRpcTxSubmitter.js +46 -5
- package/dist/providers/transactions/submitter/ethersV5/EV5JsonRpcTxSubmitter.js.map +1 -1
- package/dist/providers/transactions/submitter/ethersV5/EV5JsonRpcTxSubmitter.test.d.ts +2 -0
- package/dist/providers/transactions/submitter/ethersV5/EV5JsonRpcTxSubmitter.test.d.ts.map +1 -0
- package/dist/providers/transactions/submitter/ethersV5/EV5JsonRpcTxSubmitter.test.js +125 -0
- package/dist/providers/transactions/submitter/ethersV5/EV5JsonRpcTxSubmitter.test.js.map +1 -0
- package/dist/router/HyperlaneRouterDeployer.d.ts +3 -1
- package/dist/router/HyperlaneRouterDeployer.d.ts.map +1 -1
- package/dist/router/HyperlaneRouterDeployer.js +4 -2
- package/dist/router/HyperlaneRouterDeployer.js.map +1 -1
- package/dist/router/types.d.ts +6 -1011
- package/dist/router/types.d.ts.map +1 -1
- package/dist/test/testUtils.d.ts +1 -1
- package/dist/test/testUtils.d.ts.map +1 -1
- package/dist/test/testUtils.js +17 -0
- package/dist/test/testUtils.js.map +1 -1
- package/dist/test/testUtils.test.d.ts +2 -0
- package/dist/test/testUtils.test.d.ts.map +1 -0
- package/dist/test/testUtils.test.js +28 -0
- package/dist/test/testUtils.test.js.map +1 -0
- package/dist/token/EvmWarpModule.d.ts +44 -8
- package/dist/token/EvmWarpModule.d.ts.map +1 -1
- package/dist/token/EvmWarpModule.hardhat-test.js +574 -4
- package/dist/token/EvmWarpModule.hardhat-test.js.map +1 -1
- package/dist/token/EvmWarpModule.js +237 -25
- package/dist/token/EvmWarpModule.js.map +1 -1
- package/dist/token/configUtils.d.ts +17 -7
- package/dist/token/configUtils.d.ts.map +1 -1
- package/dist/token/configUtils.js +108 -0
- package/dist/token/configUtils.js.map +1 -1
- package/dist/token/configUtils.test.js +155 -1
- package/dist/token/configUtils.test.js.map +1 -1
- package/dist/token/deploy.d.ts +3 -1
- package/dist/token/deploy.d.ts.map +1 -1
- package/dist/token/deploy.hardhat-test.js +454 -3
- package/dist/token/deploy.hardhat-test.js.map +1 -1
- package/dist/token/deploy.js +25 -6
- package/dist/token/deploy.js.map +1 -1
- package/dist/token/types.d.ts +169 -2931
- package/dist/token/types.d.ts.map +1 -1
- package/dist/token/types.test.js +48 -0
- package/dist/token/types.test.js.map +1 -1
- package/dist/token/warpCheck.d.ts.map +1 -1
- package/dist/token/warpCheck.js +36 -1
- package/dist/token/warpCheck.js.map +1 -1
- package/dist/utils/ism.d.ts +167 -1
- package/dist/utils/ism.d.ts.map +1 -1
- package/dist/utils/ism.js +412 -2
- package/dist/utils/ism.js.map +1 -1
- package/dist/utils/ism.test.d.ts +2 -0
- package/dist/utils/ism.test.d.ts.map +1 -0
- package/dist/utils/ism.test.js +372 -0
- package/dist/utils/ism.test.js.map +1 -0
- package/package.json +10 -10
package/dist/utils/ism.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Address, WithAddress } from '@hyperlane-xyz/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { TokenType } from '../token/config.js';
|
|
3
|
+
import { DelayedFlowRouterHookIsmConfig, IsmConfig, NetFlowRateLimitedHookIsmConfig } from '../ism/types.js';
|
|
3
4
|
type ChainAddresses = Record<string, string>;
|
|
4
5
|
/**
|
|
5
6
|
* Extracts the ISM and Hook factory addresses from chain-specific registry addresses
|
|
@@ -13,6 +14,171 @@ export declare function ismTreeContainsRateLimited(ism: unknown): boolean;
|
|
|
13
14
|
* `defaultOwner` is set on nodes that don't have an explicit owner.
|
|
14
15
|
*/
|
|
15
16
|
export declare function setRateLimitedIsmRecipient(ismConfig: IsmConfig, recipient: Address | undefined, defaultOwner?: string): IsmConfig;
|
|
17
|
+
export type HybridHookIsmConfig = NetFlowRateLimitedHookIsmConfig | DelayedFlowRouterHookIsmConfig;
|
|
18
|
+
/**
|
|
19
|
+
* True if a warp-route hybrid hook/ISM node (NET_FLOW_RATE_LIMITED or
|
|
20
|
+
* DELAYED_FLOW_ROUTER) exists anywhere in the ISM config tree.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ismTreeContainsHybridHookIsm(ism: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* True if a MAILBOX_DEFAULT or hybrid hook/ISM node exists anywhere in the
|
|
25
|
+
* tree. Used to keep warp-route-only and self-referential ISM types out of
|
|
26
|
+
* core default-ISM configs (see core/types.ts).
|
|
27
|
+
*/
|
|
28
|
+
export declare function ismTreeContainsMailboxDefaultOrHybrid(ism: unknown): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Deep-collects every hybrid hook/ISM node in an ISM config tree (including
|
|
31
|
+
* derived trees, whose nodes additionally carry an `address` field).
|
|
32
|
+
*/
|
|
33
|
+
export declare function collectHybridIsmNodes(ism: IsmConfig): HybridHookIsmConfig[];
|
|
34
|
+
/**
|
|
35
|
+
* Recursively maps every hybrid hook/ISM node in an ISM config tree
|
|
36
|
+
* (traversing aggregation/routing/amount-routing containers), leaving all
|
|
37
|
+
* other nodes untouched.
|
|
38
|
+
*/
|
|
39
|
+
export declare function mapHybridIsmNodes(ismConfig: IsmConfig, mapNode: (node: HybridHookIsmConfig) => IsmConfig): IsmConfig;
|
|
40
|
+
/**
|
|
41
|
+
* Rejects combining a predicate wrapper with a hybrid hook/ISM.
|
|
42
|
+
*
|
|
43
|
+
* Both want to own the router's hook slot: the hybrid instance must BE the
|
|
44
|
+
* hook (shared bucket state with its ISM role), while the predicate wrapper
|
|
45
|
+
* installs `aggregation([wrapper, previousHook])`. Nesting the hybrid inside
|
|
46
|
+
* that aggregation is mechanically possible — StaticAggregationHook forwards
|
|
47
|
+
* each child its own `quoteDispatch` amount, which is what the hybrid's nested
|
|
48
|
+
* `_Router_dispatch` needs — but only on the native-fee path: when the
|
|
49
|
+
* dispatch metadata names a non-zero `feeToken`, the aggregation passes
|
|
50
|
+
* `value: 0` to every child, starving the hybrid's nested dispatch. Until that
|
|
51
|
+
* path is verified at the contract level, the combination is rejected rather
|
|
52
|
+
* than silently producing a route whose policy hook or flow limiter is
|
|
53
|
+
* missing from the dispatch path.
|
|
54
|
+
*
|
|
55
|
+
* TODO(hybrid+predicate composition verified): allow composing the two by
|
|
56
|
+
* threading the hybrid address into PredicateWrapperDeployer.deployAndConfigure
|
|
57
|
+
* as `existingHookOverride`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function assertNoPredicateWrapperWithHybridIsm(chain: string, config: unknown): void;
|
|
60
|
+
/**
|
|
61
|
+
* Rejects a hybrid hook/ISM on a router implementation it cannot meter.
|
|
62
|
+
*
|
|
63
|
+
* Enforced on every path that can install a hybrid on a router — deploy
|
|
64
|
+
* (assertHybridIsmDeployConstraints) and `warp apply`
|
|
65
|
+
* (EvmWarpModule.createHookAndPredicateUpdateTxs). A hybrid on, say, a
|
|
66
|
+
* collateralVault router deploys fine (the constructor only reads `token()`)
|
|
67
|
+
* and then reverts on every dispatch and delivery, because `localCollateral()`
|
|
68
|
+
* calls `totalAssets()` on a router that is not an `LpCollateralRouter`.
|
|
69
|
+
*/
|
|
70
|
+
export declare function assertHybridIsmTokenTypeSupported(chain: string, type: TokenType | undefined): void;
|
|
71
|
+
/**
|
|
72
|
+
* Replaces every hybrid hook/ISM node in an ISM tree with the address of the
|
|
73
|
+
* already-deployed instance.
|
|
74
|
+
*
|
|
75
|
+
* The hybrid leaf is deployed exactly once per chain and shared between the
|
|
76
|
+
* router's hook and ISM surfaces, so the parent tree handed to EvmIsmModule
|
|
77
|
+
* must reference it by address rather than re-declaring it — otherwise the
|
|
78
|
+
* parent deploy would mint a second instance with its own bucket state.
|
|
79
|
+
* Sibling of `resolveHybridHookNodesToAddress` on the hook surface.
|
|
80
|
+
*/
|
|
81
|
+
export declare function resolveHybridIsmNodesToAddress(ismConfig: IsmConfig, address: Address): IsmConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Collapses only derived hybrid nodes that already name `address`.
|
|
84
|
+
* Used when comparing an on-chain tree with a target whose shared hybrid leaf
|
|
85
|
+
* is intentionally opaque; an older leaf must remain visible as a difference.
|
|
86
|
+
*/
|
|
87
|
+
export declare function collapseMatchingHybridIsmNodes(ismConfig: IsmConfig, address: Address): IsmConfig;
|
|
88
|
+
/**
|
|
89
|
+
* The comparable form of a hybrid hook/ISM node: the fields that identify the
|
|
90
|
+
* contract instance the config asks for, with addresses lowercased, `duration`
|
|
91
|
+
* stringified (it parses to a bigint, which `deepEquals` cannot compare across
|
|
92
|
+
* separately-parsed copies) and `remoteIsms` canonicalized.
|
|
93
|
+
*
|
|
94
|
+
* A hybrid is declared on BOTH the hook and the ISM surface of the same
|
|
95
|
+
* router, and one instance has to satisfy both, so the two declarations are
|
|
96
|
+
* compared through here — a difference in any of these fields would otherwise
|
|
97
|
+
* be silently resolved in favour of whichever surface the deploy read first.
|
|
98
|
+
* `address` is deliberately absent: a derived tree carries one, a config tree
|
|
99
|
+
* does not, and comparing them is the caller's job.
|
|
100
|
+
*/
|
|
101
|
+
export declare function canonicalHybridNode(node: HybridHookIsmConfig, chainLookup: RemoteIsmChainLookup, context: string): Record<string, unknown>;
|
|
102
|
+
/**
|
|
103
|
+
* Prepares an ISM tree for the deferred (post-token) warp deploy pass:
|
|
104
|
+
* injects `warpRouter` into every hybrid hook/ISM node and overrides `owner`
|
|
105
|
+
* to the intermediate deployer. DELAYED_FLOW_ROUTER `remoteIsms` are also
|
|
106
|
+
* dropped. The deployer-signed cross-chain enrollment pass applies the final
|
|
107
|
+
* configuration and ends with the ownership transfer to the configured owner.
|
|
108
|
+
* Sibling of `setRateLimitedIsmRecipient`.
|
|
109
|
+
*/
|
|
110
|
+
export declare function prepareHybridIsmNodesForDeploy(ismConfig: IsmConfig, warpRouter: Address, intermediateOwner: Address): IsmConfig;
|
|
111
|
+
/**
|
|
112
|
+
* How `completeHybridIsmNodes` fills a DELAYED_FLOW_ROUTER's `remoteIsms`.
|
|
113
|
+
*/
|
|
114
|
+
export declare const DelayedFlowRemoteIsmsSourceType: {
|
|
115
|
+
/** Resolve the field with resolveDelayedFlowRemoteIsms. */
|
|
116
|
+
readonly Resolved: 'resolved';
|
|
117
|
+
/**
|
|
118
|
+
* Leave the field unset, which makes consumers preserve the current on-chain
|
|
119
|
+
* enrollment. For paths that run beside the cross-chain enrollment pass
|
|
120
|
+
* (buildDelayedFlowEnrollmentTxs): it is the enrollment's only writer, and
|
|
121
|
+
* two writers planning the same enrollment emit it twice.
|
|
122
|
+
*/
|
|
123
|
+
readonly Deferred: 'deferred';
|
|
124
|
+
};
|
|
125
|
+
export type DelayedFlowRemoteIsmsSource = {
|
|
126
|
+
type: typeof DelayedFlowRemoteIsmsSourceType.Resolved;
|
|
127
|
+
/** Pairing derived from the route, or undefined when it is unknown here. */
|
|
128
|
+
derived: Record<string, string> | undefined;
|
|
129
|
+
} | {
|
|
130
|
+
type: typeof DelayedFlowRemoteIsmsSourceType.Deferred;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Minimal chain-resolution surface `canonicalizeRemoteIsms` needs. MultiProvider
|
|
134
|
+
* satisfies it structurally, which keeps this module free of that import.
|
|
135
|
+
*/
|
|
136
|
+
export interface RemoteIsmChainLookup {
|
|
137
|
+
tryGetDomainId(chainNameOrId: string | number): number | null;
|
|
138
|
+
tryGetChainName(chainNameOrId: string | number): string | null;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The single representation of a DelayedFlowRouterHookIsm's `remoteIsms`:
|
|
142
|
+
* canonical chain name -> lowercase bytes32, which is exactly what the reader
|
|
143
|
+
* emits (deriveDelayedFlowRemoteIsms). Deploy, update and check all resolve the
|
|
144
|
+
* field through here, so they enroll, diff and compare the same entries.
|
|
145
|
+
*
|
|
146
|
+
* Both key forms a user can write are accepted and collapse to the chain name:
|
|
147
|
+
* a name, and the chain's domain id. Neither is left ambiguous — a key that
|
|
148
|
+
* resolves to no known chain is rejected rather than skipped (it would
|
|
149
|
+
* otherwise pass a config-level preflight and only fail once contracts are
|
|
150
|
+
* deployed), and two keys naming the same chain are rejected too (a single
|
|
151
|
+
* on-chain entry per domain cannot satisfy both, so the config could never
|
|
152
|
+
* converge).
|
|
153
|
+
*/
|
|
154
|
+
export declare function canonicalizeRemoteIsms(remoteIsms: Record<string, string>, chainLookup: RemoteIsmChainLookup, context: string): Record<string, string>;
|
|
155
|
+
/**
|
|
156
|
+
* Single source of truth for a DelayedFlowRouterHookIsm's `remoteIsms`: both
|
|
157
|
+
* the expected config `warp check` compares and the enrollment transactions
|
|
158
|
+
* `warp apply` emits resolve the field through here, so they cannot disagree
|
|
159
|
+
* (they once did, and the route never converged).
|
|
160
|
+
*
|
|
161
|
+
* Route-derived peers are authoritative for chains in the route: their
|
|
162
|
+
* addresses can change during replacement, while `warp read` still contains
|
|
163
|
+
* the installed instances' old enrollment. Configured entries are retained
|
|
164
|
+
* for external chains the route cannot derive, preserving unusual topologies.
|
|
165
|
+
*/
|
|
166
|
+
export declare function resolveDelayedFlowRemoteIsms(configured: Record<string, string> | undefined, derived: Record<string, string> | undefined, context: string, chainLookup: RemoteIsmChainLookup): Record<string, string> | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* Completes hybrid hook/ISM nodes in an EXPECTED config tree with the values
|
|
169
|
+
* the deploy machinery manages: `warpRouter` (the containing warp router,
|
|
170
|
+
* always injected — see resolveHybridWarpRouter), the NET_FLOW `owner` default
|
|
171
|
+
* (the chain's config owner, when the node omits one), and, for
|
|
172
|
+
* DELAYED_FLOW_ROUTER, the `remoteIsms` pairing. Used by
|
|
173
|
+
* expandWarpDeployConfig so `warp check` compares complete expectations
|
|
174
|
+
* against the fully-derived on-chain config, and by EvmWarpModule so `warp
|
|
175
|
+
* apply` plans against the same complete config.
|
|
176
|
+
*
|
|
177
|
+
* `defaultOwner` is only consulted for a NET_FLOW node that omits `owner`
|
|
178
|
+
* (DELAYED_FLOW_ROUTER's is schema-required), so callers that cannot resolve
|
|
179
|
+
* an owner still get `warpRouter` filled.
|
|
180
|
+
*/
|
|
181
|
+
export declare function completeHybridIsmNodes(ismConfig: IsmConfig, warpRouter: Address, remoteIsms: DelayedFlowRemoteIsmsSource, defaultOwner: Address | undefined, chainLookup: RemoteIsmChainLookup): IsmConfig;
|
|
16
182
|
export declare function extractIsmAndHookFactoryAddresses(registryAddresses: ChainAddresses): Pick<Record<string, string>, "domainRoutingIsmFactory" | "incrementalDomainRoutingIsmFactory" | "staticAggregationHookFactory" | "staticAggregationIsmFactory" | "staticMerkleRootMultisigIsmFactory" | "staticMerkleRootWeightedMultisigIsmFactory" | "staticMessageIdMultisigIsmFactory" | "staticMessageIdWeightedMultisigIsmFactory">;
|
|
17
183
|
export declare function multisigIsmVerificationCost(m: number, n: number): number;
|
|
18
184
|
export declare function normalizeConfig(obj: WithAddress<any>): any;
|
package/dist/utils/ism.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ism.d.ts","sourceRoot":"","sources":["../../src/utils/ism.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ism.d.ts","sourceRoot":"","sources":["../../src/utils/ism.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,WAAW,EAOZ,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,8BAA8B,EAC9B,SAAS,EAET,+BAA+B,EAChC,MAAM,iBAAiB,CAAC;AAEzB,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAQ7C;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAkBhE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,OAAO,GAAG,SAAS,EAC9B,YAAY,CAAC,EAAE,MAAM,GACpB,SAAS,CA0DX;AAED,MAAM,MAAM,mBAAmB,GAC3B,+BAA+B,GAC/B,8BAA8B,CAAC;AAEnC;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAElE;AAED;;;;GAIG;AACH,wBAAgB,q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AGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,GAAG,CAE1D;AAqBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAoCnD"}
|
package/dist/utils/ism.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { pick } from '@hyperlane-xyz/utils';
|
|
1
|
+
import { addressToBytes32, assert, deepEquals, eqAddress, pick, rootLogger, } from '@hyperlane-xyz/utils';
|
|
2
2
|
import { multisigIsmVerifyCosts } from '../consts/multisigIsmVerifyCosts.js';
|
|
3
|
-
import {
|
|
3
|
+
import { TokenType } from '../token/config.js';
|
|
4
|
+
import { IsmType, } from '../ism/types.js';
|
|
5
|
+
const logger = rootLogger.child({ module: 'IsmConfigUtils' });
|
|
6
|
+
function isRecord(value) {
|
|
7
|
+
return typeof value === 'object' && value !== null;
|
|
8
|
+
}
|
|
4
9
|
/**
|
|
5
10
|
* Extracts the ISM and Hook factory addresses from chain-specific registry addresses
|
|
6
11
|
* @param registryAddresses The registry addresses for a specific chain
|
|
@@ -68,6 +73,411 @@ export function setRateLimitedIsmRecipient(ismConfig, recipient, defaultOwner) {
|
|
|
68
73
|
}
|
|
69
74
|
return ismConfig;
|
|
70
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* True if a warp-route hybrid hook/ISM node (NET_FLOW_RATE_LIMITED or
|
|
78
|
+
* DELAYED_FLOW_ROUTER) exists anywhere in the ISM config tree.
|
|
79
|
+
*/
|
|
80
|
+
export function ismTreeContainsHybridHookIsm(ism) {
|
|
81
|
+
return collectHybridIsmNodesFromUnknown(ism).length > 0;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* True if a MAILBOX_DEFAULT or hybrid hook/ISM node exists anywhere in the
|
|
85
|
+
* tree. Used to keep warp-route-only and self-referential ISM types out of
|
|
86
|
+
* core default-ISM configs (see core/types.ts).
|
|
87
|
+
*/
|
|
88
|
+
export function ismTreeContainsMailboxDefaultOrHybrid(ism) {
|
|
89
|
+
return (ismTreeContainsHybridHookIsm(ism) ||
|
|
90
|
+
ismTreeSome(ism, (node) => node.type === IsmType.MAILBOX_DEFAULT));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Deep-collects every hybrid hook/ISM node in an ISM config tree (including
|
|
94
|
+
* derived trees, whose nodes additionally carry an `address` field).
|
|
95
|
+
*/
|
|
96
|
+
export function collectHybridIsmNodes(ism) {
|
|
97
|
+
return collectHybridIsmNodesFromUnknown(ism);
|
|
98
|
+
}
|
|
99
|
+
function isHybridIsmNode(node) {
|
|
100
|
+
if (typeof node !== 'object' || node === null || !('type' in node)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
return (node.type === IsmType.NET_FLOW_RATE_LIMITED ||
|
|
104
|
+
node.type === IsmType.DELAYED_FLOW_ROUTER);
|
|
105
|
+
}
|
|
106
|
+
/** True if any node in the tree satisfies `matches`. */
|
|
107
|
+
function ismTreeSome(ism, matches) {
|
|
108
|
+
if (!isRecord(ism))
|
|
109
|
+
return false;
|
|
110
|
+
const node = ism;
|
|
111
|
+
if (matches(node))
|
|
112
|
+
return true;
|
|
113
|
+
if (Array.isArray(node.modules)) {
|
|
114
|
+
if (node.modules.some((module) => ismTreeSome(module, matches)))
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
if (isRecord(node.domains)) {
|
|
118
|
+
const domains = Object.values(node.domains);
|
|
119
|
+
if (domains.some((domainIsm) => ismTreeSome(domainIsm, matches)))
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
return (ismTreeSome(node.lowerIsm, matches) || ismTreeSome(node.upperIsm, matches));
|
|
123
|
+
}
|
|
124
|
+
function collectHybridIsmNodesFromUnknown(ism) {
|
|
125
|
+
if (!isRecord(ism))
|
|
126
|
+
return [];
|
|
127
|
+
if (isHybridIsmNode(ism))
|
|
128
|
+
return [ism];
|
|
129
|
+
const node = ism;
|
|
130
|
+
const collected = [];
|
|
131
|
+
if (Array.isArray(node.modules)) {
|
|
132
|
+
for (const module of node.modules) {
|
|
133
|
+
collected.push(...collectHybridIsmNodesFromUnknown(module));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (isRecord(node.domains)) {
|
|
137
|
+
for (const domainIsm of Object.values(node.domains)) {
|
|
138
|
+
collected.push(...collectHybridIsmNodesFromUnknown(domainIsm));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
collected.push(...collectHybridIsmNodesFromUnknown(node.lowerIsm));
|
|
142
|
+
collected.push(...collectHybridIsmNodesFromUnknown(node.upperIsm));
|
|
143
|
+
return collected;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Recursively maps every hybrid hook/ISM node in an ISM config tree
|
|
147
|
+
* (traversing aggregation/routing/amount-routing containers), leaving all
|
|
148
|
+
* other nodes untouched.
|
|
149
|
+
*/
|
|
150
|
+
export function mapHybridIsmNodes(ismConfig, mapNode) {
|
|
151
|
+
if (typeof ismConfig === 'string')
|
|
152
|
+
return ismConfig;
|
|
153
|
+
if (ismConfig.type === IsmType.NET_FLOW_RATE_LIMITED ||
|
|
154
|
+
ismConfig.type === IsmType.DELAYED_FLOW_ROUTER) {
|
|
155
|
+
return mapNode(ismConfig);
|
|
156
|
+
}
|
|
157
|
+
if (ismConfig.type === IsmType.AGGREGATION ||
|
|
158
|
+
ismConfig.type === IsmType.STORAGE_AGGREGATION) {
|
|
159
|
+
return {
|
|
160
|
+
...ismConfig,
|
|
161
|
+
modules: ismConfig.modules.map((m) => mapHybridIsmNodes(m, mapNode)),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
if (ismConfig.type === IsmType.ROUTING ||
|
|
165
|
+
ismConfig.type === IsmType.FALLBACK_ROUTING ||
|
|
166
|
+
ismConfig.type === IsmType.INCREMENTAL_ROUTING) {
|
|
167
|
+
const newDomains = {};
|
|
168
|
+
for (const [domain, domainIsm] of Object.entries(ismConfig.domains)) {
|
|
169
|
+
newDomains[domain] = mapHybridIsmNodes(domainIsm, mapNode);
|
|
170
|
+
}
|
|
171
|
+
return { ...ismConfig, domains: newDomains };
|
|
172
|
+
}
|
|
173
|
+
if (ismConfig.type === IsmType.AMOUNT_ROUTING) {
|
|
174
|
+
return {
|
|
175
|
+
...ismConfig,
|
|
176
|
+
lowerIsm: mapHybridIsmNodes(ismConfig.lowerIsm, mapNode),
|
|
177
|
+
upperIsm: mapHybridIsmNodes(ismConfig.upperIsm, mapNode),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
return ismConfig;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Rejects combining a predicate wrapper with a hybrid hook/ISM.
|
|
184
|
+
*
|
|
185
|
+
* Both want to own the router's hook slot: the hybrid instance must BE the
|
|
186
|
+
* hook (shared bucket state with its ISM role), while the predicate wrapper
|
|
187
|
+
* installs `aggregation([wrapper, previousHook])`. Nesting the hybrid inside
|
|
188
|
+
* that aggregation is mechanically possible — StaticAggregationHook forwards
|
|
189
|
+
* each child its own `quoteDispatch` amount, which is what the hybrid's nested
|
|
190
|
+
* `_Router_dispatch` needs — but only on the native-fee path: when the
|
|
191
|
+
* dispatch metadata names a non-zero `feeToken`, the aggregation passes
|
|
192
|
+
* `value: 0` to every child, starving the hybrid's nested dispatch. Until that
|
|
193
|
+
* path is verified at the contract level, the combination is rejected rather
|
|
194
|
+
* than silently producing a route whose policy hook or flow limiter is
|
|
195
|
+
* missing from the dispatch path.
|
|
196
|
+
*
|
|
197
|
+
* TODO(hybrid+predicate composition verified): allow composing the two by
|
|
198
|
+
* threading the hybrid address into PredicateWrapperDeployer.deployAndConfigure
|
|
199
|
+
* as `existingHookOverride`.
|
|
200
|
+
*/
|
|
201
|
+
export function assertNoPredicateWrapperWithHybridIsm(chain, config) {
|
|
202
|
+
const predicateWrapper = typeof config === 'object' &&
|
|
203
|
+
config !== null &&
|
|
204
|
+
'predicateWrapper' in config
|
|
205
|
+
? config.predicateWrapper
|
|
206
|
+
: undefined;
|
|
207
|
+
assert(!predicateWrapper, `Hybrid hook/ISM and predicateWrapper are both configured on ${chain}, but both must own the router's hook. Remove one — composing them is not supported yet.`);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Warp router implementations a hybrid hook/ISM may guard.
|
|
211
|
+
*
|
|
212
|
+
* NetFlowRateLimitedHookIsm sizes its bucket from the paired router's TVL via
|
|
213
|
+
* two arms (see the contract docstring, solidity/contracts/hooks/warp-route/
|
|
214
|
+
* NetFlowRateLimitedHookIsm.sol:31-41):
|
|
215
|
+
* - synthetic (`token() == warpRouter`): reads `totalSupply()`;
|
|
216
|
+
* - collateral/native: reads the balance minus `totalAssets()`, which
|
|
217
|
+
* requires the router to be an `LpCollateralRouter`.
|
|
218
|
+
*
|
|
219
|
+
* Verified against the contract hierarchy rather than the docstring's prose:
|
|
220
|
+
* - `HypNative` and `HypERC20Collateral` are the only direct
|
|
221
|
+
* `LpCollateralRouter` subclasses (HypNative.sol:19,
|
|
222
|
+
* HypERC20Collateral.sol:35);
|
|
223
|
+
* - `crossCollateral` qualifies transitively, since
|
|
224
|
+
* `CrossCollateralRouter is HypERC20Collateral`
|
|
225
|
+
* (CrossCollateralRouter.sol:46-47);
|
|
226
|
+
* - the rejected collateral-ish types extend `TokenRouter` directly, not
|
|
227
|
+
* `LpCollateralRouter`, so `localCollateral()` would revert
|
|
228
|
+
* (HypERC4626Collateral, HypFiatToken, HypXERC20, HypXERC20Lockbox).
|
|
229
|
+
*
|
|
230
|
+
* Membership is NOT derived from inheritance, deliberately: `HypERC4626` (the
|
|
231
|
+
* `syntheticRebase` type) *is* a subclass of the permitted `HypERC20`, but it
|
|
232
|
+
* rebases, so `_toLocalAmount` would meter shares against an asset-denominated
|
|
233
|
+
* bucket. An inheritance-derived rule would silently admit it.
|
|
234
|
+
*/
|
|
235
|
+
const HYBRID_ISM_SUPPORTED_TOKEN_TYPES = new Set([
|
|
236
|
+
TokenType.synthetic,
|
|
237
|
+
TokenType.collateral,
|
|
238
|
+
TokenType.native,
|
|
239
|
+
// Alias of `native`: same HypNative factory (token/contracts.ts), so it is
|
|
240
|
+
// contract-identical to an accepted type.
|
|
241
|
+
TokenType.nativeScaled,
|
|
242
|
+
TokenType.crossCollateral,
|
|
243
|
+
]);
|
|
244
|
+
/**
|
|
245
|
+
* Rejects a hybrid hook/ISM on a router implementation it cannot meter.
|
|
246
|
+
*
|
|
247
|
+
* Enforced on every path that can install a hybrid on a router — deploy
|
|
248
|
+
* (assertHybridIsmDeployConstraints) and `warp apply`
|
|
249
|
+
* (EvmWarpModule.createHookAndPredicateUpdateTxs). A hybrid on, say, a
|
|
250
|
+
* collateralVault router deploys fine (the constructor only reads `token()`)
|
|
251
|
+
* and then reverts on every dispatch and delivery, because `localCollateral()`
|
|
252
|
+
* calls `totalAssets()` on a router that is not an `LpCollateralRouter`.
|
|
253
|
+
*/
|
|
254
|
+
export function assertHybridIsmTokenTypeSupported(chain, type) {
|
|
255
|
+
assert(type !== undefined && HYBRID_ISM_SUPPORTED_TOKEN_TYPES.has(type), `Hybrid hook/ISM configured on ${chain} for token type '${type}', which it cannot meter. Supported: ${[...HYBRID_ISM_SUPPORTED_TOKEN_TYPES].join(', ')}.`);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Replaces every hybrid hook/ISM node in an ISM tree with the address of the
|
|
259
|
+
* already-deployed instance.
|
|
260
|
+
*
|
|
261
|
+
* The hybrid leaf is deployed exactly once per chain and shared between the
|
|
262
|
+
* router's hook and ISM surfaces, so the parent tree handed to EvmIsmModule
|
|
263
|
+
* must reference it by address rather than re-declaring it — otherwise the
|
|
264
|
+
* parent deploy would mint a second instance with its own bucket state.
|
|
265
|
+
* Sibling of `resolveHybridHookNodesToAddress` on the hook surface.
|
|
266
|
+
*/
|
|
267
|
+
export function resolveHybridIsmNodesToAddress(ismConfig, address) {
|
|
268
|
+
return mapHybridIsmNodes(ismConfig, () => address);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Collapses only derived hybrid nodes that already name `address`.
|
|
272
|
+
* Used when comparing an on-chain tree with a target whose shared hybrid leaf
|
|
273
|
+
* is intentionally opaque; an older leaf must remain visible as a difference.
|
|
274
|
+
*/
|
|
275
|
+
export function collapseMatchingHybridIsmNodes(ismConfig, address) {
|
|
276
|
+
return mapHybridIsmNodes(ismConfig, (node) => {
|
|
277
|
+
const derivedAddress = 'address' in node && typeof node.address === 'string'
|
|
278
|
+
? node.address
|
|
279
|
+
: undefined;
|
|
280
|
+
return derivedAddress && eqAddress(derivedAddress, address)
|
|
281
|
+
? address
|
|
282
|
+
: node;
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* The comparable form of a hybrid hook/ISM node: the fields that identify the
|
|
287
|
+
* contract instance the config asks for, with addresses lowercased, `duration`
|
|
288
|
+
* stringified (it parses to a bigint, which `deepEquals` cannot compare across
|
|
289
|
+
* separately-parsed copies) and `remoteIsms` canonicalized.
|
|
290
|
+
*
|
|
291
|
+
* A hybrid is declared on BOTH the hook and the ISM surface of the same
|
|
292
|
+
* router, and one instance has to satisfy both, so the two declarations are
|
|
293
|
+
* compared through here — a difference in any of these fields would otherwise
|
|
294
|
+
* be silently resolved in favour of whichever surface the deploy read first.
|
|
295
|
+
* `address` is deliberately absent: a derived tree carries one, a config tree
|
|
296
|
+
* does not, and comparing them is the caller's job.
|
|
297
|
+
*/
|
|
298
|
+
export function canonicalHybridNode(node, chainLookup, context) {
|
|
299
|
+
const common = {
|
|
300
|
+
type: node.type,
|
|
301
|
+
warpRouter: node.warpRouter?.toLowerCase(),
|
|
302
|
+
thresholdBps: node.thresholdBps,
|
|
303
|
+
duration: node.duration.toString(),
|
|
304
|
+
owner: node.owner?.toLowerCase(),
|
|
305
|
+
};
|
|
306
|
+
if (node.type === IsmType.NET_FLOW_RATE_LIMITED)
|
|
307
|
+
return common;
|
|
308
|
+
return {
|
|
309
|
+
...common,
|
|
310
|
+
maxDelay: node.maxDelay,
|
|
311
|
+
remoteIsms: node.remoteIsms
|
|
312
|
+
? canonicalizeRemoteIsms(node.remoteIsms, chainLookup, context)
|
|
313
|
+
: undefined,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Resolves the `warpRouter` a hybrid hook/ISM node is deployed against, which
|
|
318
|
+
* is always the router the node's tree is installed on.
|
|
319
|
+
*
|
|
320
|
+
* A hybrid meters exactly one router and checks it on both sides — postDispatch
|
|
321
|
+
* reverts `WrongSender` when the dispatching router is not `warpRouter`, and
|
|
322
|
+
* verify reverts `WrongRecipient` when the delivering router is not
|
|
323
|
+
* `warpRouter` (NetFlowRateLimitedHookIsm.sol:97-106) — so a node naming a
|
|
324
|
+
* foreign router is always wrong. Rejected rather than silently rewritten: the
|
|
325
|
+
* user asked for a pairing the deploy cannot honour, and rewriting an explicit
|
|
326
|
+
* value hides that.
|
|
327
|
+
*/
|
|
328
|
+
function resolveHybridWarpRouter(node, warpRouter) {
|
|
329
|
+
assert(node.warpRouter === undefined || eqAddress(node.warpRouter, warpRouter), `Hybrid hook/ISM (${node.type}) sets warpRouter ${node.warpRouter}, but it is installed on warp router ${warpRouter}. A hybrid guards exactly the router it is installed on, so it would reject that router's traffic. Unset 'warpRouter' or set it to ${warpRouter}.`);
|
|
330
|
+
return warpRouter;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Prepares an ISM tree for the deferred (post-token) warp deploy pass:
|
|
334
|
+
* injects `warpRouter` into every hybrid hook/ISM node and overrides `owner`
|
|
335
|
+
* to the intermediate deployer. DELAYED_FLOW_ROUTER `remoteIsms` are also
|
|
336
|
+
* dropped. The deployer-signed cross-chain enrollment pass applies the final
|
|
337
|
+
* configuration and ends with the ownership transfer to the configured owner.
|
|
338
|
+
* Sibling of `setRateLimitedIsmRecipient`.
|
|
339
|
+
*/
|
|
340
|
+
export function prepareHybridIsmNodesForDeploy(ismConfig, warpRouter, intermediateOwner) {
|
|
341
|
+
return mapHybridIsmNodes(ismConfig, (node) => {
|
|
342
|
+
const resolvedWarpRouter = resolveHybridWarpRouter(node, warpRouter);
|
|
343
|
+
if (node.type === IsmType.NET_FLOW_RATE_LIMITED) {
|
|
344
|
+
return {
|
|
345
|
+
type: node.type,
|
|
346
|
+
warpRouter: resolvedWarpRouter,
|
|
347
|
+
thresholdBps: node.thresholdBps,
|
|
348
|
+
duration: node.duration,
|
|
349
|
+
owner: intermediateOwner,
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
type: node.type,
|
|
354
|
+
warpRouter: resolvedWarpRouter,
|
|
355
|
+
thresholdBps: node.thresholdBps,
|
|
356
|
+
maxDelay: node.maxDelay,
|
|
357
|
+
duration: node.duration,
|
|
358
|
+
owner: intermediateOwner,
|
|
359
|
+
};
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* How `completeHybridIsmNodes` fills a DELAYED_FLOW_ROUTER's `remoteIsms`.
|
|
364
|
+
*/
|
|
365
|
+
export const DelayedFlowRemoteIsmsSourceType = {
|
|
366
|
+
/** Resolve the field with resolveDelayedFlowRemoteIsms. */
|
|
367
|
+
Resolved: 'resolved',
|
|
368
|
+
/**
|
|
369
|
+
* Leave the field unset, which makes consumers preserve the current on-chain
|
|
370
|
+
* enrollment. For paths that run beside the cross-chain enrollment pass
|
|
371
|
+
* (buildDelayedFlowEnrollmentTxs): it is the enrollment's only writer, and
|
|
372
|
+
* two writers planning the same enrollment emit it twice.
|
|
373
|
+
*/
|
|
374
|
+
Deferred: 'deferred',
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* The single representation of a DelayedFlowRouterHookIsm's `remoteIsms`:
|
|
378
|
+
* canonical chain name -> lowercase bytes32, which is exactly what the reader
|
|
379
|
+
* emits (deriveDelayedFlowRemoteIsms). Deploy, update and check all resolve the
|
|
380
|
+
* field through here, so they enroll, diff and compare the same entries.
|
|
381
|
+
*
|
|
382
|
+
* Both key forms a user can write are accepted and collapse to the chain name:
|
|
383
|
+
* a name, and the chain's domain id. Neither is left ambiguous — a key that
|
|
384
|
+
* resolves to no known chain is rejected rather than skipped (it would
|
|
385
|
+
* otherwise pass a config-level preflight and only fail once contracts are
|
|
386
|
+
* deployed), and two keys naming the same chain are rejected too (a single
|
|
387
|
+
* on-chain entry per domain cannot satisfy both, so the config could never
|
|
388
|
+
* converge).
|
|
389
|
+
*/
|
|
390
|
+
export function canonicalizeRemoteIsms(remoteIsms, chainLookup, context) {
|
|
391
|
+
const keyByDomain = new Map();
|
|
392
|
+
const canonical = {};
|
|
393
|
+
for (const [key, router] of Object.entries(remoteIsms)) {
|
|
394
|
+
const domainId = chainLookup.tryGetDomainId(key);
|
|
395
|
+
assert(domainId !== null, `${context} names '${key}' under 'remoteIsms', which resolves to no known chain — use the chain's registry name or its domain id (note that a chain id is neither)`);
|
|
396
|
+
const chainName = chainLookup.tryGetChainName(domainId);
|
|
397
|
+
assert(chainName !== null, `${context} names '${key}' under 'remoteIsms', which resolves to domain ${domainId} but to no chain name — add the chain to the registry`);
|
|
398
|
+
const previousKey = keyByDomain.get(domainId);
|
|
399
|
+
assert(previousKey === undefined, `${context} names both '${previousKey}' and '${key}' under 'remoteIsms', which are the same chain ${chainName} (domain ${domainId}). A domain has a single enrolled counterpart on-chain, so the two entries can never both hold — keep one.`);
|
|
400
|
+
keyByDomain.set(domainId, key);
|
|
401
|
+
canonical[chainName] = addressToBytes32(router).toLowerCase();
|
|
402
|
+
}
|
|
403
|
+
return canonical;
|
|
404
|
+
}
|
|
405
|
+
function normalizeRemoteIsms(remoteIsms) {
|
|
406
|
+
const normalized = {};
|
|
407
|
+
for (const [chain, router] of Object.entries(remoteIsms)) {
|
|
408
|
+
normalized[chain] = addressToBytes32(router).toLowerCase();
|
|
409
|
+
}
|
|
410
|
+
return normalized;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Single source of truth for a DelayedFlowRouterHookIsm's `remoteIsms`: both
|
|
414
|
+
* the expected config `warp check` compares and the enrollment transactions
|
|
415
|
+
* `warp apply` emits resolve the field through here, so they cannot disagree
|
|
416
|
+
* (they once did, and the route never converged).
|
|
417
|
+
*
|
|
418
|
+
* Route-derived peers are authoritative for chains in the route: their
|
|
419
|
+
* addresses can change during replacement, while `warp read` still contains
|
|
420
|
+
* the installed instances' old enrollment. Configured entries are retained
|
|
421
|
+
* for external chains the route cannot derive, preserving unusual topologies.
|
|
422
|
+
*/
|
|
423
|
+
export function resolveDelayedFlowRemoteIsms(configured, derived, context, chainLookup) {
|
|
424
|
+
if (configured === undefined) {
|
|
425
|
+
return derived;
|
|
426
|
+
}
|
|
427
|
+
// Canonicalized here rather than at each consumer: whatever key form the
|
|
428
|
+
// config used, everything downstream sees the one representation.
|
|
429
|
+
const canonical = canonicalizeRemoteIsms(configured, chainLookup, context);
|
|
430
|
+
if (derived === undefined) {
|
|
431
|
+
return canonical;
|
|
432
|
+
}
|
|
433
|
+
const normalizedDerived = normalizeRemoteIsms(derived);
|
|
434
|
+
const resolved = { ...canonical, ...normalizedDerived };
|
|
435
|
+
if (!deepEquals(canonical, resolved)) {
|
|
436
|
+
logger.warn(`${context} configures in-route 'remoteIsms' that differ from the current route pairing. The route-derived peers win; configured external peers are retained.`);
|
|
437
|
+
}
|
|
438
|
+
return resolved;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Completes hybrid hook/ISM nodes in an EXPECTED config tree with the values
|
|
442
|
+
* the deploy machinery manages: `warpRouter` (the containing warp router,
|
|
443
|
+
* always injected — see resolveHybridWarpRouter), the NET_FLOW `owner` default
|
|
444
|
+
* (the chain's config owner, when the node omits one), and, for
|
|
445
|
+
* DELAYED_FLOW_ROUTER, the `remoteIsms` pairing. Used by
|
|
446
|
+
* expandWarpDeployConfig so `warp check` compares complete expectations
|
|
447
|
+
* against the fully-derived on-chain config, and by EvmWarpModule so `warp
|
|
448
|
+
* apply` plans against the same complete config.
|
|
449
|
+
*
|
|
450
|
+
* `defaultOwner` is only consulted for a NET_FLOW node that omits `owner`
|
|
451
|
+
* (DELAYED_FLOW_ROUTER's is schema-required), so callers that cannot resolve
|
|
452
|
+
* an owner still get `warpRouter` filled.
|
|
453
|
+
*/
|
|
454
|
+
export function completeHybridIsmNodes(ismConfig, warpRouter, remoteIsms, defaultOwner, chainLookup) {
|
|
455
|
+
return mapHybridIsmNodes(ismConfig, (node) => {
|
|
456
|
+
const resolvedWarpRouter = resolveHybridWarpRouter(node, warpRouter);
|
|
457
|
+
if (node.type === IsmType.NET_FLOW_RATE_LIMITED) {
|
|
458
|
+
const owner = node.owner ?? defaultOwner;
|
|
459
|
+
assert(owner, `Hybrid hook/ISM (${node.type}) on warp router ${warpRouter} omits 'owner' and no owner could be resolved for the route — set 'owner' on the ISM config`);
|
|
460
|
+
return {
|
|
461
|
+
type: node.type,
|
|
462
|
+
warpRouter: resolvedWarpRouter,
|
|
463
|
+
thresholdBps: node.thresholdBps,
|
|
464
|
+
duration: node.duration,
|
|
465
|
+
owner,
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
return {
|
|
469
|
+
type: node.type,
|
|
470
|
+
warpRouter: resolvedWarpRouter,
|
|
471
|
+
thresholdBps: node.thresholdBps,
|
|
472
|
+
maxDelay: node.maxDelay,
|
|
473
|
+
duration: node.duration,
|
|
474
|
+
owner: node.owner,
|
|
475
|
+
remoteIsms: remoteIsms.type === DelayedFlowRemoteIsmsSourceType.Deferred
|
|
476
|
+
? undefined
|
|
477
|
+
: resolveDelayedFlowRemoteIsms(node.remoteIsms, remoteIsms.derived, `Hybrid hook/ISM (${node.type}) on warp router ${warpRouter}`, chainLookup),
|
|
478
|
+
};
|
|
479
|
+
});
|
|
480
|
+
}
|
|
71
481
|
export function extractIsmAndHookFactoryAddresses(registryAddresses) {
|
|
72
482
|
return pick(registryAddresses, [
|
|
73
483
|
'domainRoutingIsmFactory',
|
package/dist/utils/ism.js.map
CHANGED
|
@@ -1 +1 @@
|
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