diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3c5c78..2216aaf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -204,7 +204,9 @@ jobs: # ========================================================================== build-docker: needs: prepare - runs-on: ubuntu-latest + # `ppn fetch` runs the bundled Postgres, which needs libxml2.so.2: Ubuntu 26.04 has none, + # and the image itself is 24.04. + runs-on: ubuntu-24.04 # No environment on a dry run: it exists to carry the registry credentials, and a run # that pushes nothing needs none — which also keeps the build off any approval gate. environment: ${{ needs.prepare.outputs.publish == 'true' && 'docker' || '' }} diff --git a/.github/workflows/zombienet-tests.yml b/.github/workflows/zombienet-tests.yml index a94399b..3f51727 100644 --- a/.github/workflows/zombienet-tests.yml +++ b/.github/workflows/zombienet-tests.yml @@ -158,7 +158,9 @@ jobs: # resolving into node_modules once descriptors shipped, and the launchers dying on zombienet's # HOME-less environment. No test running in a checkout could see any of them. npm-install-smoke-test: - runs-on: ubuntu-latest + # The bundled Postgres links libxml2.so.2, which Ubuntu 26.04 (ubuntu-latest) no longer + # ships. 24.04 is what the Docker image and the deployed servers run. + runs-on: ubuntu-24.04 timeout-minutes: 30 steps: - uses: actions/checkout@v7 @@ -551,15 +553,11 @@ jobs: # Re-enable (drop continue-on-error) once the previewnet preset's # min_duration is lowered to match the demo (todo). continue-on-error: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} timeout-minutes: 15 run: | set -e source ./config/ports.env - W3S_TAG=$(curl -sL -H "Authorization: token $GITHUB_TOKEN" \ - "https://api.github.com/repos/paritytech/web3-storage/releases/latest" \ - | jq -r .tag_name) + W3S_TAG=$(jq -r '.releases["web3-storage"].tag' networks/previewnet.json) echo "Cloning paritytech/web3-storage @ $W3S_TAG" git clone --depth 1 --branch "$W3S_TAG" \ https://github.com/paritytech/web3-storage.git /tmp/w3s diff --git a/config/ports.env b/config/ports.env index f2375b2..4fe18df 100644 --- a/config/ports.env +++ b/config/ports.env @@ -51,19 +51,12 @@ BOOTNODE_HOSTNAME=127.0.0.1 # webrtc-direct advertises what it binds, so a 127.0.0.1 listener is reachable by nobody else. P2P_LISTEN_IP=127.0.0.1 -# Storage-provider data dir (disk mode). Empty locally so the wrapper derives it +# Storage-provider data dir. Empty locally so the wrapper derives it # from DATA_DIR; a deployment patches this to an absolute path under the # persistent DATA_DIR, because zombie-cli does not forward env vars to # custom_processes (same reason BOOTNODE_HOSTNAME is patched here). WEB3_STORAGE_PROVIDER_DATA_DIR= -# Storage-provider storage mode: "disk" (persistent) or "inmemory" (ephemeral). -# Defaults to disk. zombie-cli does not forward env vars to custom_processes, so -# EPHEMERAL cannot reach the wrapper directly; for native runs `make start` -# regenerates config/ports.local.env (sourced after this file) to flip the mode -# to inmemory under EPHEMERAL=1. The server stays on the disk default. -WEB3_STORAGE_PROVIDER_STORAGE_MODE=disk - # Auxiliary service ports (defaults from binaries) ETH_RPC_PORT=8545 @@ -101,12 +94,12 @@ DUB_PORT=8092 # TURN/STUN (eturnal, docs/TURN.md). TURN_PORT takes UDP and TCP straight from clients on # P2P_LISTEN_IP: STUN has to see the client's own address, so it cannot sit behind nginx. # nginx terminates TLS on TURN_TLS_PORT and forwards to TURN_PROXY_PORT with the PROXY -# protocol. The relay range must be open in the firewall alongside TURN_PORT. +# protocol. The relay range must be open in the firewall (UDP) alongside TURN_PORT. TURN_PORT=3478 TURN_TLS_PORT=5349 TURN_PROXY_PORT=3479 TURN_RELAY_MIN_PORT=49152 -TURN_RELAY_MAX_PORT=49407 +TURN_RELAY_MAX_PORT=65535 # The dashboard: the network's own status UI and API (docs/DASHBOARD.md) DASHBOARD_PORT=8090 diff --git a/networks/previewnet.json b/networks/previewnet.json index e7b15eb..43f3b25 100644 --- a/networks/previewnet.json +++ b/networks/previewnet.json @@ -33,7 +33,7 @@ }, "web3-storage": { "repo": "paritytech/web3-storage", - "tag": "latest" + "tag": "v0.5.1-paseo" } }, "genesisConfig": { diff --git a/packages/cli/src/commands/service.ts b/packages/cli/src/commands/service.ts index c462997..db39c40 100644 --- a/packages/cli/src/commands/service.ts +++ b/packages/cli/src/commands/service.ts @@ -735,9 +735,10 @@ async function storageProviderNode(ctx: ServiceContext, _deps: ServiceDeps = {}) console.log(` using sibling build: ${binary}`); } - const keyfile = path.join(fs.mkdtempSync(path.join(os.tmpdir(), 'ppn-sp-')), 'key'); + const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ppn-sp-')); + process.on('exit', () => fs.rmSync(tempDir, { recursive: true, force: true })); + const keyfile = path.join(tempDir, 'key'); fs.writeFileSync(keyfile, '//Alice\n', { mode: 0o600 }); - process.on('exit', () => fs.rmSync(path.dirname(keyfile), { recursive: true, force: true })); const chainPort = ctx.ports.WEB3_STORAGE_PORT; console.log(`storage-provider-node: waiting for the web3-storage chain on 127.0.0.1:${chainPort}...`); @@ -749,27 +750,22 @@ async function storageProviderNode(ctx: ServiceContext, _deps: ServiceDeps = {}) publicMultiaddr = `/dns4/${hostname}/tcp/443/tls/http/http-path/web3-storage-provider`; } - const inMemory = (ctx.ports.WEB3_STORAGE_PROVIDER_STORAGE_MODE ?? 'disk') === 'inmemory'; - const storageArgs = ['--storage-mode', 'inmemory']; - if (!inMemory) { - const storagePath = - process.env.STORAGE_PATH || - ctx.ports.WEB3_STORAGE_PROVIDER_DATA_DIR || - path.join(ctx.dataDir, 'web3-storage-provider'); - fs.mkdirSync(storagePath, { recursive: true }); - storageArgs.length = 0; - storageArgs.push('--storage-mode', 'disk', '--storage-path', storagePath); - } + const storagePath = + ctx.ports.PPN_EPHEMERAL === '1' + ? path.join(tempDir, 'data') + : process.env.STORAGE_PATH || + ctx.ports.WEB3_STORAGE_PROVIDER_DATA_DIR || + path.join(ctx.dataDir, 'web3-storage-provider'); + fs.mkdirSync(storagePath, { recursive: true }); const args = [ '--keyfile', keyfile, - ...storageArgs, + '--storage-path', storagePath, '--bind-addr', `127.0.0.1:${ctx.ports.WEB3_STORAGE_PROVIDER_PORT}`, '--chain-rpc', `ws://127.0.0.1:${chainPort}`, ...(publicMultiaddr ? ['--public-multiaddr', publicMultiaddr] : []), - '--enable-checkpoint-coordinator', ]; - console.log(` storage: ${storageArgs.join(' ')}`); + console.log(` storage: ${storagePath}`); if (publicMultiaddr) console.log(` advertising: ${publicMultiaddr}`); // Replaces this process for the lifetime of the network, the way the wrapper's exec did. diff --git a/packages/cli/src/lib/spawn-env.ts b/packages/cli/src/lib/spawn-env.ts index ca48fdd..5a9c3b5 100644 --- a/packages/cli/src/lib/spawn-env.ts +++ b/packages/cli/src/lib/spawn-env.ts @@ -31,7 +31,6 @@ export interface LocalEnvFacts { export function localEnvContent(f: LocalEnvFacts): string { return ( '# Generated by `ppn start` — gitignored, do not edit.\n' + - `WEB3_STORAGE_PROVIDER_STORAGE_MODE=${f.ephemeral ? 'inmemory' : 'disk'}\n` + `DUB_POSTGRES_DATA_DIR=${f.identityDataDir}\n` + `PPN_NETWORK=${f.network}\n` + // The services load the network themselves, and see the overlay's nodes only through this. diff --git a/packages/network-config/src/toml-generator.ts b/packages/network-config/src/toml-generator.ts index bd34995..7d79c8b 100644 --- a/packages/network-config/src/toml-generator.ts +++ b/packages/network-config/src/toml-generator.ts @@ -252,6 +252,7 @@ const CHAIN_ARGS: Record = { 'web3-storage': { required: [ '--collator', + '--authoring=slot-based', '--rpc-max-connections=500', '--unsafe-rpc-external', '--rpc-max-response-size=50', diff --git a/packages/network-config/tests/toml-generator.test.ts b/packages/network-config/tests/toml-generator.test.ts index 59f6dae..99e5455 100644 --- a/packages/network-config/tests/toml-generator.test.ts +++ b/packages/network-config/tests/toml-generator.test.ts @@ -331,6 +331,11 @@ describe('generateToml with custom log targets', () => { assert.ok(toml.includes('--force-authoring')); assert.ok(toml.includes('-lsync=info')); }); + + it('runs the web3-storage collator slot-based, the only authoring that sends the relay parent descendants its runtime requires', () => { + const toml = generateToml(['web3-storage']); + assert.ok(toml.includes('--authoring=slot-based')); + }); }); describe('generateToml with enableHop', () => { diff --git a/packages/network-config/tests/turn.test.ts b/packages/network-config/tests/turn.test.ts index 4579129..11b05e4 100644 --- a/packages/network-config/tests/turn.test.ts +++ b/packages/network-config/tests/turn.test.ts @@ -47,7 +47,7 @@ describe('eturnalConfig', () => { assert.ok(!yml.includes('whitelist_peers')); assert.match(yml, /ip: "203\.0\.113\.4"\n {6}port: 3478\n {6}transport: udp/); assert.match(yml, /ip: "127\.0\.0\.1"\n {6}port: 3479\n {6}transport: tcp\n {6}proxy_protocol: true/); - assert.match(yml, /relay_min_port: 49152\n {2}relay_max_port: 49407/); + assert.match(yml, /relay_min_port: 49152\n {2}relay_max_port: 65535/); }); it('never writes the secret to disk', () => { diff --git a/zombienet-configs/local-dev.toml b/zombienet-configs/local-dev.toml index a36f075..ead6e39 100644 --- a/zombienet-configs/local-dev.toml +++ b/zombienet-configs/local-dev.toml @@ -117,7 +117,7 @@ rpc_port = 10040 p2p_port = 30337 prometheus_port = 20040 command = "{{SCRIPTS}}/omni-node.sh" -args = ["-lruntime=info", "--collator", "--rpc-max-connections=500", "--unsafe-rpc-external", "--rpc-max-response-size=50", "--listen-addr=/ip4/127.0.0.1/udp/30337/webrtc-direct"] +args = ["-lruntime=info", "--collator", "--authoring=slot-based", "--rpc-max-connections=500", "--unsafe-rpc-external", "--rpc-max-response-size=50", "--listen-addr=/ip4/127.0.0.1/udp/30337/webrtc-direct"] [[hrmp_channels]] sender = 1502