Skip to content

Commit 3025030

Browse files
committed
fablish fragmentalisation
1 parent a18fce8 commit 3025030

96 files changed

Lines changed: 2842 additions & 2928 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
- name: Require HTTPS endpoints for the PWA
5252
env:
53-
PUBLIC_API_ORIGIN: https://api.slashveto.me
53+
PUBLIC_API_ORIGIN: ${{ vars.VITE_API_BASE_URL || 'https://api.slashveto.me' }}
5454
MAINNET_L1_RPC_URL: ${{ vars.VITE_L1_RPC_URL }}
5555
TESTNET_L1_RPC_URL: ${{ vars.VITE_TESTNET_L1_RPC_URL }}
5656
run: |
@@ -64,17 +64,14 @@ jobs:
6464
fi
6565
}
6666
67-
if [[ -z "$PUBLIC_API_ORIGIN" || "$PUBLIC_API_ORIGIN" != https://* || "$PUBLIC_API_ORIGIN" == *,* ]]; then
68-
echo "VITE_API_BASE_URL must be one public HTTPS API origin."
69-
exit 1
70-
fi
67+
require_https_url VITE_API_BASE_URL "$PUBLIC_API_ORIGIN"
7168
require_https_url VITE_L1_RPC_URL "$MAINNET_L1_RPC_URL"
7269
require_https_url VITE_TESTNET_L1_RPC_URL "$TESTNET_L1_RPC_URL"
7370
7471
- name: Lint, test, syntax-check, and build
7572
run: pnpm check
7673
env:
77-
VITE_API_BASE_URL: https://api.slashveto.me
74+
VITE_API_BASE_URL: ${{ vars.VITE_API_BASE_URL || 'https://api.slashveto.me' }}
7875
VITE_BASE_PATH: ${{ vars.VITE_BASE_PATH || '/' }}
7976
VITE_L1_RPC_URL: ${{ vars.VITE_L1_RPC_URL }}
8077
VITE_REGISTRY_ADDRESS: ${{ vars.VITE_REGISTRY_ADDRESS }}

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ and action order, never by address and approximate time.
3232

3333
## Repository
3434

35-
- `shared/protocol/` contains the pure case projection, tallying, transitions,
36-
and notification wording shared by frontend and backend.
35+
- `shared/protocol/` contains the pure case projection, vote tallying, round
36+
lifecycle, transitions, and notification wording shared by frontend and
37+
backend.
3738
- `src/` contains the React PWA and independent browser L1 collector.
3839
- `collector/` contains the Node backend, SQLite repository, three evidence
3940
collectors, API, durable outbox, Telegram, and Web Push.

collector/deploy/slashmon-backend-testing.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Install as /etc/slashmon-backend-testing.env with mode 0600.
2+
# Set SLASHMON_NETWORK=testnet when this instance should track testnet.
3+
# SLASHMON_NETWORK=testnet
24
SLASHMON_PUBLIC_URL=https://testing.slashveto.me
35
BACKEND_CORS_ORIGIN=https://testing.slashveto.me
46
BACKEND_BIND_HOST=127.0.0.1

collector/src/admin-client.mjs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,12 @@ export class AztecAdminClient {
126126
});
127127
} catch (error) {
128128
if (requestSignal.aborted && !signal?.aborted) {
129-
throw new Error(`${request.label} request timed out after ${this.timeoutMs}ms`);
129+
throw new Error(`${request.label} request timed out after ${this.timeoutMs}ms`, { cause: error });
130130
}
131-
throw new Error(`${request.label} request failed: ${error instanceof Error ? error.message : String(error)}`);
131+
throw new Error(
132+
`${request.label} request failed: ${error instanceof Error ? error.message : String(error)}`,
133+
{ cause: error },
134+
);
132135
}
133136

134137
const responseLimit = method === 'aztec_getValidatorStats'
@@ -172,8 +175,8 @@ export function parseNodeInfo(value) {
172175
}
173176
return {
174177
l1ChainId: parseChainId(value.l1ChainId),
175-
registryAddress: parseIdentityAddress(contracts.registryAddress, 'registryAddress'),
176-
rollupAddress: parseIdentityAddress(contracts.rollupAddress, 'rollupAddress'),
178+
registryAddress: parseAddress(contracts.registryAddress, 'node info registryAddress'),
179+
rollupAddress: parseAddress(contracts.rollupAddress, 'node info rollupAddress'),
177180
};
178181
}
179182

@@ -337,13 +340,6 @@ function parseChainId(value) {
337340
return parsed;
338341
}
339342

340-
function parseIdentityAddress(value, name) {
341-
if (typeof value !== 'string' || !/^0x[0-9a-fA-F]{40}$/.test(value) || /^0x0{40}$/i.test(value)) {
342-
throw new Error(`Aztec node info ${name} must be a nonzero 20-byte hex address`);
343-
}
344-
return value.toLowerCase();
345-
}
346-
347343
function parseAddress(value, label) {
348344
if (typeof value !== 'string' || !/^0x[0-9a-fA-F]{40}$/.test(value) || /^0x0{40}$/i.test(value)) {
349345
throw new Error(`Aztec ${label} must be a nonzero 20-byte hex address`);

collector/src/case-api-server.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ export class CaseApiServer {
110110
if (!this.server.listening) return Promise.resolve();
111111
return new Promise((resolve, reject) => {
112112
this.server.close((error) => error ? reject(error) : resolve());
113+
// Keep-alive sockets otherwise hold close() open until they idle out.
114+
this.server.closeIdleConnections();
113115
});
114116
}
115117

@@ -215,6 +217,7 @@ export class CaseApiServer {
215217
addresses,
216218
now: this.now(),
217219
});
220+
if (!updated) throw new InputError('watch_not_found', 'Watch not found', 404);
218221
return this.send(request, response, 200, publicWatch(updated, this.repository));
219222
}
220223
if (request.method === 'DELETE') {

0 commit comments

Comments
 (0)