@xyo-network/chain-orchestration 1.20.1 → 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 +13 -13
- 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/dist/node/index.mjs
CHANGED
|
@@ -21,6 +21,9 @@ var ValidatorActor = class extends ActorV3 {
|
|
|
21
21
|
_lastValidatedBlock;
|
|
22
22
|
_lastValidatedBlockHash;
|
|
23
23
|
_mempoolViewer;
|
|
24
|
+
get allowedProducers() {
|
|
25
|
+
return this.params.config.allowedProducers ?? [];
|
|
26
|
+
}
|
|
24
27
|
get blockViewer() {
|
|
25
28
|
return this._blockViewer;
|
|
26
29
|
}
|
|
@@ -38,27 +41,22 @@ var ValidatorActor = class extends ActorV3 {
|
|
|
38
41
|
}
|
|
39
42
|
async startHandler() {
|
|
40
43
|
await super.startHandler();
|
|
41
|
-
this.registerTimer(
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
await
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
finalizationRunner: this.finalizationRunner
|
|
52
|
-
});
|
|
53
|
-
}, {
|
|
54
|
-
...this.context,
|
|
55
|
-
timeBudgetLimit: 1500
|
|
44
|
+
this.registerTimer("ValidatorActor", async () => {
|
|
45
|
+
await this.spanAsync("processPendingBlocks", async () => {
|
|
46
|
+
console.log("ValidatorActor: Processing pending blocks...");
|
|
47
|
+
await processPendingBlocks({
|
|
48
|
+
context: this.context,
|
|
49
|
+
logger: this.logger,
|
|
50
|
+
mempoolViewer: this.mempoolViewer,
|
|
51
|
+
blockViewer: this.blockViewer,
|
|
52
|
+
finalizationRunner: this.finalizationRunner,
|
|
53
|
+
allowedProducers: this.allowedProducers
|
|
56
54
|
});
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
);
|
|
55
|
+
}, {
|
|
56
|
+
...this.context,
|
|
57
|
+
timeBudgetLimit: 1500
|
|
58
|
+
});
|
|
59
|
+
}, 2e3, 500);
|
|
62
60
|
}
|
|
63
61
|
};
|
|
64
62
|
ValidatorActor = _ts_decorate([
|
|
@@ -333,6 +331,23 @@ var isRewardRedemptionConfigContext = zodIsFactory5(RewardRedemptionConfigContex
|
|
|
333
331
|
var asRewardRedemptionConfigContext = zodAsFactory5(RewardRedemptionConfigContext, "asRewardRedemptionConfigContext");
|
|
334
332
|
var toRewardRedemptionConfigContext = zodToFactory5(RewardRedemptionConfigContext, "toRewardRedemptionConfigContext");
|
|
335
333
|
|
|
334
|
+
// src/shared/config/actors/Validator.ts
|
|
335
|
+
import { AddressZod as AddressZod3, zodAsFactory as zodAsFactory6, zodIsFactory as zodIsFactory6, zodToFactory as zodToFactory6 } from "@xylabs/sdk-js";
|
|
336
|
+
import { BaseConfigContextZod as BaseConfigContextZod6, HostActorConfigZod as HostActorConfigZod5 } from "@xyo-network/xl1-sdk";
|
|
337
|
+
import { z as z5 } from "zod";
|
|
338
|
+
var ValidatorConfigZod = HostActorConfigZod5.extend({
|
|
339
|
+
allowedProducers: z5.array(AddressZod3).optional()
|
|
340
|
+
});
|
|
341
|
+
var isValidatorConfig = zodIsFactory6(ValidatorConfigZod);
|
|
342
|
+
var asValidatorConfig = zodAsFactory6(ValidatorConfigZod, "asValidatorConfig");
|
|
343
|
+
var toValidatorConfig = zodToFactory6(ValidatorConfigZod, "toValidatorConfig");
|
|
344
|
+
var ValidatorConfigContext = BaseConfigContextZod6.extend({
|
|
345
|
+
config: ValidatorConfigZod
|
|
346
|
+
});
|
|
347
|
+
var isValidatorConfigContext = zodIsFactory6(ValidatorConfigContext);
|
|
348
|
+
var asValidatorConfigContext = zodAsFactory6(ValidatorConfigContext, "asValidatorConfigContext");
|
|
349
|
+
var toValidatorConfigContext = zodToFactory6(ValidatorConfigContext, "toValidatorConfigContext");
|
|
350
|
+
|
|
336
351
|
// src/shared/config/locators/commonLocatorFromConfig.ts
|
|
337
352
|
import { validateHydratedBlock, validateHydratedBlockState } from "@xyo-network/chain-validation";
|
|
338
353
|
import { ProviderFactoryLocator, SimpleBlockRewardViewer, SimpleBlockValidationViewer, SimpleNetworkStakeViewer, SimpleStepRewardsByPositionViewer, SimpleStepRewardsByStakerViewer, SimpleStepRewardsByStepViewer, SimpleStepRewardsTotalViewer, SimpleStepRewardsViewer, SimpleStepViewer, SimpleTimeSyncViewer, SimpleTransactionViewer, SimpleWindowedBlockViewer } from "@xyo-network/xl1-sdk";
|
|
@@ -1699,13 +1714,14 @@ import { ConfigZod } from "@xyo-network/xl1-sdk";
|
|
|
1699
1714
|
import { cosmiconfig } from "cosmiconfig";
|
|
1700
1715
|
var configName = "xyo";
|
|
1701
1716
|
var configSection = "xl1";
|
|
1702
|
-
async function tryParseConfig(
|
|
1717
|
+
async function tryParseConfig(options) {
|
|
1718
|
+
const { configPath, searchPlaces } = options ?? {};
|
|
1703
1719
|
const explorer = cosmiconfig(configName, {
|
|
1704
1720
|
cache: true,
|
|
1705
1721
|
// loaders: { '.ts': TypeScriptLoader() },
|
|
1706
1722
|
searchPlaces
|
|
1707
1723
|
});
|
|
1708
|
-
const result = (await explorer.search())?.config;
|
|
1724
|
+
const result = configPath ? (await explorer.load(configPath))?.config : (await explorer.search())?.config;
|
|
1709
1725
|
if (isDefined10(result) && !isNull(result)) {
|
|
1710
1726
|
const section = result[configSection];
|
|
1711
1727
|
if (isDefined10(section) && typeof section === "object") {
|
|
@@ -1794,6 +1810,8 @@ export {
|
|
|
1794
1810
|
RewardRedemptionConfigZod,
|
|
1795
1811
|
ServiceLifetime,
|
|
1796
1812
|
ValidatorActor,
|
|
1813
|
+
ValidatorConfigContext,
|
|
1814
|
+
ValidatorConfigZod,
|
|
1797
1815
|
asApiConfig,
|
|
1798
1816
|
asApiConfigContext,
|
|
1799
1817
|
asBridgeConfig,
|
|
@@ -1804,6 +1822,8 @@ export {
|
|
|
1804
1822
|
asProducerConfigContext,
|
|
1805
1823
|
asRewardRedemptionConfig,
|
|
1806
1824
|
asRewardRedemptionConfigContext,
|
|
1825
|
+
asValidatorConfig,
|
|
1826
|
+
asValidatorConfigContext,
|
|
1807
1827
|
basicRemoteRunnerLocator,
|
|
1808
1828
|
basicRemoteViewerLocator,
|
|
1809
1829
|
buildTelemetryConfig,
|
|
@@ -1848,6 +1868,8 @@ export {
|
|
|
1848
1868
|
isProducerConfigContext,
|
|
1849
1869
|
isRewardRedemptionConfig,
|
|
1850
1870
|
isRewardRedemptionConfigContext,
|
|
1871
|
+
isValidatorConfig,
|
|
1872
|
+
isValidatorConfigContext,
|
|
1851
1873
|
loadNode,
|
|
1852
1874
|
localLocatorFromConfig,
|
|
1853
1875
|
locatorsFromConfig,
|
|
@@ -1865,6 +1887,8 @@ export {
|
|
|
1865
1887
|
toProducerConfigContext,
|
|
1866
1888
|
toRewardRedemptionConfig,
|
|
1867
1889
|
toRewardRedemptionConfigContext,
|
|
1890
|
+
toValidatorConfig,
|
|
1891
|
+
toValidatorConfigContext,
|
|
1868
1892
|
tryParseConfig
|
|
1869
1893
|
};
|
|
1870
1894
|
//# sourceMappingURL=index.mjs.map
|