@ocap/config 1.31.1 → 1.31.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/README.md CHANGED
@@ -13,3 +13,34 @@ Then:
13
13
  ```javascript
14
14
  // TODO
15
15
  ```
16
+
17
+ ## Bridge (`transaction.bridge.enabled`)
18
+
19
+ See `bridge/docs/ocap-protocols.md` §v2.3.
20
+
21
+ - The only bridge setting in the chain config is the master switch `transaction.bridge.enabled` (absent means `false`).
22
+ While it is off, no transfer into a bridge reserve and no release out of one is accepted by the post-execution gate.
23
+ Creating, governing and migrating bridges (`create_rollup` and friends) is not switched: a bridge can be staged before
24
+ the switch is turned on. The flag is persisted with the rest of `transaction` in the chain state.
25
+ - Everything per bridge (token, gateway, epochs, caps, pause) lives on chain in the bridge's `RollupState`. Every v2
26
+ bridge has its own keyless reserve, derived by `toBridgeReserveAddress(bridge)` (DID role `ROLE_BRIDGE_RESERVE`), so
27
+ there is no reserve vault to configure.
28
+ - Removed by #1505: `vaults.bridgeReserve` and the v1 top-level `bridge` section (#1464), with their validation,
29
+ `computeBridgeConfigHash` / `bridgeConfigHash` and the keyless-pk exemption (a configured account now has to match its
30
+ public key unless it is a `txGas` vault; `getConfig` no longer returns `bridgeConfigHash`). Operators: delete both keys
31
+ from node configs and set `transaction.bridge.enabled` instead. They were never used on a live chain.
32
+ Old configs that still carry them parse fine: unknown keys are stripped silently, and they are no longer read.
33
+ `VaultConfig.bridge_reserve` stays in the proto (field 4, deprecated, ignored) so existing chain-state rows decode.
34
+
35
+ ## Legacy Rollup v1 Sunset (`transaction.rollupV1.enabled`)
36
+
37
+ - `transaction.rollupV1.enabled` defaults to `true` when absent so existing Rollup v1 chains can complete their drain/cutover without config changes.
38
+ - Setting `transaction.rollupV1.enabled: false` sunsets legacy Rollup v1:
39
+ - Rejects v1 `create_rollup`, `update_rollup`, `join_rollup`, `leave_rollup`, `resume_rollup`, `migrate_rollup`, `create_rollup_block`, `claim_block_reward`, `deposit_token_v2`, and `withdraw_token_v2` with `UNSUPPORTED_TX`, while keeping all v2 bridges (`data.version == 2`) fully operational.
40
+ - Preserves emergency `pause_rollup` and `close_rollup` on legacy v1 rows so operators can always freeze or retire any remaining v1 rollup and unlock validator stakes.
41
+ - Disables the `create_rollup_block` supply mint/burn exemption inside `PostExecutionInvariantGate` (#1427, #1430).
42
+
43
+ ## `exchange_v2` Default Implicit TTL (`transaction.exchangeV2.defaultTtlSeconds`)
44
+
45
+ - When an `exchange_v2` transaction omits `itx.expiredAt`, the protocol enforces a default maximum lifetime against millisecond `tx.nonce` (`tx.nonce >= txTimeMs - defaultTtlSeconds * 1000`), preventing unsubmitted counterparty-signed orders or small-nonce orders from acting as perpetual free options (#1421).
46
+ - Absent by default (`2592000` seconds = 30 days built-in protocol fallback); operators can tune `transaction.exchangeV2.defaultTtlSeconds` (`1..315360000`). Explicit `itx.expiredAt` always takes precedence when provided.
package/esm/default.mjs CHANGED
@@ -26,18 +26,19 @@ const defaultConfig = {
26
26
  "fg:t:claim_stake": 664,
27
27
  "fg:t:slash_stake": 4096,
28
28
  "fg:t:return_stake": 4096,
29
- "fg:t:create_rollup": 1691,
29
+ "fg:t:create_rollup": 8192,
30
30
  "fg:t:update_rollup": 1691,
31
31
  "fg:t:pause_rollup": 1691,
32
32
  "fg:t:resume_rollup": 1691,
33
33
  "fg:t:close_rollup": 1691,
34
- "fg:t:join_rollup": 1691,
35
- "fg:t:leave_rollup": 1691,
34
+ "fg:t:join_rollup": 4096,
35
+ "fg:t:leave_rollup": 4096,
36
36
  "fg:t:migrate_rollup": 1691,
37
37
  "fg:t:create_rollup_block": 32768,
38
38
  "fg:t:claim_block_reward": 1691,
39
39
  "fg:t:mint_token": 4096,
40
40
  "fg:t:burn_token": 4096,
41
+ "fg:t:release_bridge_token": 8192,
41
42
  "fg:t:create_token_factory": Math.floor(20480),
42
43
  "fg:t:update_token_factory": Math.floor(18075)
43
44
  },
package/esm/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { ChainMode, IAccountConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl } from "./types.mjs";
1
+ import { ChainMode, IAccountConfig, IBridgeSwitchConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl } from "./types.mjs";
2
2
  import { defaultGasSecurityKnobs } from "./default.mjs";
3
3
 
4
4
  //#region src/index.d.ts
@@ -6,4 +6,4 @@ declare const validate: (config: Partial<IChainConfig>) => IChainConfig;
6
6
  declare const create: (props: IChainConfigInput) => IChainConfig;
7
7
  declare const genTokenItx: (config: IChainConfig) => ITokenItx;
8
8
  //#endregion
9
- export { ChainMode, IAccountConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl, create, defaultGasSecurityKnobs, genTokenItx, validate };
9
+ export { ChainMode, IAccountConfig, IBridgeSwitchConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl, create, defaultGasSecurityKnobs, genTokenItx, validate };
package/esm/schema.d.mts CHANGED
@@ -53,6 +53,15 @@ declare const configSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
53
53
  readonly fishermanAddress: v.OptionalSchema<any, undefined>;
54
54
  readonly exemptActors: v.OptionalSchema<v.ArraySchema<any, undefined>, undefined>;
55
55
  }, undefined>, undefined>;
56
+ readonly bridge: v.OptionalSchema<v.ObjectSchema<{
57
+ readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
58
+ }, undefined>, undefined>;
59
+ readonly rollupV1: v.OptionalSchema<v.ObjectSchema<{
60
+ readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
61
+ }, undefined>, undefined>;
62
+ readonly exchangeV2: v.OptionalSchema<v.ObjectSchema<{
63
+ readonly defaultTtlSeconds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 315360000, undefined>]>, undefined>;
64
+ }, undefined>, undefined>;
56
65
  readonly txStake: v.OptionalSchema<v.ObjectSchema<{
57
66
  readonly createToken: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
58
67
  readonly createCreditToken: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
package/esm/schema.mjs CHANGED
@@ -95,6 +95,9 @@ const configSchema = v.pipe(v.object({
95
95
  fishermanAddress: v.optional(vDID({ prefix: true })),
96
96
  exemptActors: v.optional(v.array(vDID({ prefix: true })))
97
97
  })),
98
+ bridge: v.optional(v.object({ enabled: v.optional(v.boolean(), false) })),
99
+ rollupV1: v.optional(v.object({ enabled: v.optional(v.boolean(), true) })),
100
+ exchangeV2: v.optional(v.object({ defaultTtlSeconds: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(31536e4))) })),
98
101
  txStake: v.optional(v.object({
99
102
  createToken: v.pipe(v.number(), v.integer(), v.minValue(1)),
100
103
  createCreditToken: v.pipe(v.number(), v.integer(), v.minValue(0)),
package/esm/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { ChainMode, IAccountConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl } from "@ocap/types";
2
- export { type ChainMode, type IAccountConfig, type IChainConfig, type IChainConfigInput, type IDefaultConfig, type ITokenConfig, type ITokenItx, type ITransactionConfig, type ITxGasConfig, type ITxSecurityConfig, type ITxStakeConfig, type IVaultsConfig, type TDelegateConfig, type TForeignToken, type TxTypeMap, type TxTypeUrl };
1
+ import { ChainMode, IAccountConfig, IBridgeSwitchConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl } from "@ocap/types";
2
+ export { type ChainMode, type IAccountConfig, type IBridgeSwitchConfig, type IChainConfig, type IChainConfigInput, type IDefaultConfig, type ITokenConfig, type ITokenItx, type ITransactionConfig, type ITxGasConfig, type ITxSecurityConfig, type ITxStakeConfig, type IVaultsConfig, type TDelegateConfig, type TForeignToken, type TxTypeMap, type TxTypeUrl };
package/lib/default.cjs CHANGED
@@ -28,18 +28,19 @@ const defaultConfig = {
28
28
  "fg:t:claim_stake": 664,
29
29
  "fg:t:slash_stake": 4096,
30
30
  "fg:t:return_stake": 4096,
31
- "fg:t:create_rollup": 1691,
31
+ "fg:t:create_rollup": 8192,
32
32
  "fg:t:update_rollup": 1691,
33
33
  "fg:t:pause_rollup": 1691,
34
34
  "fg:t:resume_rollup": 1691,
35
35
  "fg:t:close_rollup": 1691,
36
- "fg:t:join_rollup": 1691,
37
- "fg:t:leave_rollup": 1691,
36
+ "fg:t:join_rollup": 4096,
37
+ "fg:t:leave_rollup": 4096,
38
38
  "fg:t:migrate_rollup": 1691,
39
39
  "fg:t:create_rollup_block": 32768,
40
40
  "fg:t:claim_block_reward": 1691,
41
41
  "fg:t:mint_token": 4096,
42
42
  "fg:t:burn_token": 4096,
43
+ "fg:t:release_bridge_token": 8192,
43
44
  "fg:t:create_token_factory": Math.floor(20480),
44
45
  "fg:t:update_token_factory": Math.floor(18075)
45
46
  },
package/lib/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { ChainMode, IAccountConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl } from "./types.cjs";
1
+ import { ChainMode, IAccountConfig, IBridgeSwitchConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl } from "./types.cjs";
2
2
  import { defaultGasSecurityKnobs } from "./default.cjs";
3
3
 
4
4
  //#region src/index.d.ts
@@ -6,4 +6,4 @@ declare const validate: (config: Partial<IChainConfig>) => IChainConfig;
6
6
  declare const create: (props: IChainConfigInput) => IChainConfig;
7
7
  declare const genTokenItx: (config: IChainConfig) => ITokenItx;
8
8
  //#endregion
9
- export { ChainMode, IAccountConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl, create, defaultGasSecurityKnobs, genTokenItx, validate };
9
+ export { ChainMode, IAccountConfig, IBridgeSwitchConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl, create, defaultGasSecurityKnobs, genTokenItx, validate };
package/lib/schema.cjs CHANGED
@@ -97,6 +97,9 @@ const configSchema = _arcblock_validator.v.pipe(_arcblock_validator.v.object({
97
97
  fishermanAddress: _arcblock_validator.v.optional((0, _arcblock_validator.vDID)({ prefix: true })),
98
98
  exemptActors: _arcblock_validator.v.optional(_arcblock_validator.v.array((0, _arcblock_validator.vDID)({ prefix: true })))
99
99
  })),
100
+ bridge: _arcblock_validator.v.optional(_arcblock_validator.v.object({ enabled: _arcblock_validator.v.optional(_arcblock_validator.v.boolean(), false) })),
101
+ rollupV1: _arcblock_validator.v.optional(_arcblock_validator.v.object({ enabled: _arcblock_validator.v.optional(_arcblock_validator.v.boolean(), true) })),
102
+ exchangeV2: _arcblock_validator.v.optional(_arcblock_validator.v.object({ defaultTtlSeconds: _arcblock_validator.v.optional(_arcblock_validator.v.pipe(_arcblock_validator.v.number(), _arcblock_validator.v.integer(), _arcblock_validator.v.minValue(1), _arcblock_validator.v.maxValue(31536e4))) })),
100
103
  txStake: _arcblock_validator.v.optional(_arcblock_validator.v.object({
101
104
  createToken: _arcblock_validator.v.pipe(_arcblock_validator.v.number(), _arcblock_validator.v.integer(), _arcblock_validator.v.minValue(1)),
102
105
  createCreditToken: _arcblock_validator.v.pipe(_arcblock_validator.v.number(), _arcblock_validator.v.integer(), _arcblock_validator.v.minValue(0)),
package/lib/schema.d.cts CHANGED
@@ -53,6 +53,15 @@ declare const configSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
53
53
  readonly fishermanAddress: v.OptionalSchema<any, undefined>;
54
54
  readonly exemptActors: v.OptionalSchema<v.ArraySchema<any, undefined>, undefined>;
55
55
  }, undefined>, undefined>;
56
+ readonly bridge: v.OptionalSchema<v.ObjectSchema<{
57
+ readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
58
+ }, undefined>, undefined>;
59
+ readonly rollupV1: v.OptionalSchema<v.ObjectSchema<{
60
+ readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
61
+ }, undefined>, undefined>;
62
+ readonly exchangeV2: v.OptionalSchema<v.ObjectSchema<{
63
+ readonly defaultTtlSeconds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 315360000, undefined>]>, undefined>;
64
+ }, undefined>, undefined>;
56
65
  readonly txStake: v.OptionalSchema<v.ObjectSchema<{
57
66
  readonly createToken: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
58
67
  readonly createCreditToken: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
package/lib/types.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { ChainMode, IAccountConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl } from "@ocap/types";
2
- export { type ChainMode, type IAccountConfig, type IChainConfig, type IChainConfigInput, type IDefaultConfig, type ITokenConfig, type ITokenItx, type ITransactionConfig, type ITxGasConfig, type ITxSecurityConfig, type ITxStakeConfig, type IVaultsConfig, type TDelegateConfig, type TForeignToken, type TxTypeMap, type TxTypeUrl };
1
+ import { ChainMode, IAccountConfig, IBridgeSwitchConfig, IChainConfig, IChainConfigInput, IDefaultConfig, ITokenConfig, ITokenItx, ITransactionConfig, ITxGasConfig, ITxSecurityConfig, ITxStakeConfig, IVaultsConfig, TDelegateConfig, TForeignToken, TxTypeMap, TxTypeUrl } from "@ocap/types";
2
+ export { type ChainMode, type IAccountConfig, type IBridgeSwitchConfig, type IChainConfig, type IChainConfigInput, type IDefaultConfig, type ITokenConfig, type ITokenItx, type ITransactionConfig, type ITxGasConfig, type ITxSecurityConfig, type ITxStakeConfig, type IVaultsConfig, type TDelegateConfig, type TForeignToken, type TxTypeMap, type TxTypeUrl };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.31.1",
6
+ "version": "1.31.2",
7
7
  "description": "OCAP config parsing/validation and default",
8
8
  "type": "module",
9
9
  "main": "./lib/index.cjs",
@@ -47,11 +47,12 @@
47
47
  "license": "MIT",
48
48
  "devDependencies": {},
49
49
  "dependencies": {
50
- "@arcblock/did": "1.31.1",
51
- "@arcblock/did-util": "1.31.1",
52
- "@arcblock/validator": "1.31.1",
53
- "@ocap/types": "1.31.1",
54
- "@ocap/util": "1.31.1",
50
+ "@arcblock/did": "1.31.2",
51
+ "@arcblock/did-util": "1.31.2",
52
+ "@arcblock/validator": "1.31.2",
53
+ "@noble/hashes": "2.2.0",
54
+ "@ocap/types": "1.31.2",
55
+ "@ocap/util": "1.31.2",
55
56
  "lodash": "^4.17.23"
56
57
  }
57
58
  }