@xyo-network/chain-producer 1.23.2 → 2.0.1

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.
@@ -10,10 +10,20 @@ export declare class ProducerActor extends ActorV3<ProducerActorParams> {
10
10
  */
11
11
  static readonly DefaultBlockProductionCheckInterval = 10000;
12
12
  /**
13
- * The multiplier applied to the block production check interval to determine
14
- * the threshold for resubmitting the same block number if the head has not changed.
13
+ * Time in milliseconds the producer will wait before re-attempting block
14
+ * production for the same head when its last produced block has not been
15
+ * adopted (head hasn't advanced). 30 s is short enough to recover quickly
16
+ * from a transient submit-side failure (e.g. the validator rejected the
17
+ * block and the producer's `_lastProducedBlock` cache would otherwise mute
18
+ * retries) while still long enough to avoid hammering the mempool with
19
+ * duplicate submissions under normal latency.
20
+ *
21
+ * Previously this was `blockProductionCheckInterval × 30` which scaled with
22
+ * the check interval — 5 min in production, 2.5 min in our tightened test
23
+ * config — both far too long for a failure that needed re-action within a
24
+ * single block time. Made absolute to decouple from the check interval.
15
25
  */
16
- static readonly HeadResubmissionMultiplier = 30;
26
+ static readonly HeadResubmissionThresholdMs = 30000;
17
27
  /**
18
28
  * The window (in blocks) before expiration to attempt redeclaration of producer intent.
19
29
  */
@@ -123,7 +133,6 @@ export declare class ProducerActor extends ActorV3<ProducerActorParams> {
123
133
  minStake: number;
124
134
  dataLake?: import("@xyo-network/xl1-sdk").DataLakeConfig | undefined;
125
135
  accountPath?: string | undefined;
126
- healthCheckPort?: number | undefined;
127
136
  allowlist?: (Lowercase<string> & {
128
137
  readonly __hex: true;
129
138
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"ProducerActor.d.ts","sourceRoot":"","sources":["../../src/ProducerActor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAK7D,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,OAAO,EAEP,KAAK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.config;
97
97
  }
98
98
  get headResubmissionThreshold() {
99
- return this.blockProductionCheckInterval * ProducerActor.HeadResubmissionMultiplier;
99
+ return ProducerActor.HeadResubmissionThresholdMs;
100
100
  }
101
101
  get mempoolRunner() {
102
102
  return this._mempoolRunner;
@@ -229,8 +229,12 @@ var ProducerActor = class extends ActorV3 {
229
229
  const displayBlockNumber = toFormattedBlockReference(nextBlock[0]);
230
230
  this.logger?.log("Produced block:", displayBlockNumber);
231
231
  this._producerActorBlocksProduced.add(1, this._metricAttributes);
232
- await this.mempoolRunner.submitBlocks([nextBlock]);
233
- this.logger?.log("Published block:", displayBlockNumber);
232
+ const submittedHashes = await this.mempoolRunner.submitBlocks([nextBlock]);
233
+ if (submittedHashes.length === 0) {
234
+ this.logger?.error(`Submit dropped block ${displayBlockNumber} silently \u2014 archivist accepted 0 of 1 (hash ${nextBlock[0]._hash})`);
235
+ } else {
236
+ this.logger?.log("Published block:", displayBlockNumber);
237
+ }
234
238
  this._producerActorBlocksPublished.add(1, this._metricAttributes);
235
239
  this._lastProducedBlock = nextBlock;
236
240
  } else {
@@ -321,10 +325,20 @@ var ProducerActor = class extends ActorV3 {
321
325
  */
322
326
  __publicField(ProducerActor, "DefaultBlockProductionCheckInterval", DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL);
323
327
  /**
324
- * The multiplier applied to the block production check interval to determine
325
- * the threshold for resubmitting the same block number if the head has not changed.
328
+ * Time in milliseconds the producer will wait before re-attempting block
329
+ * production for the same head when its last produced block has not been
330
+ * adopted (head hasn't advanced). 30 s is short enough to recover quickly
331
+ * from a transient submit-side failure (e.g. the validator rejected the
332
+ * block and the producer's `_lastProducedBlock` cache would otherwise mute
333
+ * retries) while still long enough to avoid hammering the mempool with
334
+ * duplicate submissions under normal latency.
335
+ *
336
+ * Previously this was `blockProductionCheckInterval × 30` which scaled with
337
+ * the check interval — 5 min in production, 2.5 min in our tightened test
338
+ * config — both far too long for a failure that needed re-action within a
339
+ * single block time. Made absolute to decouple from the check interval.
326
340
  */
327
- __publicField(ProducerActor, "HeadResubmissionMultiplier", 30);
341
+ __publicField(ProducerActor, "HeadResubmissionThresholdMs", 3e4);
328
342
  /**
329
343
  * The window (in blocks) before expiration to attempt redeclaration of producer intent.
330
344
  */
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/command.ts", "../../src/run.ts", "../../src/ProducerActor.ts"],
4
- "sourcesContent": ["import type { GetLocatorsFromConfig } from '@xyo-network/chain-orchestration'\nimport { ProducerConfigZod } from '@xyo-network/chain-orchestration'\nimport type { Config } from '@xyo-network/xl1-sdk'\nimport type { CommandModule } from 'yargs'\n\nimport { runProducer } from './run.ts'\n\nexport function producerCommand(getConfiguration: () => Config, getLocatorsFromConfig: GetLocatorsFromConfig): CommandModule {\n return {\n command: 'producer',\n deprecated: 'Use \"start producer\" instead',\n describe: 'Run a XL1 Producer Node',\n handler: async () => {\n const configuration = getConfiguration()\n const { locators, orchestrator } = await getLocatorsFromConfig(['producer'], configuration)\n await runProducer(ProducerConfigZod.parse(locators['producer'].context.config), orchestrator, locators['producer'])\n },\n }\n}\n", "import type { CreatableName } from '@xylabs/sdk-js'\nimport { exists } from '@xylabs/sdk-js'\nimport {\n initActorWallet,\n type OrchestratorInstance,\n type ProducerConfig,\n} from '@xyo-network/chain-orchestration'\nimport type { ProviderFactoryLocatorInstance } from '@xyo-network/xl1-sdk'\n\nimport type { ProducerActorParams } from './ProducerActor.ts'\nimport { ProducerActor } from './ProducerActor.ts'\n\nexport const getProducerActor = async (\n config: ProducerConfig,\n locator: ProviderFactoryLocatorInstance,\n): Promise<ProducerActor> => {\n const account = await initActorWallet({ ...locator.context, config })\n return await ProducerActor.create({\n config, locator, name: 'xl1-producer' as CreatableName, account,\n } satisfies ProducerActorParams)\n}\n\nexport const runProducer = async (\n config: ProducerConfig,\n orchestrator: OrchestratorInstance,\n locator: ProviderFactoryLocatorInstance,\n) => {\n const producer = await getProducerActor(config, locator)\n const actors = [producer].filter(exists)\n\n for (const actor of actors) {\n await orchestrator.registerActor(actor)\n }\n await orchestrator.start()\n}\n", "import type { Attributes, Counter } from '@opentelemetry/api'\nimport {\n assertEx, creatable, isDefined, isUndefined,\n toHex,\n} from '@xylabs/sdk-js'\nimport {\n type ActorCapabilityNeeds,\n type ActorParamsV3,\n ActorV3,\n DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL,\n type ProducerConfig,\n} from '@xyo-network/chain-orchestration'\nimport { SimpleBlockRunner } from '@xyo-network/chain-services'\nimport type { WithHashMeta } from '@xyo-network/sdk-js'\nimport type {\n AccountBalanceViewer,\n BlockBoundWitness,\n BlockRunner, BlockViewer, ChainContractViewer, ChainId, ChainStakeIntent, FinalizationViewer, HydratedBlockWithHashMeta, MempoolRunner,\n MempoolViewer, StakeTotalsViewer, XL1BlockNumber,\n} from '@xyo-network/xl1-sdk'\nimport {\n AccountBalanceViewerMoniker, asXL1BlockNumber, BlockRunnerMoniker, BlockViewerMoniker,\n buildTransaction, ChainContractViewerMoniker, createDeclarationIntent, FinalizationViewerMoniker, MempoolRunnerMoniker, MempoolViewerMoniker, StakeTotalsViewerMoniker,\n} from '@xyo-network/xl1-sdk'\nimport { Mutex } from 'async-mutex'\n\nexport type ProducerActorParams = ActorParamsV3<{\n config: ProducerConfig\n}>\n\nconst SHOULD_REGISTER_REDECLARATION_INTENT_TIMER = true\nconst TEN_MINUTES = 10 * 60 * 1000 // 10 minutes in milliseconds\n\n/**\n * Formats a hydrated block with hash meta into a string representation of its hash and block number.\n * @param blockBoundWitness The hydrated block with hash meta to format\n * @returns The formatted block reference string\n */\nconst toFormattedBlockReference = (blockBoundWitness: WithHashMeta<BlockBoundWitness>): string => {\n return `${blockBoundWitness.block} [${toHex(blockBoundWitness._hash, { prefix: true })}]`\n}\n\n@creatable()\nexport class ProducerActor extends ActorV3<ProducerActorParams> {\n /**\n * The default interval time (in MS) between block production attempts.\n */\n static readonly DefaultBlockProductionCheckInterval = DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL\n\n /**\n * The multiplier applied to the block production check interval to determine\n * the threshold for resubmitting the same block number if the head has not changed.\n */\n static readonly HeadResubmissionMultiplier = 30\n\n /**\n * The window (in blocks) before expiration to attempt redeclaration of producer intent.\n */\n static readonly RedeclarationWindow = 1000\n\n static readonly needs: ActorCapabilityNeeds = {\n required: [\n AccountBalanceViewerMoniker,\n BlockRunnerMoniker,\n BlockViewerMoniker,\n ChainContractViewerMoniker,\n FinalizationViewerMoniker,\n MempoolRunnerMoniker,\n MempoolViewerMoniker,\n StakeTotalsViewerMoniker,\n ],\n }\n\n protected _lastProducedBlock?: HydratedBlockWithHashMeta\n protected _lastRedeclarationIntent?: ChainStakeIntent\n protected _metricAttributes?: Attributes\n protected _producerActorBlockProductionAttempts!: Counter<Attributes>\n protected _producerActorBlockProductionChecks!: Counter<Attributes>\n protected _producerActorBlocksProduced!: Counter<Attributes>\n protected _producerActorBlocksPublished!: Counter<Attributes>\n\n private _accountBalanceViewer?: AccountBalanceViewer\n private _blockRunner?: BlockRunner\n private _blockViewer?: BlockViewer\n private _chainContractViewer?: ChainContractViewer\n private _chainId?: ChainId\n private _lastHeadChangeTime?: number\n private _lastHeadHash?: string\n private _mempoolRunner?: MempoolRunner\n private _mempoolViewer?: MempoolViewer\n private _produceBlockMutex = new Mutex()\n private _stakeTotalsViewer?: StakeTotalsViewer\n\n override get logger() {\n return assertEx(super.logger, () => 'Logger is required for ProducerActor')\n }\n\n protected get accountBalanceViewer() {\n return this._accountBalanceViewer!\n }\n\n protected get blockProductionCheckInterval() {\n return this.config.blockProductionCheckInterval ?? ProducerActor.DefaultBlockProductionCheckInterval\n }\n\n protected get blockRunner() {\n return this._blockRunner!\n }\n\n protected get blockViewer() {\n return this._blockViewer!\n }\n\n protected get chainContractViewer() {\n return this._chainContractViewer!\n }\n\n protected get chainId() {\n return this._chainId!\n }\n\n protected get config() {\n return this.params.config\n }\n\n protected get headResubmissionThreshold() {\n return this.blockProductionCheckInterval * ProducerActor.HeadResubmissionMultiplier\n }\n\n protected get mempoolRunner() {\n return this._mempoolRunner!\n }\n\n protected get mempoolViewer() {\n return this._mempoolViewer!\n }\n\n protected get stakeTotalsViewer() {\n return this._stakeTotalsViewer!\n }\n\n override async createHandler() {\n await super.createHandler()\n // Create the consistent meter attributes that will\n // be included with all metrics from this actor\n this._metricAttributes = { address: this.account.address.toString() }\n // Create the metrics\n this._producerActorBlockProductionChecks = this.counter(\n 'producer_actor_block_production_checks',\n 'Number of block production checks',\n )\n this._producerActorBlockProductionAttempts = this.counter(\n 'producer_actor_block_production_attempts',\n 'Number of block production attempts',\n )\n this._producerActorBlocksProduced = this.counter(\n 'producer_actor_blocks_produced',\n 'Number of blocks produced',\n )\n this._producerActorBlocksPublished = this.counter(\n 'producer_actor_blocks_published',\n 'Number of blocks published',\n )\n const final = await this.locator?.getInstance<FinalizationViewer>(FinalizationViewerMoniker)\n await final.start()\n this._accountBalanceViewer = assertEx(\n await this.locator?.getInstance<AccountBalanceViewer>(AccountBalanceViewerMoniker),\n () => 'Unable to locate AccountBalanceViewer',\n )\n this._blockRunner = assertEx(\n await this.locator?.getInstance<BlockRunner>(BlockRunnerMoniker),\n () => 'Unable to locate BlockRunner',\n )\n this._blockViewer = assertEx(\n await this.locator?.getInstance<BlockViewer>(BlockViewerMoniker),\n () => 'Unable to locate BlockViewer',\n )\n this._chainContractViewer = assertEx(\n await this.locator?.getInstance<ChainContractViewer>(ChainContractViewerMoniker),\n () => 'Unable to locate ChainContractViewer',\n )\n this._mempoolRunner = assertEx(\n await this.locator?.getInstance<MempoolRunner>(MempoolRunnerMoniker),\n () => 'Unable to locate MempoolRunner',\n )\n this._mempoolViewer = assertEx(\n await this.locator?.getInstance<MempoolViewer>(MempoolViewerMoniker),\n () => 'Unable to locate MempoolViewer',\n )\n this._stakeTotalsViewer = assertEx(\n await this.locator?.getInstance<StakeTotalsViewer>(StakeTotalsViewerMoniker),\n () => 'Unable to locate StakeTotalsViewer',\n )\n this._chainId = await this.chainContractViewer.chainId()\n }\n\n // async initLocator() {\n // const config = this.config\n // const endpoint = assertEx(config.services.apiEndpoint, () => 'API endpoint is required in config.services.apiEndpoint')\n // const transportFactory: TransportFactory = (schemas: RpcSchemaMap) => new HttpRpcTransport(endpoint, schemas)\n // const locator = await buildJsonRpcProviderLocatorV2(config, transportFactory)\n\n // const version = '1.0.0'\n // const telemetryConfig = buildTelemetryConfig(config, this.name, version, DefaultMetricsScrapePorts.producer)\n // const { traceProvider, meterProvider } = await startupSpanAsync('initTelemetry', () => initTelemetry(telemetryConfig))\n\n // locator.context.traceProvider = traceProvider\n // locator.context.meterProvider = meterProvider\n\n // locator.register(SimpleBlockRewardViewer.factory<SimpleBlockRewardViewer>(SimpleBlockRewardViewer.dependencies, {}))\n // locator.register(SimpleBlockValidationViewer.factory<SimpleBlockValidationViewer>(\n // SimpleBlockValidationViewer.dependencies,\n // { state: validateHydratedBlockState, protocol: validateHydratedBlock },\n // ))\n // locator.register(SimpleBlockRunner.factory<SimpleBlockRunner>(\n // SimpleBlockRunner.dependencies,\n // { account: this.params.account, rewardAddress: this.params.rewardAddress },\n // ))\n // return await initEvmProvidersIfAvailable(locator)\n // }\n\n override async startHandler() {\n await super.startHandler()\n // Register a timer to check if we should produce a block\n this.registerTimer('BlockProductionTimer', async () => {\n await this.produceBlock()\n }, 2000, this.blockProductionCheckInterval)\n\n if (SHOULD_REGISTER_REDECLARATION_INTENT_TIMER) {\n // Register a timer to check if we should redeclare the producer\n this.registerTimer('ProducerRedeclarationTimer', async () => {\n await this.redeclareIntent()\n }, TEN_MINUTES, TEN_MINUTES)\n }\n }\n\n protected calculateBlocksUntilProducerDeclarationExpiration(currentBlock: number): number {\n return (this._lastRedeclarationIntent?.exp ?? currentBlock) - currentBlock\n }\n\n protected async produceBlock(): Promise<void> {\n this._producerActorBlockProductionChecks.add(1, this._metricAttributes)\n await this.spanAsync('produceBlock', async () => {\n if (this._produceBlockMutex.isLocked()) {\n this.logger?.debug('Skipping block production, previous production still in progress')\n return\n }\n\n await this._produceBlockMutex.runExclusive(async () => {\n // Get the updated head\n const head = (await this.blockViewer.currentBlock())[0]\n const headHash = head._hash\n\n // Track head changes\n const currentTime = Date.now()\n if (this._lastHeadHash !== headHash) {\n const lastHeadHashHex = isDefined(this._lastHeadHash) ? `0x${this._lastHeadHash}` : 'undefined'\n const currentHeadHashHex = `0x${headHash}`\n this.logger?.log(`Found updated head ${lastHeadHashHex} -> ${currentHeadHashHex}`)\n this._lastHeadHash = headHash\n this._lastHeadChangeTime = currentTime\n }\n\n // Check if we should resubmit due to stale head\n const timeSinceHeadChange = isDefined(this._lastHeadChangeTime) ? currentTime - this._lastHeadChangeTime : 0\n\n // If we have never produced a block or the last produced block was not built on the current head we\n // need to attempt to produce a new block\n const shouldSubmit = !this._lastProducedBlock || this._lastProducedBlock[0].previous !== headHash\n\n // If the head has not changed determine if we should resubmit again based on head staleness\n const shouldResubmit = timeSinceHeadChange > this.headResubmissionThreshold\n\n // Determine if we should submit or resubmit\n const shouldSubmitBlock = shouldSubmit || shouldResubmit\n\n if (!shouldSubmitBlock) {\n this.logger?.debug('No block submission required at this time.')\n return\n }\n\n if (shouldResubmit) {\n this.logger?.log(`Resubmitting block due to stale head. Head ${toFormattedBlockReference(head)} unchanged for ${timeSinceHeadChange}ms`)\n this._lastHeadChangeTime = currentTime\n }\n this._producerActorBlockProductionAttempts.add(1, this._metricAttributes)\n // Produce the next block (do not pass force \u2014 undefined result is valid when idle)\n const nextBlock = await this.blockRunner.produceNextBlock(head)\n if (nextBlock) {\n const displayBlockNumber = toFormattedBlockReference(nextBlock[0])\n this.logger?.log('Produced block:', displayBlockNumber)\n this._producerActorBlocksProduced.add(1, this._metricAttributes)\n await this.mempoolRunner.submitBlocks([nextBlock])\n this.logger?.log('Published block:', displayBlockNumber)\n this._producerActorBlocksPublished.add(1, this._metricAttributes)\n this._lastProducedBlock = nextBlock\n } else {\n this.logger?.log('No block produced for submission.')\n }\n })\n }, { ...this.context, timeBudgetLimit: 1000 })\n }\n\n protected override async readyHandler(): Promise<void> {\n // Warm pass: prove the production loop reaches its dependencies before declaring ready.\n await this.produceBlock()\n }\n\n protected async redeclareIntent(): Promise<void> {\n await this.spanAsync('redeclareIntent', async () => {\n // Decide if we should redeclare intent\n if (this.config.disableIntentRedeclaration) return\n\n // Get the current block\n const head = (await this.blockViewer.currentBlock())[0]\n if (isUndefined(head)) return\n const currentBlock = head.block\n\n // // Calculate the time until the producer's declaration expires\n const blocksUntilExpiration = this.calculateBlocksUntilProducerDeclarationExpiration(currentBlock)\n\n // Allow the producer time to redeclare itself via block production\n // (for free) before submitting a redeclaration intent transaction.\n if (blocksUntilExpiration > ProducerActor.RedeclarationWindow * 0.1) {\n // Clear any previous redeclaration intent\n this._lastRedeclarationIntent = undefined\n // No need to redeclare yet\n return\n }\n\n // If we already have a valid redeclaration intent, do not create another\n // unless it has expired.\n if (this._lastRedeclarationIntent) {\n // Check if the last redeclaration intent is still valid\n if (this._lastRedeclarationIntent.exp > currentBlock) return\n // If it has expired, clear the last redeclaration intent\n this._lastRedeclarationIntent = undefined\n }\n\n // Check if we have a valid balance before declaring intent\n if (!(await this.validateCurrentBalance())) {\n this.logger?.error(\n `Add balance to address ${this.account.address} for the producer to declare it's intent.`,\n )\n return\n }\n\n // Check if we have a valid stake before declaring intent\n if (!(await this.validateCurrentStake())) {\n this.logger?.error(\n `Add stake to contract address ${this.chainId}`\n + ' for the producer to declare it\\'s intent.',\n )\n return\n }\n\n // Create a redeclaration intent\n this.logger?.log('Creating redeclaration intent for producer:', this.account.address)\n const redeclarationIntent = createDeclarationIntent(\n this.account.address,\n 'producer',\n currentBlock,\n currentBlock + SimpleBlockRunner.RedeclarationDuration,\n )\n\n // Submit the redeclaration intent\n await this.submitRedeclarationIntent(currentBlock, redeclarationIntent)\n\n // On successful submission, save the redeclaration intent\n this._lastRedeclarationIntent = redeclarationIntent\n }, { ...this.context, timeBudgetLimit: 1000 })\n }\n\n protected async submitRedeclarationIntent(currentBlock: XL1BlockNumber, redeclarationIntent: ChainStakeIntent): Promise<void> {\n this.logger?.log('Submitting redeclaration intent for producer:', this.account.address)\n // Create a transaction to submit the redeclaration intent\n const tx = await buildTransaction(\n this.chainId,\n [redeclarationIntent],\n [],\n this.account,\n currentBlock,\n asXL1BlockNumber(currentBlock + 1000, true),\n )\n\n // Submit the redeclaration intent\n await this.mempoolRunner.submitTransactions([tx])\n\n this.logger?.log('Submitted redeclaration intent for producer:', this.account.address)\n }\n\n protected async validateCurrentBalance(): Promise<boolean> {\n // Check if we have a valid balance before declaring intent\n const head = (await this.blockViewer.currentBlock())?.[0]?._hash\n if (isDefined(head)) {\n const balances = await this.accountBalanceViewer.accountBalances([this.account.address], { head })\n const currentBalance = balances[this.account.address] ?? 0n\n if (currentBalance <= 0n) {\n this.logger?.error(`Producer ${this.account.address} has no balance.`)\n return false\n }\n return true\n }\n return true\n }\n\n protected async validateCurrentStake(): Promise<boolean> {\n // Use StakeIntentService to get the required minimum stake\n const requiredMinimumStake = 1n // this.stakeIntentService.getRequiredMinimumStakeForIntent('producer')\n // Check if we have a valid stake before declaring intent\n const currentStake = await this.stakeTotalsViewer.activeByStaked(this.account.address)\n if (currentStake < requiredMinimumStake) {\n this.logger?.error(`Producer ${this.account.address} has insufficient stake.`)\n return false\n }\n return true\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;AACA,SAAS,yBAAyB;;;ACAlC,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,OAGK;;;ACLP;AAAA,EACE;AAAA,EAAU;AAAA,EAAW;AAAA,EAAW;AAAA,EAChC;AAAA,OACK;AACP;AAAA,EAGE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,yBAAyB;AAQlC;AAAA,EACE;AAAA,EAA6B;AAAA,EAAkB;AAAA,EAAoB;AAAA,EACnE;AAAA,EAAkB;AAAA,EAA4B;AAAA,EAAyB;AAAA,EAA2B;AAAA,EAAsB;AAAA,EAAsB;AAAA,OACzI;AACP,SA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,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS,YAAY;AACnB,YAAM,gBAAgB,iBAAiB;AACvC,YAAM,EAAE,UAAU,aAAa,IAAI,MAAM,sBAAsB,CAAC,UAAU,GAAG,aAAa;AAC1F,YAAM,YAAY,kBAAkB,MAAM,SAAS,UAAU,EAAE,QAAQ,MAAM,GAAG,cAAc,SAAS,UAAU,CAAC;AAAA,IACpH;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import type { GetLocatorsFromConfig } from '@xyo-network/chain-orchestration'\nimport { ProducerConfigZod } from '@xyo-network/chain-orchestration'\nimport type { Config } from '@xyo-network/xl1-sdk'\nimport type { CommandModule } from 'yargs'\n\nimport { runProducer } from './run.ts'\n\nexport function producerCommand(getConfiguration: () => Config, getLocatorsFromConfig: GetLocatorsFromConfig): CommandModule {\n return {\n command: 'producer',\n deprecated: 'Use \"start producer\" instead',\n describe: 'Run a XL1 Producer Node',\n handler: async () => {\n const configuration = getConfiguration()\n const { locators, orchestrator } = await getLocatorsFromConfig(['producer'], configuration)\n await runProducer(ProducerConfigZod.parse(locators['producer'].context.config), orchestrator, locators['producer'])\n },\n }\n}\n", "import type { CreatableName } from '@xylabs/sdk-js'\nimport { exists } from '@xylabs/sdk-js'\nimport {\n initActorWallet,\n type OrchestratorInstance,\n type ProducerConfig,\n} from '@xyo-network/chain-orchestration'\nimport type { ProviderFactoryLocatorInstance } from '@xyo-network/xl1-sdk'\n\nimport type { ProducerActorParams } from './ProducerActor.ts'\nimport { ProducerActor } from './ProducerActor.ts'\n\nexport const getProducerActor = async (\n config: ProducerConfig,\n locator: ProviderFactoryLocatorInstance,\n): Promise<ProducerActor> => {\n const account = await initActorWallet({ ...locator.context, config })\n return await ProducerActor.create({\n config, locator, name: 'xl1-producer' as CreatableName, account,\n } satisfies ProducerActorParams)\n}\n\nexport const runProducer = async (\n config: ProducerConfig,\n orchestrator: OrchestratorInstance,\n locator: ProviderFactoryLocatorInstance,\n) => {\n const producer = await getProducerActor(config, locator)\n const actors = [producer].filter(exists)\n\n for (const actor of actors) {\n await orchestrator.registerActor(actor)\n }\n await orchestrator.start()\n}\n", "import type { Attributes, Counter } from '@opentelemetry/api'\nimport {\n assertEx, creatable, isDefined, isUndefined,\n toHex,\n} from '@xylabs/sdk-js'\nimport {\n type ActorCapabilityNeeds,\n type ActorParamsV3,\n ActorV3,\n DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL,\n type ProducerConfig,\n} from '@xyo-network/chain-orchestration'\nimport { SimpleBlockRunner } from '@xyo-network/chain-services'\nimport type { WithHashMeta } from '@xyo-network/sdk-js'\nimport type {\n AccountBalanceViewer,\n BlockBoundWitness,\n BlockRunner, BlockViewer, ChainContractViewer, ChainId, ChainStakeIntent, FinalizationViewer, HydratedBlockWithHashMeta, MempoolRunner,\n MempoolViewer, StakeTotalsViewer, XL1BlockNumber,\n} from '@xyo-network/xl1-sdk'\nimport {\n AccountBalanceViewerMoniker, asXL1BlockNumber, BlockRunnerMoniker, BlockViewerMoniker,\n buildTransaction, ChainContractViewerMoniker, createDeclarationIntent, FinalizationViewerMoniker, MempoolRunnerMoniker, MempoolViewerMoniker, StakeTotalsViewerMoniker,\n} from '@xyo-network/xl1-sdk'\nimport { Mutex } from 'async-mutex'\n\nexport type ProducerActorParams = ActorParamsV3<{\n config: ProducerConfig\n}>\n\nconst SHOULD_REGISTER_REDECLARATION_INTENT_TIMER = true\nconst TEN_MINUTES = 10 * 60 * 1000 // 10 minutes in milliseconds\n\n/**\n * Formats a hydrated block with hash meta into a string representation of its hash and block number.\n * @param blockBoundWitness The hydrated block with hash meta to format\n * @returns The formatted block reference string\n */\nconst toFormattedBlockReference = (blockBoundWitness: WithHashMeta<BlockBoundWitness>): string => {\n return `${blockBoundWitness.block} [${toHex(blockBoundWitness._hash, { prefix: true })}]`\n}\n\n@creatable()\nexport class ProducerActor extends ActorV3<ProducerActorParams> {\n /**\n * The default interval time (in MS) between block production attempts.\n */\n static readonly DefaultBlockProductionCheckInterval = DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL\n\n /**\n * Time in milliseconds the producer will wait before re-attempting block\n * production for the same head when its last produced block has not been\n * adopted (head hasn't advanced). 30 s is short enough to recover quickly\n * from a transient submit-side failure (e.g. the validator rejected the\n * block and the producer's `_lastProducedBlock` cache would otherwise mute\n * retries) while still long enough to avoid hammering the mempool with\n * duplicate submissions under normal latency.\n *\n * Previously this was `blockProductionCheckInterval \u00D7 30` which scaled with\n * the check interval \u2014 5 min in production, 2.5 min in our tightened test\n * config \u2014 both far too long for a failure that needed re-action within a\n * single block time. Made absolute to decouple from the check interval.\n */\n static readonly HeadResubmissionThresholdMs = 30_000\n\n /**\n * The window (in blocks) before expiration to attempt redeclaration of producer intent.\n */\n static readonly RedeclarationWindow = 1000\n\n static readonly needs: ActorCapabilityNeeds = {\n required: [\n AccountBalanceViewerMoniker,\n BlockRunnerMoniker,\n BlockViewerMoniker,\n ChainContractViewerMoniker,\n FinalizationViewerMoniker,\n MempoolRunnerMoniker,\n MempoolViewerMoniker,\n StakeTotalsViewerMoniker,\n ],\n }\n\n protected _lastProducedBlock?: HydratedBlockWithHashMeta\n protected _lastRedeclarationIntent?: ChainStakeIntent\n protected _metricAttributes?: Attributes\n protected _producerActorBlockProductionAttempts!: Counter<Attributes>\n protected _producerActorBlockProductionChecks!: Counter<Attributes>\n protected _producerActorBlocksProduced!: Counter<Attributes>\n protected _producerActorBlocksPublished!: Counter<Attributes>\n\n private _accountBalanceViewer?: AccountBalanceViewer\n private _blockRunner?: BlockRunner\n private _blockViewer?: BlockViewer\n private _chainContractViewer?: ChainContractViewer\n private _chainId?: ChainId\n private _lastHeadChangeTime?: number\n private _lastHeadHash?: string\n private _mempoolRunner?: MempoolRunner\n private _mempoolViewer?: MempoolViewer\n private _produceBlockMutex = new Mutex()\n private _stakeTotalsViewer?: StakeTotalsViewer\n\n override get logger() {\n return assertEx(super.logger, () => 'Logger is required for ProducerActor')\n }\n\n protected get accountBalanceViewer() {\n return this._accountBalanceViewer!\n }\n\n protected get blockProductionCheckInterval() {\n return this.config.blockProductionCheckInterval ?? ProducerActor.DefaultBlockProductionCheckInterval\n }\n\n protected get blockRunner() {\n return this._blockRunner!\n }\n\n protected get blockViewer() {\n return this._blockViewer!\n }\n\n protected get chainContractViewer() {\n return this._chainContractViewer!\n }\n\n protected get chainId() {\n return this._chainId!\n }\n\n protected get config() {\n return this.params.config\n }\n\n protected get headResubmissionThreshold() {\n return ProducerActor.HeadResubmissionThresholdMs\n }\n\n protected get mempoolRunner() {\n return this._mempoolRunner!\n }\n\n protected get mempoolViewer() {\n return this._mempoolViewer!\n }\n\n protected get stakeTotalsViewer() {\n return this._stakeTotalsViewer!\n }\n\n override async createHandler() {\n await super.createHandler()\n // Create the consistent meter attributes that will\n // be included with all metrics from this actor\n this._metricAttributes = { address: this.account.address.toString() }\n // Create the metrics\n this._producerActorBlockProductionChecks = this.counter(\n 'producer_actor_block_production_checks',\n 'Number of block production checks',\n )\n this._producerActorBlockProductionAttempts = this.counter(\n 'producer_actor_block_production_attempts',\n 'Number of block production attempts',\n )\n this._producerActorBlocksProduced = this.counter(\n 'producer_actor_blocks_produced',\n 'Number of blocks produced',\n )\n this._producerActorBlocksPublished = this.counter(\n 'producer_actor_blocks_published',\n 'Number of blocks published',\n )\n const final = await this.locator?.getInstance<FinalizationViewer>(FinalizationViewerMoniker)\n await final.start()\n this._accountBalanceViewer = assertEx(\n await this.locator?.getInstance<AccountBalanceViewer>(AccountBalanceViewerMoniker),\n () => 'Unable to locate AccountBalanceViewer',\n )\n this._blockRunner = assertEx(\n await this.locator?.getInstance<BlockRunner>(BlockRunnerMoniker),\n () => 'Unable to locate BlockRunner',\n )\n this._blockViewer = assertEx(\n await this.locator?.getInstance<BlockViewer>(BlockViewerMoniker),\n () => 'Unable to locate BlockViewer',\n )\n this._chainContractViewer = assertEx(\n await this.locator?.getInstance<ChainContractViewer>(ChainContractViewerMoniker),\n () => 'Unable to locate ChainContractViewer',\n )\n this._mempoolRunner = assertEx(\n await this.locator?.getInstance<MempoolRunner>(MempoolRunnerMoniker),\n () => 'Unable to locate MempoolRunner',\n )\n this._mempoolViewer = assertEx(\n await this.locator?.getInstance<MempoolViewer>(MempoolViewerMoniker),\n () => 'Unable to locate MempoolViewer',\n )\n this._stakeTotalsViewer = assertEx(\n await this.locator?.getInstance<StakeTotalsViewer>(StakeTotalsViewerMoniker),\n () => 'Unable to locate StakeTotalsViewer',\n )\n this._chainId = await this.chainContractViewer.chainId()\n }\n\n // async initLocator() {\n // const config = this.config\n // const endpoint = assertEx(config.services.apiEndpoint, () => 'API endpoint is required in config.services.apiEndpoint')\n // const transportFactory: TransportFactory = (schemas: RpcSchemaMap) => new HttpRpcTransport(endpoint, schemas)\n // const locator = await buildJsonRpcProviderLocatorV2(config, transportFactory)\n\n // const version = '1.0.0'\n // const telemetryConfig = buildTelemetryConfig(config, this.name, version, DefaultMetricsScrapePorts.producer)\n // const { traceProvider, meterProvider } = await startupSpanAsync('initTelemetry', () => initTelemetry(telemetryConfig))\n\n // locator.context.traceProvider = traceProvider\n // locator.context.meterProvider = meterProvider\n\n // locator.register(SimpleBlockRewardViewer.factory<SimpleBlockRewardViewer>(SimpleBlockRewardViewer.dependencies, {}))\n // locator.register(SimpleBlockValidationViewer.factory<SimpleBlockValidationViewer>(\n // SimpleBlockValidationViewer.dependencies,\n // { state: validateHydratedBlockState, protocol: validateHydratedBlock },\n // ))\n // locator.register(SimpleBlockRunner.factory<SimpleBlockRunner>(\n // SimpleBlockRunner.dependencies,\n // { account: this.params.account, rewardAddress: this.params.rewardAddress },\n // ))\n // return await initEvmProvidersIfAvailable(locator)\n // }\n\n override async startHandler() {\n await super.startHandler()\n // Register a timer to check if we should produce a block\n this.registerTimer('BlockProductionTimer', async () => {\n await this.produceBlock()\n }, 2000, this.blockProductionCheckInterval)\n\n if (SHOULD_REGISTER_REDECLARATION_INTENT_TIMER) {\n // Register a timer to check if we should redeclare the producer\n this.registerTimer('ProducerRedeclarationTimer', async () => {\n await this.redeclareIntent()\n }, TEN_MINUTES, TEN_MINUTES)\n }\n }\n\n protected calculateBlocksUntilProducerDeclarationExpiration(currentBlock: number): number {\n return (this._lastRedeclarationIntent?.exp ?? currentBlock) - currentBlock\n }\n\n protected async produceBlock(): Promise<void> {\n this._producerActorBlockProductionChecks.add(1, this._metricAttributes)\n await this.spanAsync('produceBlock', async () => {\n if (this._produceBlockMutex.isLocked()) {\n this.logger?.debug('Skipping block production, previous production still in progress')\n return\n }\n\n await this._produceBlockMutex.runExclusive(async () => {\n // Get the updated head\n const head = (await this.blockViewer.currentBlock())[0]\n const headHash = head._hash\n\n // Track head changes\n const currentTime = Date.now()\n if (this._lastHeadHash !== headHash) {\n const lastHeadHashHex = isDefined(this._lastHeadHash) ? `0x${this._lastHeadHash}` : 'undefined'\n const currentHeadHashHex = `0x${headHash}`\n this.logger?.log(`Found updated head ${lastHeadHashHex} -> ${currentHeadHashHex}`)\n this._lastHeadHash = headHash\n this._lastHeadChangeTime = currentTime\n }\n\n // Check if we should resubmit due to stale head\n const timeSinceHeadChange = isDefined(this._lastHeadChangeTime) ? currentTime - this._lastHeadChangeTime : 0\n\n // If we have never produced a block or the last produced block was not built on the current head we\n // need to attempt to produce a new block\n const shouldSubmit = !this._lastProducedBlock || this._lastProducedBlock[0].previous !== headHash\n\n // If the head has not changed determine if we should resubmit again based on head staleness\n const shouldResubmit = timeSinceHeadChange > this.headResubmissionThreshold\n\n // Determine if we should submit or resubmit\n const shouldSubmitBlock = shouldSubmit || shouldResubmit\n\n if (!shouldSubmitBlock) {\n this.logger?.debug('No block submission required at this time.')\n return\n }\n\n if (shouldResubmit) {\n this.logger?.log(`Resubmitting block due to stale head. Head ${toFormattedBlockReference(head)} unchanged for ${timeSinceHeadChange}ms`)\n this._lastHeadChangeTime = currentTime\n }\n this._producerActorBlockProductionAttempts.add(1, this._metricAttributes)\n // Produce the next block (do not pass force \u2014 undefined result is valid when idle)\n const nextBlock = await this.blockRunner.produceNextBlock(head)\n if (nextBlock) {\n const displayBlockNumber = toFormattedBlockReference(nextBlock[0])\n this.logger?.log('Produced block:', displayBlockNumber)\n this._producerActorBlocksProduced.add(1, this._metricAttributes)\n const submittedHashes = await this.mempoolRunner.submitBlocks([nextBlock])\n if (submittedHashes.length === 0) {\n // submitBlocks resolved without throwing but the archivist did not\n // accept the block (e.g. silent hash-dedupe at the archivist layer).\n // Without this check the producer would treat a dropped block as\n // published and never retry, leaving the chain wedged. Surfacing it\n // here lets operators and tests see the failure mode.\n this.logger?.error(`Submit dropped block ${displayBlockNumber} silently \u2014 archivist accepted 0 of 1 (hash ${nextBlock[0]._hash})`)\n } else {\n this.logger?.log('Published block:', displayBlockNumber)\n }\n this._producerActorBlocksPublished.add(1, this._metricAttributes)\n this._lastProducedBlock = nextBlock\n } else {\n this.logger?.log('No block produced for submission.')\n }\n })\n }, { ...this.context, timeBudgetLimit: 1000 })\n }\n\n protected override async readyHandler(): Promise<void> {\n // Warm pass: prove the production loop reaches its dependencies before declaring ready.\n await this.produceBlock()\n }\n\n protected async redeclareIntent(): Promise<void> {\n await this.spanAsync('redeclareIntent', async () => {\n // Decide if we should redeclare intent\n if (this.config.disableIntentRedeclaration) return\n\n // Get the current block\n const head = (await this.blockViewer.currentBlock())[0]\n if (isUndefined(head)) return\n const currentBlock = head.block\n\n // // Calculate the time until the producer's declaration expires\n const blocksUntilExpiration = this.calculateBlocksUntilProducerDeclarationExpiration(currentBlock)\n\n // Allow the producer time to redeclare itself via block production\n // (for free) before submitting a redeclaration intent transaction.\n if (blocksUntilExpiration > ProducerActor.RedeclarationWindow * 0.1) {\n // Clear any previous redeclaration intent\n this._lastRedeclarationIntent = undefined\n // No need to redeclare yet\n return\n }\n\n // If we already have a valid redeclaration intent, do not create another\n // unless it has expired.\n if (this._lastRedeclarationIntent) {\n // Check if the last redeclaration intent is still valid\n if (this._lastRedeclarationIntent.exp > currentBlock) return\n // If it has expired, clear the last redeclaration intent\n this._lastRedeclarationIntent = undefined\n }\n\n // Check if we have a valid balance before declaring intent\n if (!(await this.validateCurrentBalance())) {\n this.logger?.error(\n `Add balance to address ${this.account.address} for the producer to declare it's intent.`,\n )\n return\n }\n\n // Check if we have a valid stake before declaring intent\n if (!(await this.validateCurrentStake())) {\n this.logger?.error(\n `Add stake to contract address ${this.chainId}`\n + ' for the producer to declare it\\'s intent.',\n )\n return\n }\n\n // Create a redeclaration intent\n this.logger?.log('Creating redeclaration intent for producer:', this.account.address)\n const redeclarationIntent = createDeclarationIntent(\n this.account.address,\n 'producer',\n currentBlock,\n currentBlock + SimpleBlockRunner.RedeclarationDuration,\n )\n\n // Submit the redeclaration intent\n await this.submitRedeclarationIntent(currentBlock, redeclarationIntent)\n\n // On successful submission, save the redeclaration intent\n this._lastRedeclarationIntent = redeclarationIntent\n }, { ...this.context, timeBudgetLimit: 1000 })\n }\n\n protected async submitRedeclarationIntent(currentBlock: XL1BlockNumber, redeclarationIntent: ChainStakeIntent): Promise<void> {\n this.logger?.log('Submitting redeclaration intent for producer:', this.account.address)\n // Create a transaction to submit the redeclaration intent\n const tx = await buildTransaction(\n this.chainId,\n [redeclarationIntent],\n [],\n this.account,\n currentBlock,\n asXL1BlockNumber(currentBlock + 1000, true),\n )\n\n // Submit the redeclaration intent\n await this.mempoolRunner.submitTransactions([tx])\n\n this.logger?.log('Submitted redeclaration intent for producer:', this.account.address)\n }\n\n protected async validateCurrentBalance(): Promise<boolean> {\n // Check if we have a valid balance before declaring intent\n const head = (await this.blockViewer.currentBlock())?.[0]?._hash\n if (isDefined(head)) {\n const balances = await this.accountBalanceViewer.accountBalances([this.account.address], { head })\n const currentBalance = balances[this.account.address] ?? 0n\n if (currentBalance <= 0n) {\n this.logger?.error(`Producer ${this.account.address} has no balance.`)\n return false\n }\n return true\n }\n return true\n }\n\n protected async validateCurrentStake(): Promise<boolean> {\n // Use StakeIntentService to get the required minimum stake\n const requiredMinimumStake = 1n // this.stakeIntentService.getRequiredMinimumStakeForIntent('producer')\n // Check if we have a valid stake before declaring intent\n const currentStake = await this.stakeTotalsViewer.activeByStaked(this.account.address)\n if (currentStake < requiredMinimumStake) {\n this.logger?.error(`Producer ${this.account.address} has insufficient stake.`)\n return false\n }\n return true\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AACA,SAAS,yBAAyB;;;ACAlC,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,OAGK;;;ACLP;AAAA,EACE;AAAA,EAAU;AAAA,EAAW;AAAA,EAAW;AAAA,EAChC;AAAA,OACK;AACP;AAAA,EAGE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,yBAAyB;AAQlC;AAAA,EACE;AAAA,EAA6B;AAAA,EAAkB;AAAA,EAAoB;AAAA,EACnE;AAAA,EAAkB;AAAA,EAA4B;AAAA,EAAyB;AAAA,EAA2B;AAAA,EAAsB;AAAA,EAAsB;AAAA,OACzI;AACP,SAAS,aAAa;AAMtB,IAAM,6CAA6C;AACnD,IAAM,cAAc,KAAK,KAAK;AAO9B,IAAM,4BAA4B,CAAC,sBAA+D;AAChG,SAAO,GAAG,kBAAkB,KAAK,KAAK,MAAM,kBAAkB,OAAO,EAAE,QAAQ,KAAK,CAAC,CAAC;AACxF;AAGO,IAAM,gBAAN,cAA4B,QAA6B;AAAA,EAwCpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAqB,IAAI,MAAM;AAAA,EAC/B;AAAA,EAER,IAAa,SAAS;AACpB,WAAO,SAAS,MAAM,QAAQ,MAAM,sCAAsC;AAAA,EAC5E;AAAA,EAEA,IAAc,uBAAuB;AACnC,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAc,+BAA+B;AAC3C,WAAO,KAAK,OAAO,gCAAgC,cAAc;AAAA,EACnE;AAAA,EAEA,IAAc,cAAc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W,eAyBK,uBAAsB;AAEtC,cA3BW,eA2BK,SAA8B;AAAA,EAC5C,UAAU;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAtCW,gBAAN;AAAA,EADN,UAAU;AAAA,GACE;;;AD/BN,IAAM,mBAAmB,OAC9B,QACA,YAC2B;AAC3B,QAAM,UAAU,MAAM,gBAAgB,EAAE,GAAG,QAAQ,SAAS,OAAO,CAAC;AACpE,SAAO,MAAM,cAAc,OAAO;AAAA,IAChC;AAAA,IAAQ;AAAA,IAAS,MAAM;AAAA,IAAiC;AAAA,EAC1D,CAA+B;AACjC;AAEO,IAAM,cAAc,OACzB,QACA,cACA,YACG;AACH,QAAM,WAAW,MAAM,iBAAiB,QAAQ,OAAO;AACvD,QAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,MAAM;AAEvC,aAAW,SAAS,QAAQ;AAC1B,UAAM,aAAa,cAAc,KAAK;AAAA,EACxC;AACA,QAAM,aAAa,MAAM;AAC3B;;;AD3BO,SAAS,gBAAgB,kBAAgC,uBAA6D;AAC3H,SAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS,YAAY;AACnB,YAAM,gBAAgB,iBAAiB;AACvC,YAAM,EAAE,UAAU,aAAa,IAAI,MAAM,sBAAsB,CAAC,UAAU,GAAG,aAAa;AAC1F,YAAM,YAAY,kBAAkB,MAAM,SAAS,UAAU,EAAE,QAAQ,MAAM,GAAG,cAAc,SAAS,UAAU,CAAC;AAAA,IACpH;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/chain-producer",
3
- "version": "1.23.2",
3
+ "version": "2.0.1",
4
4
  "description": "XYO Layer One Producer",
5
5
  "homepage": "https://xylabs.com",
6
6
  "bugs": {
@@ -35,23 +35,23 @@
35
35
  "README.md"
36
36
  ],
37
37
  "dependencies": {
38
- "@xyo-network/chain-services": "~1.23.2",
39
- "@xyo-network/chain-orchestration": "~1.23.2"
38
+ "@xyo-network/chain-orchestration": "~2.0.1",
39
+ "@xyo-network/chain-services": "~2.0.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@bitauth/libauth": "~3.0.0",
43
43
  "@metamask/json-rpc-engine": "^10.5.0",
44
44
  "@metamask/providers": "^22.1.1",
45
- "@metamask/utils": "~11.11.0",
45
+ "@metamask/utils": "^11.11.0",
46
46
  "@opentelemetry/api": "^1.9.1",
47
47
  "@opentelemetry/context-async-hooks": "~2.7.1",
48
48
  "@opentelemetry/context-zone": "~2.7.1",
49
49
  "@opentelemetry/core": "~2.7.1",
50
- "@opentelemetry/exporter-prometheus": "~0.218",
51
- "@opentelemetry/exporter-trace-otlp-grpc": "~0.218",
52
- "@opentelemetry/exporter-trace-otlp-http": "~0.218",
50
+ "@opentelemetry/exporter-prometheus": "^0.218.0",
51
+ "@opentelemetry/exporter-trace-otlp-grpc": "^0.218.0",
52
+ "@opentelemetry/exporter-trace-otlp-http": "^0.218.0",
53
53
  "@opentelemetry/host-metrics": "~0.38.3",
54
- "@opentelemetry/instrumentation-runtime-node": "~0.31",
54
+ "@opentelemetry/instrumentation-runtime-node": "^0.31.0",
55
55
  "@opentelemetry/resources": "~2.7.1",
56
56
  "@opentelemetry/sdk-metrics": "~2.7.1",
57
57
  "@opentelemetry/sdk-trace-base": "^2.7.1",
@@ -59,40 +59,40 @@
59
59
  "@scure/base": "~2.2.0",
60
60
  "@scure/bip39": "~2.2.0",
61
61
  "@types/yargs": "^17.0.35",
62
- "@xylabs/express": "^5.1.2",
63
- "@xylabs/fetch": "~5.1.2",
64
- "@xylabs/geo": "^5.1.2",
65
- "@xylabs/mongo": "^5.1.2",
66
- "@xylabs/sdk-js": "^5.1.2",
67
- "@xylabs/threads": "~5.1.2",
68
- "@xylabs/toolchain": "~8.0.4",
69
- "@xylabs/tsconfig": "~8.0.4",
70
- "@xyo-network/account": "~5.6.2",
71
- "@xyo-network/account-model": "~5.6.3",
72
- "@xyo-network/api": "~5.6.2",
73
- "@xyo-network/api-models": "~5.6.3",
74
- "@xyo-network/archivist-lmdb": "~5.6.4",
75
- "@xyo-network/archivist-mongodb": "~5.6.4",
76
- "@xyo-network/archivist-view": "~5.6.4",
77
- "@xyo-network/bios-model": "~7.3.1",
78
- "@xyo-network/boundwitness-builder": "~5.6.2",
79
- "@xyo-network/boundwitness-model": "~5.6.3",
80
- "@xyo-network/boundwitness-wrapper": "~5.6.2",
81
- "@xyo-network/config-payload-plugin": "~5.6.3",
82
- "@xyo-network/huri": "~5.6.2",
83
- "@xyo-network/manifest-model": "~5.6.3",
84
- "@xyo-network/payload-builder": "~5.6.2",
85
- "@xyo-network/payload-model": "~5.6.3",
86
- "@xyo-network/payload-plugin": "~5.6.3",
87
- "@xyo-network/payload-wrapper": "~5.6.2",
88
- "@xyo-network/query-payload-plugin": "~5.6.3",
89
- "@xyo-network/sdk-js": "^5.6.4",
90
- "@xyo-network/sdk-protocol-js": "~5.6.3",
62
+ "@xylabs/express": "~6.0.2",
63
+ "@xylabs/fetch": "~6.0.2",
64
+ "@xylabs/geo": "~6.0.2",
65
+ "@xylabs/mongo": "^6.0.2",
66
+ "@xylabs/sdk-js": "^6.0.2",
67
+ "@xylabs/threads": "~6.0.2",
68
+ "@xylabs/toolchain": "~8.1.1",
69
+ "@xylabs/tsconfig": "~8.1.1",
70
+ "@xyo-network/account": "~6.0.0",
71
+ "@xyo-network/account-model": "~6.0.0",
72
+ "@xyo-network/api": "~6.0",
73
+ "@xyo-network/api-models": "~6.0",
74
+ "@xyo-network/archivist-lmdb": "~6.0",
75
+ "@xyo-network/archivist-mongodb": "~6.0.0",
76
+ "@xyo-network/archivist-view": "~6.0",
77
+ "@xyo-network/bios-model": "~8.0",
78
+ "@xyo-network/boundwitness-builder": "~6.0.0",
79
+ "@xyo-network/boundwitness-model": "~6.0.0",
80
+ "@xyo-network/boundwitness-wrapper": "~6.0.0",
81
+ "@xyo-network/config-payload-plugin": "~6.0.0",
82
+ "@xyo-network/huri": "~6.0",
83
+ "@xyo-network/manifest-model": "~6.0.0",
84
+ "@xyo-network/payload-builder": "~6.0.0",
85
+ "@xyo-network/payload-model": "~6.0.0",
86
+ "@xyo-network/payload-plugin": "~6.0",
87
+ "@xyo-network/payload-wrapper": "~6.0.0",
88
+ "@xyo-network/query-payload-plugin": "~6.0.0",
89
+ "@xyo-network/sdk-js": "~6.0",
90
+ "@xyo-network/sdk-protocol-js": "~6.0",
91
91
  "@xyo-network/typechain": "^4.1.3",
92
- "@xyo-network/wallet": "~5.6.2",
93
- "@xyo-network/wallet-model": "^5.6.3",
94
- "@xyo-network/xl1-protocol-sdk": "~1.30.2",
95
- "@xyo-network/xl1-sdk": "^1.30.2",
92
+ "@xyo-network/wallet": "~6.0",
93
+ "@xyo-network/wallet-model": "^6.0.0",
94
+ "@xyo-network/xl1-protocol-sdk": "~2.0",
95
+ "@xyo-network/xl1-sdk": "~2.0",
96
96
  "ajv": "^8.20.0",
97
97
  "async-mutex": "^0.5.0",
98
98
  "bn.js": "^5.2.3",
@@ -105,7 +105,7 @@
105
105
  "cosmiconfig": "^9.0.1",
106
106
  "debug": "~4.4.3",
107
107
  "dotenv": "~17.4.2",
108
- "eslint": "^10.3.0",
108
+ "eslint": "^10.4.0",
109
109
  "ethers": "^6.16.0",
110
110
  "express": "^5.2.1",
111
111
  "express-mung": "~0.5.1",
@@ -113,8 +113,8 @@
113
113
  "http-status-codes": "~2.3.0",
114
114
  "idb": "^8.0.3",
115
115
  "lmdb": "^3.5.4",
116
- "lru-cache": "^11.3.6",
117
- "mapbox-gl": "^3.23.1",
116
+ "lru-cache": "^11.5.0",
117
+ "mapbox-gl": "^3.24.0",
118
118
  "mongodb": "^7.2.0",
119
119
  "nodemon": "~3.1.14",
120
120
  "observable-fns": "~0.6.1",
@@ -125,8 +125,8 @@
125
125
  "tslib": "^2.8.1",
126
126
  "typescript": "~6.0.3",
127
127
  "uuid": "~14.0.0",
128
- "vite": "^8.0.13",
129
- "vitest": "^4.1.6",
128
+ "vite": "^8.0.14",
129
+ "vitest": "^4.1.7",
130
130
  "wasm-feature-detect": "~1.8.0",
131
131
  "web3-types": "~1.10.0",
132
132
  "webextension-polyfill": "^0.12.0",
@@ -138,7 +138,7 @@
138
138
  "@bitauth/libauth": "~3.0",
139
139
  "@metamask/json-rpc-engine": "^10.3",
140
140
  "@metamask/providers": "^22.1",
141
- "@metamask/utils": "~11.11",
141
+ "@metamask/utils": "^11.11",
142
142
  "@opentelemetry/api": "^1.9",
143
143
  "@opentelemetry/context-async-hooks": "~2.7",
144
144
  "@opentelemetry/context-zone": "~2.7",
@@ -154,38 +154,38 @@
154
154
  "@opentelemetry/semantic-conventions": "~1.41",
155
155
  "@scure/base": "~2.2",
156
156
  "@scure/bip39": "~2.2",
157
- "@xylabs/express": "^5.1",
158
- "@xylabs/fetch": "~5.1",
159
- "@xylabs/geo": "^5.1",
160
- "@xylabs/mongo": "^5.1",
161
- "@xylabs/sdk-js": "^5.1",
162
- "@xylabs/threads": "~5.1",
163
- "@xyo-network/account": "~5.6",
164
- "@xyo-network/account-model": "~5.6",
165
- "@xyo-network/api": "~5.6",
166
- "@xyo-network/api-models": "~5.6",
167
- "@xyo-network/archivist-lmdb": "~5.6",
168
- "@xyo-network/archivist-mongodb": "~5.6",
169
- "@xyo-network/archivist-view": "~5.6",
170
- "@xyo-network/bios-model": "~7.3",
171
- "@xyo-network/boundwitness-builder": "~5.6",
172
- "@xyo-network/boundwitness-model": "~5.6",
173
- "@xyo-network/boundwitness-wrapper": "~5.6",
174
- "@xyo-network/config-payload-plugin": "~5.6",
175
- "@xyo-network/huri": "~5.6",
176
- "@xyo-network/manifest-model": "~5.6",
177
- "@xyo-network/payload-builder": "~5.6",
178
- "@xyo-network/payload-model": "~5.6",
179
- "@xyo-network/payload-plugin": "~5.6",
180
- "@xyo-network/payload-wrapper": "~5.6",
181
- "@xyo-network/query-payload-plugin": "~5.6",
182
- "@xyo-network/sdk-js": "^5.6",
183
- "@xyo-network/sdk-protocol-js": "~5.6",
157
+ "@xylabs/express": "^6.0",
158
+ "@xylabs/fetch": "^6.0",
159
+ "@xylabs/geo": "^6.0",
160
+ "@xylabs/mongo": "^6.0",
161
+ "@xylabs/sdk-js": "^6.0",
162
+ "@xylabs/threads": "~6.0",
163
+ "@xyo-network/account": "~6.0",
164
+ "@xyo-network/account-model": "~6.0",
165
+ "@xyo-network/api": "~6.0",
166
+ "@xyo-network/api-models": "~6.0",
167
+ "@xyo-network/archivist-lmdb": "~6.0",
168
+ "@xyo-network/archivist-mongodb": "~6.0",
169
+ "@xyo-network/archivist-view": "~6.0",
170
+ "@xyo-network/bios-model": "~8.0",
171
+ "@xyo-network/boundwitness-builder": "~6.0",
172
+ "@xyo-network/boundwitness-model": "~6.0",
173
+ "@xyo-network/boundwitness-wrapper": "~6.0",
174
+ "@xyo-network/config-payload-plugin": "~6.0",
175
+ "@xyo-network/huri": "~6.0",
176
+ "@xyo-network/manifest-model": "~6.0",
177
+ "@xyo-network/payload-builder": "~6.0",
178
+ "@xyo-network/payload-model": "~6.0",
179
+ "@xyo-network/payload-plugin": "~6.0",
180
+ "@xyo-network/payload-wrapper": "~6.0",
181
+ "@xyo-network/query-payload-plugin": "~6.0",
182
+ "@xyo-network/sdk-js": "^6.0",
183
+ "@xyo-network/sdk-protocol-js": "~6.0",
184
184
  "@xyo-network/typechain": "^4.1",
185
- "@xyo-network/wallet": "~5.6",
186
- "@xyo-network/wallet-model": "^5.6",
187
- "@xyo-network/xl1-protocol-sdk": "~1.30.1",
188
- "@xyo-network/xl1-sdk": "^1.28",
185
+ "@xyo-network/wallet": "~6.0",
186
+ "@xyo-network/wallet-model": "^6.0",
187
+ "@xyo-network/xl1-protocol-sdk": "~2.0",
188
+ "@xyo-network/xl1-sdk": "^2.0",
189
189
  "ajv": "^8.20",
190
190
  "async-mutex": "^0.5",
191
191
  "bn.js": "^5.2",