@ocap/chain-node 1.32.0 → 1.32.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/access-log.d.mts +5 -2
- package/esm/access-log.mjs +5 -3
- package/esm/config-consistency.d.mts +59 -0
- package/esm/config-consistency.mjs +256 -0
- package/esm/env.mjs +1 -1
- package/esm/follower-config.d.mts +26 -0
- package/esm/follower-config.mjs +83 -0
- package/esm/index.d.mts +4 -2
- package/esm/index.mjs +4 -2
- package/esm/standalone-env.d.mts +54 -1
- package/esm/standalone-env.mjs +82 -1
- package/esm/start-chain-node.mjs +69 -18
- package/esm/types.d.mts +23 -1
- package/lib/access-log.cjs +4 -2
- package/lib/access-log.d.cts +5 -2
- package/lib/config-consistency.cjs +263 -0
- package/lib/config-consistency.d.cts +59 -0
- package/lib/env.cjs +1 -1
- package/lib/follower-config.cjs +90 -0
- package/lib/follower-config.d.cts +26 -0
- package/lib/index.cjs +20 -1
- package/lib/index.d.cts +4 -2
- package/lib/standalone-env.cjs +89 -0
- package/lib/standalone-env.d.cts +54 -1
- package/lib/start-chain-node.cjs +71 -21
- package/lib/types.d.cts +23 -1
- package/package.json +16 -16
package/lib/types.d.cts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { FutureTimestampGuardConfig, TChainConfigCheckMode } from "./standalone-env.cjs";
|
|
1
2
|
import { CHAIN_NODE_TEST_HOOKS_TOKEN } from "./test-hooks-token.cjs";
|
|
2
3
|
import express from "express";
|
|
4
|
+
import { IChainConfig, IPipelineLogger, TFollowerSyncMode, TNodeWritePolicy } from "@ocap/types";
|
|
3
5
|
import http from "node:http";
|
|
4
6
|
import { AnchorPublisher, ICheckpointSignerWallet, IHotStuffRuntimeValidatorMember, ILedgerHealth, INodeRoleConfig, ISegmentArchiveStore, IWriterLeaseConfig, Ledger, LedgerConfig } from "@arcblock/ledger-core";
|
|
5
7
|
import { SqliteLedgerStorage } from "@arcblock/ledger-sqlite";
|
|
@@ -7,7 +9,6 @@ import SqliteIndexDB from "@ocap/indexdb-sqlite";
|
|
|
7
9
|
import OCAPResolver, { FollowerSyncService, HotStuffNodeRuntime, HotStuffNodeRuntimeOptions, IColdSegmentReader, INodeMaintenanceController, NodePreferencesManager, TFollowerUpstreamFetchKind } from "@ocap/resolver";
|
|
8
10
|
import SqliteStateDB from "@ocap/statedb-sqlite";
|
|
9
11
|
import { SqliteTrustedStorage } from "@ocap/trusted-storage";
|
|
10
|
-
import { IChainConfig, IPipelineLogger, TFollowerSyncMode, TNodeWritePolicy } from "@ocap/types";
|
|
11
12
|
|
|
12
13
|
//#region src/types.d.ts
|
|
13
14
|
type ILedgerLeaseOptions = IWriterLeaseConfig;
|
|
@@ -85,6 +86,11 @@ interface FollowerRoleConfig {
|
|
|
85
86
|
signer?: ChainNodeSignerConfig;
|
|
86
87
|
/** Optional explicit runtime role (`'follower'` default or `'standby'`) */
|
|
87
88
|
runtimeRole?: 'follower' | 'standby';
|
|
89
|
+
/**
|
|
90
|
+
* First sequence whose orphan ledger entries the initial index build indexes (default: where the chain's leader
|
|
91
|
+
* began indexing them, see `orphanIndexFromSequence`; 1 for chains not listed there).
|
|
92
|
+
*/
|
|
93
|
+
orphanIndexFromSequence?: number;
|
|
88
94
|
}
|
|
89
95
|
interface HotStuffValidatorRoleConfig {
|
|
90
96
|
kind: 'hotstuff';
|
|
@@ -190,6 +196,22 @@ interface ChainProfileBase {
|
|
|
190
196
|
env?: Record<string, string | undefined>;
|
|
191
197
|
};
|
|
192
198
|
validateTokenConfig?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Follower only (#1961): before any replay, compare the consensus config this node replays with against the
|
|
201
|
+
* upstream leader's `getConfig`. Default `off` (no request). `enforce` refuses to start on a difference.
|
|
202
|
+
*/
|
|
203
|
+
configCheck?: {
|
|
204
|
+
mode: TChainConfigCheckMode;
|
|
205
|
+
/** Stub upstream for tests; defaults to `getConfig` over `<upstreamChainUrl>/api/gql`. */
|
|
206
|
+
fetchUpstreamConfig?: (upstreamUrl: string) => Promise<unknown>;
|
|
207
|
+
/** `enforce`: how long an unavailable upstream is retried before deciding (default 60 s). */
|
|
208
|
+
retryDeadlineMs?: number;
|
|
209
|
+
};
|
|
210
|
+
/** Follower only (#1961): acceptance guards on replayed ledger entries. Default: none (today's behavior). */
|
|
211
|
+
replayGuards?: {
|
|
212
|
+
/** Refuse (retryably) entries at or after `activationSequence` whose timestamp is ahead of the local clock. */
|
|
213
|
+
futureTimestamp?: FutureTimestampGuardConfig;
|
|
214
|
+
};
|
|
193
215
|
logger?: IPipelineLogger;
|
|
194
216
|
configureApp?: (app: express.Express, ctx: ChainAppHookContext) => void | Promise<void>;
|
|
195
217
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.32.
|
|
6
|
+
"version": "1.32.2",
|
|
7
7
|
"description": "Unified OCAP chain node runtime assembly (Validator, Standby, Keyless Follower)",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./lib/index.cjs",
|
|
@@ -54,26 +54,26 @@
|
|
|
54
54
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
55
55
|
"license": "MIT",
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@ocap/mcrypto": "1.32.
|
|
58
|
-
"@ocap/message": "1.32.
|
|
57
|
+
"@ocap/mcrypto": "1.32.2",
|
|
58
|
+
"@ocap/message": "1.32.2",
|
|
59
59
|
"@types/express": "^4.17.23",
|
|
60
60
|
"@types/node": "^20.10.0",
|
|
61
61
|
"tsdown": "^0.18.4"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@arcblock/did": "1.32.
|
|
65
|
-
"@arcblock/ledger-core": "1.32.
|
|
66
|
-
"@arcblock/ledger-sqlite": "1.32.
|
|
67
|
-
"@ocap/config": "1.32.
|
|
68
|
-
"@ocap/gql": "1.32.
|
|
69
|
-
"@ocap/indexdb-sqlite": "1.32.
|
|
70
|
-
"@ocap/resolver": "1.32.
|
|
71
|
-
"@ocap/state": "1.32.
|
|
72
|
-
"@ocap/statedb-sqlite": "1.32.
|
|
73
|
-
"@ocap/trusted-storage": "1.32.
|
|
74
|
-
"@ocap/types": "1.32.
|
|
75
|
-
"@ocap/util": "1.32.
|
|
76
|
-
"@ocap/wallet": "1.32.
|
|
64
|
+
"@arcblock/did": "1.32.2",
|
|
65
|
+
"@arcblock/ledger-core": "1.32.2",
|
|
66
|
+
"@arcblock/ledger-sqlite": "1.32.2",
|
|
67
|
+
"@ocap/config": "1.32.2",
|
|
68
|
+
"@ocap/gql": "1.32.2",
|
|
69
|
+
"@ocap/indexdb-sqlite": "1.32.2",
|
|
70
|
+
"@ocap/resolver": "1.32.2",
|
|
71
|
+
"@ocap/state": "1.32.2",
|
|
72
|
+
"@ocap/statedb-sqlite": "1.32.2",
|
|
73
|
+
"@ocap/trusted-storage": "1.32.2",
|
|
74
|
+
"@ocap/types": "1.32.2",
|
|
75
|
+
"@ocap/util": "1.32.2",
|
|
76
|
+
"@ocap/wallet": "1.32.2",
|
|
77
77
|
"cors": "^2.8.5",
|
|
78
78
|
"express": "^4.22.1"
|
|
79
79
|
}
|