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
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' || '' }}
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/zombienet-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 3 additions & 10 deletions config/ports.env
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion networks/previewnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"web3-storage": {
"repo": "paritytech/web3-storage",
"tag": "latest"
"tag": "v0.5.1-paseo"
}
},
"genesisConfig": {
Expand Down
28 changes: 12 additions & 16 deletions packages/cli/src/commands/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}...`);
Expand All @@ -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.
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/spawn-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions packages/network-config/src/toml-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ const CHAIN_ARGS: Record<ChainKey, ChainDef> = {
'web3-storage': {
required: [
'--collator',
'--authoring=slot-based',
'--rpc-max-connections=500',
'--unsafe-rpc-external',
'--rpc-max-response-size=50',
Expand Down
5 changes: 5 additions & 0 deletions packages/network-config/tests/toml-generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/network-config/tests/turn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion zombienet-configs/local-dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading