-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description - Adjust long running TS relayer with retry queue instead of crashing. - Adds a "whitelist" for relaying to specific message senders/recipients. - Adds a "symbol" flag borrowed from warp commands for filtering on a specific warp route. ### Drive-by changes None ### Related issues - Enables warp route deployer to run the CLI relayer in the background and test/share the warp UI. ### Backward compatibility Yes ### Testing CLI e2e tests
- Loading branch information
Showing
11 changed files
with
363 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@hyperlane-xyz/infra': minor | ||
'@hyperlane-xyz/cli': minor | ||
'@hyperlane-xyz/sdk': minor | ||
--- | ||
|
||
Implements persistent relayer for use in CLI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { TokenType } from '@hyperlane-xyz/sdk'; | ||
|
||
import { writeYamlOrJson } from '../utils/files.js'; | ||
|
||
import { hyperlaneCoreDeploy } from './commands/core.js'; | ||
import { | ||
REGISTRY_PATH, | ||
hyperlaneRelayer, | ||
hyperlaneSendMessage, | ||
} from './commands/helpers.js'; | ||
import { | ||
hyperlaneWarpDeploy, | ||
hyperlaneWarpSendRelay, | ||
} from './commands/warp.js'; | ||
|
||
const CHAIN_NAME_1 = 'anvil2'; | ||
const CHAIN_NAME_2 = 'anvil3'; | ||
|
||
const SYMBOL = 'ETH'; | ||
|
||
const WARP_DEPLOY_OUTPUT = `${REGISTRY_PATH}/deployments/warp_routes/${SYMBOL}/${CHAIN_NAME_1}-${CHAIN_NAME_2}-config.yaml`; | ||
|
||
const EXAMPLES_PATH = './examples'; | ||
const CORE_CONFIG_PATH = `${EXAMPLES_PATH}/core-config.yaml`; | ||
|
||
const TEST_TIMEOUT = 100_000; // Long timeout since these tests can take a while | ||
describe('hyperlane relayer e2e tests', async function () { | ||
this.timeout(TEST_TIMEOUT); | ||
|
||
before(async () => { | ||
await hyperlaneCoreDeploy(CHAIN_NAME_1, CORE_CONFIG_PATH); | ||
await hyperlaneCoreDeploy(CHAIN_NAME_2, CORE_CONFIG_PATH); | ||
|
||
const warpConfig = { | ||
anvil2: { | ||
type: TokenType.native, | ||
symbol: SYMBOL, | ||
}, | ||
anvil3: { | ||
type: TokenType.synthetic, | ||
symbol: SYMBOL, | ||
}, | ||
}; | ||
|
||
const warpConfigPath = './tmp/warp-route-config.yaml'; | ||
writeYamlOrJson(warpConfigPath, warpConfig); | ||
await hyperlaneWarpDeploy(warpConfigPath); | ||
}); | ||
|
||
describe('relayer', () => { | ||
it('should relay core messages', async () => { | ||
const process = hyperlaneRelayer([CHAIN_NAME_1, CHAIN_NAME_2]); | ||
|
||
await hyperlaneSendMessage(CHAIN_NAME_1, CHAIN_NAME_2); | ||
await hyperlaneSendMessage(CHAIN_NAME_2, CHAIN_NAME_1); | ||
|
||
await process.kill('SIGINT'); | ||
}); | ||
|
||
it('should relay warp messages', async () => { | ||
const process = hyperlaneRelayer( | ||
[CHAIN_NAME_1, CHAIN_NAME_2], | ||
WARP_DEPLOY_OUTPUT, | ||
); | ||
|
||
await hyperlaneWarpSendRelay( | ||
CHAIN_NAME_1, | ||
CHAIN_NAME_2, | ||
WARP_DEPLOY_OUTPUT, | ||
false, | ||
); | ||
await hyperlaneWarpSendRelay( | ||
CHAIN_NAME_2, | ||
CHAIN_NAME_1, | ||
WARP_DEPLOY_OUTPUT, | ||
false, | ||
); | ||
|
||
await process.kill('SIGINT'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,6 @@ export function stubMerkleTreeConfig( | |
}, | ||
}, | ||
ism: {}, | ||
backlog: [], | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.