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
7 changes: 7 additions & 0 deletions .github/actions/bulletin/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ runs:
CI: "true"
FORCE_COLOR: "0"
NODE_NO_WARNINGS: "1"
# ubuntu-latest runners have ≥16 GiB RAM; default ~2 GiB Node heap
# leaves no headroom if a transient leak window opens during a WS
# halt teardown. Raising it is a cheap safety net independent of
# the in-CLI cancellation fixes.
NODE_OPTIONS: "--max-old-space-size=4096"
RETRY_DELAY: ${{ inputs.retry-delay }}

- name: Upload to Bulletin
Expand Down Expand Up @@ -124,5 +129,7 @@ runs:
CI: "true"
FORCE_COLOR: "0"
NODE_NO_WARNINGS: "1"
# See note in the authorize step above.
NODE_OPTIONS: "--max-old-space-size=4096"
RETRY_DELAY: ${{ inputs.retry-delay }}
CACHE: ${{ inputs.cache }}
18 changes: 17 additions & 1 deletion packages/cli/src/bulletin/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ const WAVE_TIMEOUT_MS = 60_000;
const STORE_CALL_TIMEOUT_MS = 60_000;
export const FINAL_STORE_CALL_TIMEOUT_MS = 180_000;
const FETCH_NONCE_TIMEOUT_MS = 15_000;
// polkadot-api ws-provider defaults to 40_000 ms, which is shorter than a
// single Bulletin chunk's worst-case best-block inclusion latency under
// contention (we observed >50 s outliers). Raise it well above WAVE_TIMEOUT_MS
// so the transport layer never tears down a healthy WS while the chain is
// still acknowledging an in-flight extrinsic.
const WS_HEARTBEAT_TIMEOUT_MS = 300_000;
// polkadot-api ws-provider default is 3_500 ms; give the handshake more
// headroom on slow links (CI runners → Scaleway can spike past that).
const WS_CONNECT_TIMEOUT_MS = 10_000;
let rxUnhandledErrorGuardInstalled = false;

export type AdaptiveWindowUpdateInput = {
Expand Down Expand Up @@ -468,7 +477,14 @@ export function formatTransactionWatchFailure(

export function createBulletinClient(rpc: string): PolkadotClient {
installRxUnhandledErrorGuard();
return createPolkadotClient(withPolkadotSdkCompat(getWsProvider(rpc)));
return createPolkadotClient(
withPolkadotSdkCompat(
getWsProvider(rpc, {
heartbeatTimeout: WS_HEARTBEAT_TIMEOUT_MS,
timeout: WS_CONNECT_TIMEOUT_MS,
}),
),
);
}

async function storeContentOnBulletin(
Expand Down
Loading