@xyo-network/xl1-protocol-sdk 1.21.0 → 1.21.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.
@@ -4561,6 +4561,9 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
4561
4561
  get blockValidationViewer() {
4562
4562
  return this._blockValidationViewer;
4563
4563
  }
4564
+ get finalizationViewer() {
4565
+ return this._finalizationViewer;
4566
+ }
4564
4567
  get pendingBlocksArchivist() {
4565
4568
  return this.params.pendingBlocksArchivist;
4566
4569
  }
@@ -4584,6 +4587,7 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
4584
4587
  maxPrune = 1e3,
4585
4588
  maxCheck = 1e3
4586
4589
  } = {}) {
4590
+ const headNumber = await this.finalizationViewer.headNumber();
4587
4591
  let total = 0;
4588
4592
  let pruned = 0;
4589
4593
  let cursor;
@@ -4599,16 +4603,19 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
4599
4603
  const blocks = await Promise.all(bundles.map(async (bundle3) => {
4600
4604
  return bundle3 ? await bundledPayloadToHydratedBlock(bundle3) : null;
4601
4605
  }));
4602
- let valid = blocks.map((b) => !!b);
4606
+ let valid = blocks.map((b) => isHydratedBlockWithHashMeta(b) ? b[0].block > headNumber : false);
4603
4607
  let remainingBlockMap = [];
4604
4608
  let remainingBlocks = blocks.map((b, i) => {
4605
4609
  if (isHydratedBlockWithHashMeta(b)) {
4610
+ remainingBlockMap.push(i);
4606
4611
  return b;
4607
4612
  }
4608
- remainingBlockMap.push(i);
4609
4613
  }).filter(exists5);
4610
- assertEx35(remainingBlockMap.length === remainingBlocks.length, () => "remainingBlockMap length should match remainingBlocks length");
4611
- const validationResults = await this.blockValidationViewer.validateBlocks(remainingBlocks);
4614
+ assertEx35(
4615
+ remainingBlockMap.length === remainingBlocks.length,
4616
+ () => `remainingBlockMap length should match remainingBlocks length [${remainingBlockMap.length}/${remainingBlocks.length}]`
4617
+ );
4618
+ const validationResults = await this.blockValidationViewer.validateBlocks(remainingBlocks, { value: true, state: false });
4612
4619
  for (const [i, r] of validationResults.entries()) {
4613
4620
  const validated = isHydratedBlockWithHashMeta(r);
4614
4621
  valid[remainingBlockMap[i]] = validated;
@@ -4630,7 +4637,7 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
4630
4637
  }
4631
4638
  return [pruned, total];
4632
4639
  }
4633
- prunePendingTransactions() {
4640
+ prunePendingTransactions(_options) {
4634
4641
  throw new Error("Method not implemented.");
4635
4642
  }
4636
4643
  async submitBlocks(blocks) {
@@ -4655,7 +4662,7 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
4655
4662
  }
4656
4663
  };
4657
4664
  __publicField(SimpleMempoolRunner, "defaultMoniker", MempoolRunnerMoniker);
4658
- __publicField(SimpleMempoolRunner, "dependencies", [WindowedBlockViewerMoniker, FinalizationViewerMoniker]);
4665
+ __publicField(SimpleMempoolRunner, "dependencies", [WindowedBlockViewerMoniker, FinalizationViewerMoniker, BlockValidationViewerMoniker]);
4659
4666
  __publicField(SimpleMempoolRunner, "monikers", [MempoolRunnerMoniker]);
4660
4667
  SimpleMempoolRunner = __decorateClass([
4661
4668
  creatableProvider()