Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
diff --git a/dist/cjs/index.d.ts b/dist/cjs/index.d.ts
index e072ffe6156827581272398cf9acd9352d1b502b..ecec2991498332c287c47f35546932126141b001 100644
--- a/dist/cjs/index.d.ts
+++ b/dist/cjs/index.d.ts
@@ -23,6 +23,8 @@ export type SetupOption = {
db?: string;
/** Connection timeout in milliseconds */
timeout?: number;
+ /** Upstream RPC timeout in milliseconds (chopsticks -> upstream/proxy). Forwarded as rpc-timeout. */
+ rpcTimeout?: number;
/** Host address to bind the server to */
host?: string;
/** Port number to bind the server to */
@@ -52,7 +54,7 @@ export type SetupConfig = Config & {
* @param options - Setup options for the network
* @returns Configuration object compatible with chopsticks
*/
-export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock, }: SetupOption) => SetupConfig;
+export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, rpcTimeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock, }: SetupOption) => SetupConfig;
/**
* Sets up a blockchain network context using provided options
* @param option - Setup options for the network
diff --git a/dist/cjs/index.js b/dist/cjs/index.js
index 68a4dfb2ef3443eaf662482bd64d66fbf0f904c2..dce2a4c1cb6a048adef2b41506c7d2b516eae5d7 100644
--- a/dist/cjs/index.js
+++ b/dist/cjs/index.js
@@ -57,7 +57,7 @@ function _export_star(from, to) {
const logger = _chopsticks.defaultLogger.child({
name: 'utils'
});
-const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock })=>{
+const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, rpcTimeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock })=>{
// random port if not specified
port = port ?? Math.floor(Math.random() * 10000) + 10000;
const config = {
@@ -72,6 +72,7 @@ const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, time
db,
'wasm-override': wasmOverride,
timeout,
+ 'rpc-timeout': rpcTimeout,
resume: resume ?? false,
'allow-unresolved-imports': allowUnresolvedImports,
'process-queued-messages': processQueuedMessages,
diff --git a/dist/esm/index.d.ts b/dist/esm/index.d.ts
index e072ffe6156827581272398cf9acd9352d1b502b..ecec2991498332c287c47f35546932126141b001 100644
--- a/dist/esm/index.d.ts
+++ b/dist/esm/index.d.ts
@@ -23,6 +23,8 @@ export type SetupOption = {
db?: string;
/** Connection timeout in milliseconds */
timeout?: number;
+ /** Upstream RPC timeout in milliseconds (chopsticks -> upstream/proxy). Forwarded as rpc-timeout. */
+ rpcTimeout?: number;
/** Host address to bind the server to */
host?: string;
/** Port number to bind the server to */
@@ -52,7 +54,7 @@ export type SetupConfig = Config & {
* @param options - Setup options for the network
* @returns Configuration object compatible with chopsticks
*/
-export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock, }: SetupOption) => SetupConfig;
+export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, rpcTimeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock, }: SetupOption) => SetupConfig;
/**
* Sets up a blockchain network context using provided options
* @param option - Setup options for the network
diff --git a/dist/esm/index.js b/dist/esm/index.js
index 6509ac6f609c0abcef9996b563181930ae933413..bb2db6a13d46f46cc5d1c7cee53708e3f53b08da 100644
--- a/dist/esm/index.js
+++ b/dist/esm/index.js
@@ -12,7 +12,7 @@ export * from './signFake.js';
* Creates a configuration object from setup options
* @param options - Setup options for the network
* @returns Configuration object compatible with chopsticks
- */ export const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock })=>{
+ */ export const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, rpcTimeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock })=>{
// random port if not specified
port = port ?? Math.floor(Math.random() * 10000) + 10000;
const config = {
@@ -27,6 +27,7 @@ export * from './signFake.js';
db,
'wasm-override': wasmOverride,
timeout,
+ 'rpc-timeout': rpcTimeout,
resume: resume ?? false,
'allow-unresolved-imports': allowUnresolvedImports,
'process-queued-messages': processQueuedMessages,
2 changes: 1 addition & 1 deletion KNOWN_GOOD_BLOCK_NUMBERS_WESTEND.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ASSETHUBWESTEND_BLOCK_NUMBER=15118358
ASSETHUBWESTEND_BLOCK_NUMBER=15151649
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"node-gyp": "^11.0.0",
"@polkadot/types@npm:^16.4.1": "patch:@polkadot/types@npm%3A16.5.6#~/.yarn/patches/@polkadot-types-npm-16.5.6-6fe2703ed8.patch",
"@polkadot/types@npm:^16.5.4": "patch:@polkadot/types@npm%3A16.5.6#~/.yarn/patches/@polkadot-types-npm-16.5.6-6fe2703ed8.patch",
"@polkadot/types@npm:16.5.6": "patch:@polkadot/types@npm%3A16.5.6#~/.yarn/patches/@polkadot-types-npm-16.5.6-6fe2703ed8.patch"
"@polkadot/types@npm:16.5.6": "patch:@polkadot/types@npm%3A16.5.6#~/.yarn/patches/@polkadot-types-npm-16.5.6-6fe2703ed8.patch",
"@acala-network/chopsticks-utils@npm:1.4.0": "patch:@acala-network/chopsticks-utils@npm%3A1.4.0#~/.yarn/patches/@acala-network-chopsticks-utils-npm-1.4.0-abeade0cda.patch"
},
"packageManager": "yarn@4.14.1",
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/networks/src/defineChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export function defineChain<
db: process.env.DB_PATH,
runtimeLogLevel: process.env.RUNTIME_LOG_LEVEL ? Number(process.env.RUNTIME_LOG_LEVEL) : 0,
blockNumber: toNumber(process.env[`${upperName}_BLOCK_NUMBER`]),
timeout: 60_000,
timeout: 90_000,
rpcTimeout: 90_000,
port: 0,
allowUnresolvedImports: true,
saveBlock: false,
Expand Down
4 changes: 2 additions & 2 deletions packages/networks/src/pet-chain-endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"collectivesPolkadot": [
"wss://sys.ibp.network/collectives-polkadot",
"wss://collectives-polkadot.dotters.network",
"wss://collectives.api.onfinality.io/public-ws",
"wss://rpc-collectives-polkadot.luckyfriday.io",
"wss://collectives-polkadot-rpc.n.dwellir.com",
"wss://dot-rpc.stakeworld.io/collectives",
Expand Down Expand Up @@ -131,7 +130,8 @@
"wss://karura-rpc.n.dwellir.com"
],
"bifrostKusama": [
"wss://us.bifrost-rpc.liebi.com/ws"
"wss://hk.bifrost-rpc.liebi.com/ws",
"wss://bifrost-rpc.liebi.com/ws"
],
"basilisk": [
"wss://basilisk-rpc.n.dwellir.com",
Expand Down
16 changes: 16 additions & 0 deletions vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ export default defineConfig({
passWithNoTests: true,
retry: 1,
reporters: process.env.GITHUB_ACTIONS ? ['verbose', 'github-actions'] : ['default'],
// Excluded chains:
//
// - bifrostKusama: only Liebi public endpoint (us./hk./generic) is configured,
// and the only currently-reachable host prunes the state CI needs.
// - acala: Subway hardcodes its per-upstream request_timeout to 30s and
// doesn't expose it in `ClientConfig`, so heavy Acala storage queries
// that take >30s force Subway to cycle through the 3 Liebi endpoints,
// none of which respond inside the chopsticks rpcTimeout (90s here).
// Unblock via an upstream Subway fix (`request_timeout` in YAML).
exclude: [
'**/node_modules/**',
'**/.git/**',
'packages/kusama/src/bifrostKusama.*.test.ts',
'packages/kusama/src/karura.bifrostKusama.xcm.test.ts',
'packages/polkadot/src/acala.*.test.ts',
],
},
build: {
outDir: '../../dist',
Expand Down
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ __metadata:
languageName: node
linkType: hard

"@acala-network/chopsticks-utils@patch:@acala-network/chopsticks-utils@npm%3A1.4.0#~/.yarn/patches/@acala-network-chopsticks-utils-npm-1.4.0-abeade0cda.patch":
version: 1.4.0
resolution: "@acala-network/chopsticks-utils@patch:@acala-network/chopsticks-utils@npm%3A1.4.0#~/.yarn/patches/@acala-network-chopsticks-utils-npm-1.4.0-abeade0cda.patch::version=1.4.0&hash=cb2edc"
dependencies:
"@acala-network/chopsticks": "npm:1.4.0"
"@acala-network/chopsticks-core": "npm:1.4.0"
"@polkadot-labs/hdkd": "npm:^0.0.19"
"@polkadot-labs/hdkd-helpers": "npm:^0.0.19"
"@polkadot/api": "npm:^16.4.1"
"@polkadot/api-base": "npm:^16.4.1"
"@polkadot/keyring": "npm:^14.0.1"
"@polkadot/types": "npm:^16.4.1"
"@polkadot/util": "npm:^14.0.1"
polkadot-api: "npm:^1.14.1"
checksum: 10c0/e3276c0bbe8ab4b8c2c366eee9595807f1fbaf0bd4e34c52ab65edb39c63d959254518549ab7fc41cc4e8be9dfb2573644506eddbff2e1500f36c7a6779ec325
languageName: node
linkType: hard

"@acala-network/chopsticks@npm:1.4.0, @acala-network/chopsticks@npm:^1.4.0":
version: 1.4.0
resolution: "@acala-network/chopsticks@npm:1.4.0"
Expand Down
Loading