-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description This PR adds github-proxy CloudFlare Worker project which will attach an api key to github requests to increase read capacity. It is mostly a passthrough proxy that has a simple allowlist. This project is created and deployed using CloudFlare's [cloudflare create CLI](https://developers.cloudflare.com/workers/get-started/guide/) It is deployed using `yarn deploy` (aka wrangler) ### Drive-by changes - `yarn up [email protected]` - `yarn up [email protected]` - `yarn up [email protected]` ### Related issues Fixes: hyperlane-xyz/hyperlane-registry#163 ### Backward compatibility Yes ### Testing Manual/Unit Tests - Use a script to ddos github, then try cli command `hyperlane warp read` - Unit tests for the Worker, and GithubRegistry changes
- Loading branch information
Showing
29 changed files
with
1,658 additions
and
98 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,5 @@ | ||
--- | ||
'github-proxy': major | ||
--- | ||
|
||
Add github proxy to reduce github API load |
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
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,54 @@ | ||
import { expect } from 'chai'; | ||
|
||
import { WarpRouteDeployConfig } from '@hyperlane-xyz/sdk'; | ||
|
||
import { readYamlOrJson, writeYamlOrJson } from '../utils/files.js'; | ||
|
||
import { | ||
ANVIL_KEY, | ||
REGISTRY_PATH, | ||
deployOrUseExistingCore, | ||
} from './commands/helpers.js'; | ||
import { hyperlaneWarpDeploy, readWarpConfig } from './commands/warp.js'; | ||
|
||
const CHAIN_NAME_2 = 'anvil2'; | ||
|
||
const EXAMPLES_PATH = './examples'; | ||
const CORE_CONFIG_PATH = `${EXAMPLES_PATH}/core-config.yaml`; | ||
const WARP_CONFIG_PATH_EXAMPLE = `${EXAMPLES_PATH}/warp-route-deployment.yaml`; | ||
|
||
const TEMP_PATH = '/tmp'; // /temp gets removed at the end of all-test.sh | ||
const WARP_CONFIG_PATH_2 = `${TEMP_PATH}/anvil2/warp-route-deployment-anvil2.yaml`; | ||
const WARP_CORE_CONFIG_PATH_2 = `${REGISTRY_PATH}/deployments/warp_routes/ETH/anvil2-config.yaml`; | ||
|
||
const TEST_TIMEOUT = 60_000; // Long timeout since these tests can take a while | ||
describe('WarpRead e2e tests', async function () { | ||
let anvil2Config: WarpRouteDeployConfig; | ||
this.timeout(TEST_TIMEOUT); | ||
before(async function () { | ||
await deployOrUseExistingCore(CHAIN_NAME_2, CORE_CONFIG_PATH, ANVIL_KEY); | ||
|
||
// Create a new warp config using the example | ||
const exampleWarpConfig: WarpRouteDeployConfig = readYamlOrJson( | ||
WARP_CONFIG_PATH_EXAMPLE, | ||
); | ||
anvil2Config = { anvil2: { ...exampleWarpConfig.anvil1 } }; | ||
writeYamlOrJson(WARP_CONFIG_PATH_2, anvil2Config); | ||
}); | ||
|
||
beforeEach(async function () { | ||
await hyperlaneWarpDeploy(WARP_CONFIG_PATH_2); | ||
}); | ||
|
||
it('should be able to read a warp route', async function () { | ||
const warpConfigPath = `${TEMP_PATH}/warp-route-deployment-2.yaml`; | ||
const warpConfig = await readWarpConfig( | ||
CHAIN_NAME_2, | ||
WARP_CORE_CONFIG_PATH_2, | ||
warpConfigPath, | ||
); | ||
expect(warpConfig[CHAIN_NAME_2].type).to.be.equal( | ||
anvil2Config[CHAIN_NAME_2].type, | ||
); | ||
}); | ||
}); |
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 @@ | ||
GITHUB_API_KEY= |
Oops, something went wrong.