@xyo-network/chain-orchestration 1.20.2 → 1.20.3
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/dist/browser/index.mjs +44 -21
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/node/config/tryParseConfig.d.ts +7 -1
- package/dist/browser/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/browser/shared/actor/ValidatorActor.d.ts +8 -2
- package/dist/browser/shared/actor/ValidatorActor.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Validator.d.ts +1004 -0
- package/dist/browser/shared/config/actors/Validator.d.ts.map +1 -0
- package/dist/browser/shared/config/actors/index.d.ts +1 -0
- package/dist/browser/shared/config/actors/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +44 -21
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/node/config/tryParseConfig.d.ts +7 -1
- package/dist/neutral/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/neutral/shared/actor/ValidatorActor.d.ts +8 -2
- package/dist/neutral/shared/actor/ValidatorActor.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Validator.d.ts +1004 -0
- package/dist/neutral/shared/config/actors/Validator.d.ts.map +1 -0
- package/dist/neutral/shared/config/actors/index.d.ts +1 -0
- package/dist/neutral/shared/config/actors/index.d.ts.map +1 -1
- package/dist/node/index.mjs +46 -22
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node/config/tryParseConfig.d.ts +7 -1
- package/dist/node/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/node/shared/actor/ValidatorActor.d.ts +8 -2
- package/dist/node/shared/actor/ValidatorActor.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Validator.d.ts +1004 -0
- package/dist/node/shared/config/actors/Validator.d.ts.map +1 -0
- package/dist/node/shared/config/actors/index.d.ts +1 -0
- package/dist/node/shared/config/actors/index.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/node/config/tryParseConfig.ts +8 -2
- package/src/shared/actor/ValidatorActor.ts +9 -3
- package/src/shared/config/actors/Validator.ts +22 -0
- package/src/shared/config/actors/index.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Validator.d.ts","sourceRoot":"","sources":["../../../../../src/shared/config/actors/Validator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAkF,CAAA;AAEjH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEhE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmC,CAAA;AACjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwD,CAAA;AACtF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwD,CAAA;AAEtF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA8D,CAAA;AAEjG,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAuC,CAAA;AAC5E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmE,CAAA;AACxG,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/config/actors/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/config/actors/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/chain-orchestration",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.3",
|
|
4
4
|
"description": "XYO Layer One SDK Orchestration",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"@xyo-network/archivist-view": "~5.3.15",
|
|
53
53
|
"@xyo-network/bios": "~7.2.1",
|
|
54
54
|
"@xyo-network/bridge-model": "~5.3.15",
|
|
55
|
-
"@xyo-network/chain-ethereum": "~1.20.
|
|
56
|
-
"@xyo-network/chain-protocol": "~1.20.
|
|
57
|
-
"@xyo-network/chain-sdk": "~1.20.
|
|
58
|
-
"@xyo-network/chain-services": "~1.20.
|
|
59
|
-
"@xyo-network/chain-telemetry": "~1.20.
|
|
60
|
-
"@xyo-network/chain-utils": "~1.20.
|
|
61
|
-
"@xyo-network/chain-validation": "~1.20.
|
|
55
|
+
"@xyo-network/chain-ethereum": "~1.20.3",
|
|
56
|
+
"@xyo-network/chain-protocol": "~1.20.3",
|
|
57
|
+
"@xyo-network/chain-sdk": "~1.20.3",
|
|
58
|
+
"@xyo-network/chain-services": "~1.20.3",
|
|
59
|
+
"@xyo-network/chain-telemetry": "~1.20.3",
|
|
60
|
+
"@xyo-network/chain-utils": "~1.20.3",
|
|
61
|
+
"@xyo-network/chain-validation": "~1.20.3",
|
|
62
62
|
"@xyo-network/module-abstract": "~5.3.15",
|
|
63
63
|
"@xyo-network/sdk-js": "~5.3.15",
|
|
64
64
|
"@xyo-network/sentinel-memory": "~5.3.15",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"@types/node": "~25.3.5",
|
|
70
70
|
"@xylabs/mongo": "~5.0.80",
|
|
71
71
|
"@xylabs/sdk-js": "~5.0.80",
|
|
72
|
-
"@xylabs/ts-scripts-yarn3": "~7.4.
|
|
73
|
-
"@xylabs/tsconfig": "~7.4.
|
|
72
|
+
"@xylabs/ts-scripts-yarn3": "~7.4.10",
|
|
73
|
+
"@xylabs/tsconfig": "~7.4.10",
|
|
74
74
|
"@xylabs/zod": "~5.0.80",
|
|
75
75
|
"@xyo-network/account-model": "~5.3.15",
|
|
76
76
|
"@xyo-network/bios-model": "~7.2.1",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@xyo-network/sdk-js": "~5.3.15",
|
|
79
79
|
"@xyo-network/storage-model": "~7.2.1",
|
|
80
80
|
"@xyo-network/wallet-model": "~5.3.15",
|
|
81
|
-
"@xyo-network/xl1-sdk": "~1.25.
|
|
81
|
+
"@xyo-network/xl1-sdk": "~1.25.20",
|
|
82
82
|
"axios": "^1.13.6",
|
|
83
83
|
"cosmiconfig": "^9.0.1",
|
|
84
84
|
"eslint": "^9.39.4",
|
|
@@ -14,9 +14,13 @@ const configSection = 'xl1' // Default section in the config file
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Attempts to parse the configuration from a file using cosmiconfig.
|
|
17
|
+
* @param options - Optional config loading options.
|
|
18
|
+
* @param options.configPath - Explicit path to a config file to load instead of searching.
|
|
19
|
+
* @param options.searchPlaces - Custom search places for cosmiconfig.
|
|
17
20
|
* @returns The parsed configuration object if found and valid, otherwise undefined.
|
|
18
21
|
*/
|
|
19
|
-
export async function tryParseConfig(searchPlaces?: string[]) {
|
|
22
|
+
export async function tryParseConfig(options?: { configPath?: string; searchPlaces?: string[] }) {
|
|
23
|
+
const { configPath, searchPlaces } = options ?? {}
|
|
20
24
|
const explorer = cosmiconfig(
|
|
21
25
|
configName,
|
|
22
26
|
{
|
|
@@ -25,7 +29,9 @@ export async function tryParseConfig(searchPlaces?: string[]) {
|
|
|
25
29
|
searchPlaces,
|
|
26
30
|
},
|
|
27
31
|
)
|
|
28
|
-
const result =
|
|
32
|
+
const result = configPath
|
|
33
|
+
? (await explorer.load(configPath))?.config
|
|
34
|
+
: (await explorer.search())?.config
|
|
29
35
|
if (isDefined(result) && !isNull(result)) {
|
|
30
36
|
const section = result[configSection]
|
|
31
37
|
if (isDefined(section) && typeof section === 'object') {
|
|
@@ -2,7 +2,6 @@ import type { Hash } from '@xylabs/sdk-js'
|
|
|
2
2
|
import { creatable } from '@xylabs/sdk-js'
|
|
3
3
|
import { processPendingBlocks } from '@xyo-network/chain-sdk'
|
|
4
4
|
import type {
|
|
5
|
-
ActorConfig,
|
|
6
5
|
ActorParamsV3, BlockBoundWitness, BlockViewer,
|
|
7
6
|
FinalizationRunner,
|
|
8
7
|
MempoolViewer,
|
|
@@ -12,9 +11,11 @@ import {
|
|
|
12
11
|
MempoolViewerMoniker,
|
|
13
12
|
} from '@xyo-network/xl1-sdk'
|
|
14
13
|
|
|
14
|
+
import { ValidatorConfig } from '../config/index.ts'
|
|
15
|
+
|
|
15
16
|
export type ValidatorActorParams = ActorParamsV3<
|
|
16
17
|
{
|
|
17
|
-
config:
|
|
18
|
+
config: ValidatorConfig
|
|
18
19
|
}>
|
|
19
20
|
|
|
20
21
|
@creatable()
|
|
@@ -25,6 +26,10 @@ export class ValidatorActor extends ActorV3<ValidatorActorParams> {
|
|
|
25
26
|
protected _lastValidatedBlockHash: Hash | undefined
|
|
26
27
|
protected _mempoolViewer!: MempoolViewer
|
|
27
28
|
|
|
29
|
+
protected get allowedProducers() {
|
|
30
|
+
return this.params.config.allowedProducers ?? []
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
protected get blockViewer() {
|
|
29
34
|
return this._blockViewer
|
|
30
35
|
}
|
|
@@ -55,8 +60,9 @@ export class ValidatorActor extends ActorV3<ValidatorActorParams> {
|
|
|
55
60
|
mempoolViewer: this.mempoolViewer,
|
|
56
61
|
blockViewer: this.blockViewer,
|
|
57
62
|
finalizationRunner: this.finalizationRunner,
|
|
63
|
+
allowedProducers: this.allowedProducers,
|
|
58
64
|
})
|
|
59
65
|
}, { ...this.context, timeBudgetLimit: 1500 })
|
|
60
|
-
}, 2000,
|
|
66
|
+
}, 2000, 500)
|
|
61
67
|
}
|
|
62
68
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AddressZod,
|
|
3
|
+
zodAsFactory, zodIsFactory, zodToFactory,
|
|
4
|
+
} from '@xylabs/sdk-js'
|
|
5
|
+
import { BaseConfigContextZod, HostActorConfigZod } from '@xyo-network/xl1-sdk'
|
|
6
|
+
import { z } from 'zod'
|
|
7
|
+
|
|
8
|
+
export const ValidatorConfigZod = HostActorConfigZod.extend({ allowedProducers: z.array(AddressZod).optional() })
|
|
9
|
+
|
|
10
|
+
export type ValidatorConfig = z.infer<typeof ValidatorConfigZod>
|
|
11
|
+
|
|
12
|
+
export const isValidatorConfig = zodIsFactory(ValidatorConfigZod)
|
|
13
|
+
export const asValidatorConfig = zodAsFactory(ValidatorConfigZod, 'asValidatorConfig')
|
|
14
|
+
export const toValidatorConfig = zodToFactory(ValidatorConfigZod, 'toValidatorConfig')
|
|
15
|
+
|
|
16
|
+
export const ValidatorConfigContext = BaseConfigContextZod.extend({ config: ValidatorConfigZod })
|
|
17
|
+
|
|
18
|
+
export type ValidatorConfigContext = z.infer<typeof ValidatorConfigContext>
|
|
19
|
+
|
|
20
|
+
export const isValidatorConfigContext = zodIsFactory(ValidatorConfigContext)
|
|
21
|
+
export const asValidatorConfigContext = zodAsFactory(ValidatorConfigContext, 'asValidatorConfigContext')
|
|
22
|
+
export const toValidatorConfigContext = zodToFactory(ValidatorConfigContext, 'toValidatorConfigContext')
|