@aztec/stdlib 2.1.0-rc.1 → 2.1.0-rc.11

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.
Files changed (63) hide show
  1. package/dest/block/attestation_info.d.ts +30 -0
  2. package/dest/block/attestation_info.d.ts.map +1 -0
  3. package/dest/block/attestation_info.js +39 -0
  4. package/dest/block/index.d.ts +1 -0
  5. package/dest/block/index.d.ts.map +1 -1
  6. package/dest/block/index.js +1 -0
  7. package/dest/block/proposal/attestations_and_signers.js +1 -1
  8. package/dest/block/published_l2_block.d.ts +0 -2
  9. package/dest/block/published_l2_block.d.ts.map +1 -1
  10. package/dest/block/published_l2_block.js +0 -6
  11. package/dest/epoch-helpers/index.d.ts +2 -0
  12. package/dest/epoch-helpers/index.d.ts.map +1 -1
  13. package/dest/epoch-helpers/index.js +3 -0
  14. package/dest/file-store/factory.d.ts.map +1 -1
  15. package/dest/file-store/factory.js +18 -0
  16. package/dest/file-store/interface.d.ts +8 -2
  17. package/dest/file-store/interface.d.ts.map +1 -1
  18. package/dest/file-store/s3.d.ts +26 -0
  19. package/dest/file-store/s3.d.ts.map +1 -0
  20. package/dest/file-store/s3.js +252 -0
  21. package/dest/interfaces/aztec-node-admin.d.ts +3 -0
  22. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  23. package/dest/interfaces/configs.d.ts +5 -0
  24. package/dest/interfaces/configs.d.ts.map +1 -1
  25. package/dest/interfaces/configs.js +2 -1
  26. package/dest/interfaces/p2p.d.ts +2 -0
  27. package/dest/interfaces/p2p.d.ts.map +1 -1
  28. package/dest/interfaces/p2p.js +2 -1
  29. package/dest/l1-contracts/slash_factory.d.ts +1 -1
  30. package/dest/l1-contracts/slash_factory.d.ts.map +1 -1
  31. package/dest/l1-contracts/slash_factory.js +1 -1
  32. package/dest/p2p/block_attestation.d.ts +47 -1
  33. package/dest/p2p/block_attestation.d.ts.map +1 -1
  34. package/dest/p2p/block_attestation.js +43 -9
  35. package/dest/p2p/consensus_payload.js +1 -1
  36. package/dest/p2p/gossipable.d.ts +2 -4
  37. package/dest/p2p/gossipable.d.ts.map +1 -1
  38. package/dest/p2p/gossipable.js +5 -14
  39. package/dest/snapshots/download.d.ts.map +1 -1
  40. package/dest/snapshots/download.js +58 -2
  41. package/dest/snapshots/upload.d.ts.map +1 -1
  42. package/dest/snapshots/upload.js +1 -0
  43. package/dest/tests/mocks.d.ts +3 -1
  44. package/dest/tests/mocks.d.ts.map +1 -1
  45. package/dest/tests/mocks.js +31 -9
  46. package/package.json +10 -9
  47. package/src/block/attestation_info.ts +62 -0
  48. package/src/block/index.ts +1 -0
  49. package/src/block/proposal/attestations_and_signers.ts +1 -1
  50. package/src/block/published_l2_block.ts +0 -11
  51. package/src/epoch-helpers/index.ts +8 -0
  52. package/src/file-store/factory.ts +15 -0
  53. package/src/file-store/interface.ts +8 -2
  54. package/src/file-store/s3.ts +254 -0
  55. package/src/interfaces/configs.ts +3 -0
  56. package/src/interfaces/p2p.ts +4 -0
  57. package/src/l1-contracts/slash_factory.ts +1 -1
  58. package/src/p2p/block_attestation.ts +57 -6
  59. package/src/p2p/consensus_payload.ts +1 -1
  60. package/src/p2p/gossipable.ts +6 -16
  61. package/src/snapshots/download.ts +66 -2
  62. package/src/snapshots/upload.ts +1 -0
  63. package/src/tests/mocks.ts +51 -12
@@ -0,0 +1,30 @@
1
+ import type { EthAddress } from '@aztec/foundation/eth-address';
2
+ import type { L2Block } from './l2_block.js';
3
+ import type { CommitteeAttestation } from './proposal/committee_attestation.js';
4
+ /**
5
+ * Status indicating how the attestation address was determined
6
+ */
7
+ export type AttestationStatus = 'recovered-from-signature' | 'provided-as-address' | 'invalid-signature' | 'empty';
8
+ /**
9
+ * Information about an attestation extracted from a published block
10
+ */
11
+ export type AttestationInfo = {
12
+ /** The validator's address, undefined if signature recovery failed or empty */
13
+ address?: undefined;
14
+ /** How the attestation address was determined */
15
+ status: Extract<AttestationStatus, 'invalid-signature' | 'empty'>;
16
+ } | {
17
+ /** The validator's address */
18
+ address: EthAddress;
19
+ /** How the attestation address was determined */
20
+ status: Extract<AttestationStatus, 'provided-as-address' | 'recovered-from-signature'>;
21
+ };
22
+ /**
23
+ * Extracts attestation information from a published L2 block.
24
+ * Returns info for each attestation, preserving array indices.
25
+ */
26
+ export declare function getAttestationInfoFromPublishedL2Block(block: {
27
+ attestations: CommitteeAttestation[];
28
+ block: L2Block;
29
+ }): AttestationInfo[];
30
+ //# sourceMappingURL=attestation_info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attestation_info.d.ts","sourceRoot":"","sources":["../../src/block/attestation_info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAIhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,0BAA0B,GAAG,qBAAqB,GAAG,mBAAmB,GAAG,OAAO,CAAC;AAEnH;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB;IACE,+EAA+E;IAC/E,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,iDAAiD;IACjD,MAAM,EAAE,OAAO,CAAC,iBAAiB,EAAE,mBAAmB,GAAG,OAAO,CAAC,CAAC;CACnE,GACD;IACE,8BAA8B;IAC9B,OAAO,EAAE,UAAU,CAAC;IACpB,iDAAiD;IACjD,MAAM,EAAE,OAAO,CAAC,iBAAiB,EAAE,qBAAqB,GAAG,0BAA0B,CAAC,CAAC;CACxF,CAAC;AAEN;;;GAGG;AACH,wBAAgB,sCAAsC,CAAC,KAAK,EAAE;IAC5D,YAAY,EAAE,oBAAoB,EAAE,CAAC;IACrC,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,eAAe,EAAE,CAwBpB"}
@@ -0,0 +1,39 @@
1
+ import { recoverAddress } from '@aztec/foundation/crypto';
2
+ import { ConsensusPayload } from '../p2p/consensus_payload.js';
3
+ import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from '../p2p/signature_utils.js';
4
+ /**
5
+ * Extracts attestation information from a published L2 block.
6
+ * Returns info for each attestation, preserving array indices.
7
+ */ export function getAttestationInfoFromPublishedL2Block(block) {
8
+ const payload = ConsensusPayload.fromBlock(block.block);
9
+ const hashedPayload = getHashedSignaturePayloadEthSignedMessage(payload, SignatureDomainSeparator.blockAttestation);
10
+ return block.attestations.map((attestation)=>{
11
+ // If signature is empty, check if we have an address directly
12
+ if (attestation.signature.isEmpty()) {
13
+ if (attestation.address.isZero()) {
14
+ // No signature and no address - empty
15
+ return {
16
+ status: 'empty'
17
+ };
18
+ }
19
+ // Address provided without signature
20
+ return {
21
+ address: attestation.address,
22
+ status: 'provided-as-address'
23
+ };
24
+ }
25
+ // Try to recover address from signature
26
+ try {
27
+ const recoveredAddress = recoverAddress(hashedPayload, attestation.signature);
28
+ return {
29
+ address: recoveredAddress,
30
+ status: 'recovered-from-signature'
31
+ };
32
+ } catch {
33
+ // Signature present but recovery failed
34
+ return {
35
+ status: 'invalid-signature'
36
+ };
37
+ }
38
+ });
39
+ }
@@ -9,4 +9,5 @@ export * from './published_l2_block.js';
9
9
  export * from './proposal/index.js';
10
10
  export * from './validate_block_result.js';
11
11
  export * from './l2_block_info.js';
12
+ export * from './attestation_info.js';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/block/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/block/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
@@ -9,3 +9,4 @@ export * from './published_l2_block.js';
9
9
  export * from './proposal/index.js';
10
10
  export * from './validate_block_result.js';
11
11
  export * from './l2_block_info.js';
12
+ export * from './attestation_info.js';
@@ -1,5 +1,5 @@
1
1
  import { hexToBuffer } from '@aztec/foundation/string';
2
- import { encodeAbiParameters, parseAbiParameters } from 'viem';
2
+ import { encodeAbiParameters, parseAbiParameters } from '@spalladino/viem';
3
3
  import { z } from 'zod';
4
4
  import { CommitteeAttestation } from './committee_attestation.js';
5
5
  export class CommitteeAttestationsAndSigners {
@@ -1,7 +1,6 @@
1
1
  import { BufferReader } from '@aztec/foundation/serialize';
2
2
  import type { FieldsOf } from '@aztec/foundation/types';
3
3
  import { z } from 'zod';
4
- import { BlockAttestation } from '../p2p/block_attestation.js';
5
4
  import { L2Block } from './l2_block.js';
6
5
  import { CommitteeAttestation } from './proposal/committee_attestation.js';
7
6
  export declare class L1PublishedData {
@@ -141,5 +140,4 @@ export declare class PublishedL2Block {
141
140
  static fromFields(fields: FieldsOf<PublishedL2Block>): PublishedL2Block;
142
141
  toBuffer(): Buffer;
143
142
  }
144
- export declare function getAttestationsFromPublishedL2Block(block: Pick<PublishedL2Block, 'attestations' | 'block'>): BlockAttestation[];
145
143
  //# sourceMappingURL=published_l2_block.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MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAI7C,QAAQ,IAAI,MAAM;CAU1B"}
@@ -4,8 +4,6 @@ import { randomBigInt } from '@aztec/foundation/crypto';
4
4
  import { schemas } from '@aztec/foundation/schemas';
5
5
  import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
6
6
  import { z } from 'zod';
7
- import { BlockAttestation } from '../p2p/block_attestation.js';
8
- import { ConsensusPayload } from '../p2p/consensus_payload.js';
9
7
  import { L2Block } from './l2_block.js';
10
8
  import { CommitteeAttestation } from './proposal/committee_attestation.js';
11
9
  export class L1PublishedData {
@@ -63,7 +61,3 @@ export class PublishedL2Block {
63
61
  return serializeToBuffer(this.block, this.l1.blockNumber, this.l1.blockHash, this.l1.timestamp, this.attestations.length, this.attestations);
64
62
  }
65
63
  }
66
- export function getAttestationsFromPublishedL2Block(block) {
67
- const payload = ConsensusPayload.fromBlock(block.block);
68
- return block.attestations.filter((attestation)=>!attestation.signature.isEmpty()).map((attestation)=>new BlockAttestation(block.block.number, payload, attestation.signature));
69
- }
@@ -59,4 +59,6 @@ export declare function getProofSubmissionDeadlineEpoch(epochNumber: bigint, con
59
59
  * Computed as the start of the given epoch plus the proof submission window.
60
60
  */
61
61
  export declare function getProofSubmissionDeadlineTimestamp(epochNumber: bigint, constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'epochDuration' | 'proofSubmissionEpochs'>): bigint;
62
+ /** Returns the timestamp to start building a block for a given L2 slot. Computed as the start timestamp of the slot minus one L1 slot duration. */
63
+ export declare function getSlotStartBuildTimestamp(slotNumber: number | bigint, constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'ethereumSlotDuration'>): number;
62
64
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/epoch-helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;A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z.object({
68
68
  const [deadlineSlot] = getSlotRangeForEpoch(deadlineEpoch, constants);
69
69
  return getTimestampForSlot(deadlineSlot, constants);
70
70
  }
71
+ /** Returns the timestamp to start building a block for a given L2 slot. Computed as the start timestamp of the slot minus one L1 slot duration. */ export function getSlotStartBuildTimestamp(slotNumber, constants) {
72
+ return Number(constants.l1GenesisTime) + Number(slotNumber) * constants.slotDuration - constants.ethereumSlotDuration;
73
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/file-store/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAIlE,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASnE,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAC3F,wBAAsB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAgC9F,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC3G,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/file-store/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAIlE,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAWnE,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAC3F,wBAAsB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AA6C9F,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC3G,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -2,8 +2,10 @@ import { createLogger } from '@aztec/foundation/log';
2
2
  import { GoogleCloudFileStore } from './gcs.js';
3
3
  import { HttpFileStore } from './http.js';
4
4
  import { LocalFileStore } from './local.js';
5
+ import { S3FileStore } from './s3.js';
5
6
  const supportedExamples = [
6
7
  `gs://bucket-name/path/to/store`,
8
+ `s3://bucket-name/path/to/store`,
7
9
  `file:///absolute/local/path/to/store`,
8
10
  `https://host/path`
9
11
  ];
@@ -30,6 +32,22 @@ export async function createFileStore(config, logger = createLogger('stdlib:file
30
32
  } catch {
31
33
  throw new Error(`Invalid google cloud store definition: '${config}'.`);
32
34
  }
35
+ } else if (config.startsWith('s3://')) {
36
+ try {
37
+ const url = new URL(config);
38
+ const bucket = url.host;
39
+ const path = url.pathname.replace(/^\/+/, '');
40
+ const endpoint = url.searchParams.get('endpoint');
41
+ const publicBaseUrl = url.searchParams.get('publicBaseUrl') ?? undefined;
42
+ logger.info(`Creating S3 file store at ${bucket} ${path}`);
43
+ const store = new S3FileStore(bucket, path, {
44
+ endpoint: endpoint ?? undefined,
45
+ publicBaseUrl
46
+ });
47
+ return store;
48
+ } catch {
49
+ throw new Error(`Invalid S3 store definition: '${config}'.`);
50
+ }
33
51
  } else {
34
52
  throw new Error(`Unknown file store config: '${config}'. Supported values are ${supportedExamples.join(', ')}.`);
35
53
  }
@@ -14,9 +14,15 @@ export type FileStoreSaveOptions = {
14
14
  };
15
15
  /** Simple file store. */
16
16
  export interface FileStore extends ReadOnlyFileStore {
17
- /** Saves contents to the given path. Returns an URI that can be used later to `read` the file. */
17
+ /**
18
+ * Saves contents to the given path. Returns an URI that can be used later to `read` the file.
19
+ * Default: `compress` is false unless explicitly set.
20
+ */
18
21
  save(path: string, data: Buffer, opts?: FileStoreSaveOptions): Promise<string>;
19
- /** Uploads contents from a local file. Returns an URI that can be used later to `read` the file. */
22
+ /**
23
+ * Uploads contents from a local file. Returns an URI that can be used later to `read` the file.
24
+ * Default: `compress` is true unless explicitly set to false.
25
+ */
20
26
  upload(destPath: string, srcPath: string, opts?: FileStoreSaveOptions): Promise<string>;
21
27
  }
22
28
  //# sourceMappingURL=interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/file-store/interface.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,MAAM,WAAW,iBAAiB;IAChC,iGAAiG;IACjG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,wGAAwG;IACxG,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,8DAA8D;IAC9D,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,oBAAoB,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/G,yBAAyB;AACzB,MAAM,WAAW,SAAU,SAAQ,iBAAiB;IAClD,kGAAkG;IAClG,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/E,oGAAoG;IACpG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACzF"}
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/file-store/interface.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,MAAM,WAAW,iBAAiB;IAChC,iGAAiG;IACjG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,wGAAwG;IACxG,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,8DAA8D;IAC9D,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,oBAAoB,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/G,yBAAyB;AACzB,MAAM,WAAW,SAAU,SAAQ,iBAAiB;IAClD;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/E;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACzF"}
@@ -0,0 +1,26 @@
1
+ import { type Logger } from '@aztec/foundation/log';
2
+ import type { FileStore, FileStoreSaveOptions } from './interface.js';
3
+ export declare class S3FileStore implements FileStore {
4
+ private readonly bucketName;
5
+ private readonly basePath;
6
+ private readonly log;
7
+ private readonly s3;
8
+ private readonly region;
9
+ private readonly endpoint?;
10
+ private readonly publicBaseUrl?;
11
+ constructor(bucketName: string, basePath: string, opts: {
12
+ endpoint?: string;
13
+ publicBaseUrl?: string;
14
+ }, log?: Logger);
15
+ save(path: string, data: Buffer, opts?: FileStoreSaveOptions): Promise<string>;
16
+ upload(destPath: string, srcPath: string, opts?: FileStoreSaveOptions): Promise<string>;
17
+ read(pathOrUrlStr: string): Promise<Buffer>;
18
+ download(pathOrUrlStr: string, destPath: string): Promise<void>;
19
+ exists(pathOrUrlStr: string): Promise<boolean>;
20
+ private extractUserMetadata;
21
+ private detectContentType;
22
+ private buildReturnedUrl;
23
+ private getBucketAndKey;
24
+ private getFullPath;
25
+ }
26
+ //# sourceMappingURL=s3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../src/file-store/s3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAiBlE,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAMtE,qBAAa,WAAY,YAAW,SAAS;IAOzC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IATtB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAW;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;gBAGrB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EACjC,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,EAClC,GAAG,GAAE,MAA6C;IAiBxD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,oBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC;IAoBlF,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,oBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC;IA6D3F,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAW3C,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/D,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAe3D,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,gBAAgB;IA0BxB,OAAO,CAAC,eAAe;IA2BvB,OAAO,CAAC,WAAW;CAKpB"}
@@ -0,0 +1,252 @@
1
+ import { createLogger } from '@aztec/foundation/log';
2
+ import { GetObjectCommand, HeadObjectCommand, PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
3
+ import { createReadStream, createWriteStream } from 'fs';
4
+ import { mkdir, mkdtemp, stat, unlink } from 'fs/promises';
5
+ import { tmpdir } from 'os';
6
+ import { basename, dirname, join } from 'path';
7
+ import { finished } from 'stream/promises';
8
+ import { createGzip } from 'zlib';
9
+ function normalizeBasePath(path) {
10
+ return path?.replace(/^\/+|\/+$/g, '') ?? '';
11
+ }
12
+ export class S3FileStore {
13
+ bucketName;
14
+ basePath;
15
+ log;
16
+ s3;
17
+ region;
18
+ endpoint;
19
+ publicBaseUrl;
20
+ constructor(bucketName, basePath, opts, log = createLogger('stdlib:s3-file-store')){
21
+ this.bucketName = bucketName;
22
+ this.basePath = basePath;
23
+ this.log = log;
24
+ this.endpoint = opts.endpoint;
25
+ this.region = this.endpoint ? 'auto' : process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION ?? 'us-east-1';
26
+ this.publicBaseUrl = opts.publicBaseUrl;
27
+ const clientOptions = {};
28
+ if (this.endpoint) {
29
+ clientOptions.region = 'auto';
30
+ clientOptions.endpoint = this.endpoint;
31
+ clientOptions.forcePathStyle = true;
32
+ } else {
33
+ clientOptions.region = this.region;
34
+ }
35
+ this.s3 = new S3Client(clientOptions);
36
+ }
37
+ async save(path, data, opts = {}) {
38
+ const key = this.getFullPath(path);
39
+ const shouldCompress = !!opts.compress;
40
+ const body = shouldCompress ? (await import('zlib')).gzipSync(data) : data;
41
+ const contentLength = body.length;
42
+ const contentType = this.detectContentType(key, shouldCompress);
43
+ const put = new PutObjectCommand({
44
+ Bucket: this.bucketName,
45
+ Key: key,
46
+ Body: body,
47
+ ContentType: contentType,
48
+ CacheControl: opts.metadata?.['Cache-control'],
49
+ Metadata: this.extractUserMetadata(opts.metadata),
50
+ ContentLength: contentLength
51
+ });
52
+ await this.s3.send(put);
53
+ return this.buildReturnedUrl(key, !!opts.public);
54
+ }
55
+ async upload(destPath, srcPath, opts = {}) {
56
+ const key = this.getFullPath(destPath);
57
+ const shouldCompress = opts.compress !== false; // default true like GCS impl
58
+ await mkdir(dirname(srcPath), {
59
+ recursive: true
60
+ }).catch(()=>undefined);
61
+ let contentLength;
62
+ let bodyPath = srcPath;
63
+ // We don't set Content-Encoding and we avoid SigV4 streaming (aws-chunked).
64
+ // With AWS SigV4 streaming uploads (Content-Encoding: aws-chunked[,gzip]), servers require
65
+ // x-amz-decoded-content-length (the size of the decoded payload) and an exact Content-Length
66
+ // that includes chunk metadata. For on-the-fly compression, providing
67
+ // those values without buffering or a pre-pass is impractical. Instead, we pre-gzip to a temp file
68
+ // to know ContentLength up-front and upload the gzipped bytes as-is, omitting Content-Encoding.
69
+ // Reference: AWS SigV4 streaming (chunked upload) requirements —
70
+ // https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html
71
+ if (shouldCompress) {
72
+ // Pre-gzip to a temp file so we know the exact length for R2/S3 headers
73
+ const tmpDir = await mkdtemp(join(tmpdir(), 's3-upload-'));
74
+ const gzPath = join(tmpDir, `${basename(srcPath)}.gz`);
75
+ const source = createReadStream(srcPath);
76
+ const gz = createGzip();
77
+ const out = createWriteStream(gzPath);
78
+ try {
79
+ await finished(source.pipe(gz).pipe(out));
80
+ const st = await stat(gzPath);
81
+ contentLength = st.size;
82
+ bodyPath = gzPath;
83
+ } catch (err) {
84
+ // Ensure temp file is removed on failure
85
+ await unlink(gzPath).catch(()=>undefined);
86
+ throw err;
87
+ }
88
+ } else {
89
+ const st = await stat(srcPath);
90
+ contentLength = st.size;
91
+ bodyPath = srcPath;
92
+ }
93
+ const bodyStream = createReadStream(bodyPath);
94
+ const contentType = this.detectContentType(key, shouldCompress);
95
+ try {
96
+ const put = new PutObjectCommand({
97
+ Bucket: this.bucketName,
98
+ Key: key,
99
+ Body: bodyStream,
100
+ ContentType: contentType,
101
+ CacheControl: opts.metadata?.['Cache-control'],
102
+ Metadata: this.extractUserMetadata(opts.metadata),
103
+ // Explicitly set ContentLength so R2 can compute x-amz-decoded-content-length correctly
104
+ ContentLength: contentLength
105
+ });
106
+ await this.s3.send(put);
107
+ } finally{
108
+ if (shouldCompress && bodyPath !== srcPath) {
109
+ await unlink(bodyPath).catch(()=>undefined);
110
+ }
111
+ }
112
+ return this.buildReturnedUrl(key, !!opts.public);
113
+ }
114
+ async read(pathOrUrlStr) {
115
+ const { bucket, key } = this.getBucketAndKey(pathOrUrlStr);
116
+ const out = await this.s3.send(new GetObjectCommand({
117
+ Bucket: bucket,
118
+ Key: key
119
+ }));
120
+ const stream = out.Body;
121
+ const chunks = [];
122
+ for await (const chunk of stream){
123
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
124
+ }
125
+ return Buffer.concat(chunks);
126
+ }
127
+ async download(pathOrUrlStr, destPath) {
128
+ const { bucket, key } = this.getBucketAndKey(pathOrUrlStr);
129
+ const out = await this.s3.send(new GetObjectCommand({
130
+ Bucket: bucket,
131
+ Key: key
132
+ }));
133
+ await mkdir(dirname(destPath), {
134
+ recursive: true
135
+ });
136
+ const write = createWriteStream(destPath);
137
+ await finished(out.Body.pipe(write));
138
+ }
139
+ async exists(pathOrUrlStr) {
140
+ try {
141
+ const { bucket, key } = this.getBucketAndKey(pathOrUrlStr);
142
+ await this.s3.send(new HeadObjectCommand({
143
+ Bucket: bucket,
144
+ Key: key
145
+ }));
146
+ return true;
147
+ } catch (err) {
148
+ const code = err?.$metadata?.httpStatusCode ?? err?.name ?? err?.Code;
149
+ if (code === 404 || code === 'NotFound' || code === 'NoSuchKey') {
150
+ return false;
151
+ }
152
+ this.log.warn(`Error checking existence for ${pathOrUrlStr}: ${err?.message ?? String(err)}`);
153
+ return false;
154
+ }
155
+ }
156
+ extractUserMetadata(meta) {
157
+ if (!meta) {
158
+ return undefined;
159
+ }
160
+ const { ['Cache-control']: _ignored, ...rest } = meta;
161
+ return Object.keys(rest).length ? rest : undefined;
162
+ }
163
+ detectContentType(key, isCompressed) {
164
+ // Basic content type inference
165
+ const lower = key.toLowerCase();
166
+ if (lower.endsWith('.json') || lower.endsWith('.json.gz')) {
167
+ return 'application/json';
168
+ }
169
+ if (lower.endsWith('.txt') || lower.endsWith('.log') || lower.endsWith('.csv') || lower.endsWith('.md')) {
170
+ return 'text/plain; charset=utf-8';
171
+ }
172
+ if (lower.endsWith('.db') || lower.endsWith('.sqlite') || lower.endsWith('.bin')) {
173
+ return 'application/octet-stream';
174
+ }
175
+ if (lower.endsWith('.wasm') || lower.endsWith('.wasm.gz')) {
176
+ return 'application/wasm';
177
+ }
178
+ // If compressed, prefer octet-stream unless known
179
+ if (isCompressed) {
180
+ return 'application/octet-stream';
181
+ }
182
+ return undefined;
183
+ }
184
+ buildReturnedUrl(key, makePublic) {
185
+ if (!makePublic) {
186
+ return `s3://${this.bucketName}/${key}`;
187
+ }
188
+ if (this.publicBaseUrl) {
189
+ const base = this.publicBaseUrl.replace(/\/$/, '');
190
+ // key already includes basePath via getFullPath, so do not prefix basePath again
191
+ const full = key.replace(/^\/+/, '');
192
+ return `${base}/${full}`;
193
+ }
194
+ // Try to synthesize a URL from endpoint if available (works for public R2 buckets)
195
+ if (this.endpoint) {
196
+ try {
197
+ const url = new URL(this.endpoint);
198
+ return `https://${this.bucketName}.${url.host}/${key}`;
199
+ } catch {
200
+ // fallthrough
201
+ }
202
+ }
203
+ // Fallback to AWS style URL if region looks valid
204
+ return `https://${this.bucketName}.s3.${this.region}.amazonaws.com/${key}`;
205
+ }
206
+ getBucketAndKey(pathOrUrlStr) {
207
+ if (URL.canParse(pathOrUrlStr)) {
208
+ const url = new URL(pathOrUrlStr);
209
+ if (url.protocol === 's3:') {
210
+ return {
211
+ bucket: url.host,
212
+ key: url.pathname.replace(/^\/+/, '')
213
+ };
214
+ }
215
+ // For https URLs, try to infer virtual-hosted or path-style
216
+ if (url.protocol === 'https:' || url.protocol === 'http:') {
217
+ // If the URL matches the configured publicBaseUrl host, map back to our bucket and key
218
+ if (this.publicBaseUrl && url.host === new URL(this.publicBaseUrl).host) {
219
+ return {
220
+ bucket: this.bucketName,
221
+ key: url.pathname.replace(/^\/+/, '')
222
+ };
223
+ }
224
+ const hostParts = url.host.split('.');
225
+ if (hostParts.length > 3 && (hostParts[1] === 's3' || hostParts[hostParts.length - 2] === 'r2')) {
226
+ // virtual hosted
227
+ return {
228
+ bucket: hostParts[0],
229
+ key: url.pathname.replace(/^\/+/, '')
230
+ };
231
+ } else if (this.endpoint && url.host === new URL(this.endpoint).host) {
232
+ // path-style at custom endpoint
233
+ const [bucket, ...rest] = url.pathname.replace(/^\/+/, '').split('/');
234
+ return {
235
+ bucket,
236
+ key: rest.join('/')
237
+ };
238
+ }
239
+ }
240
+ }
241
+ // Treat as path
242
+ return {
243
+ bucket: this.bucketName,
244
+ key: this.getFullPath(pathOrUrlStr)
245
+ };
246
+ }
247
+ getFullPath(path) {
248
+ const base = normalizeBasePath(this.basePath);
249
+ const rel = path.replace(/^\/+/, '');
250
+ return base ? join(base, rel) : rel;
251
+ }
252
+ }
@@ -95,6 +95,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
95
95
  skipCollectingAttestations: z.ZodOptional<z.ZodBoolean>;
96
96
  secondsBeforeInvalidatingBlockAsCommitteeMember: z.ZodNumber;
97
97
  secondsBeforeInvalidatingBlockAsNonCommitteeMember: z.ZodNumber;
98
+ injectFakeAttestation: z.ZodOptional<z.ZodBoolean>;
98
99
  } & {
99
100
  nodeUrl: z.ZodOptional<z.ZodString>;
100
101
  realProofs: z.ZodBoolean;
@@ -199,6 +200,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
199
200
  fakeProcessingDelayPerTxMs?: number | undefined;
200
201
  attestationPropagationTime?: number | undefined;
201
202
  skipCollectingAttestations?: boolean | undefined;
203
+ injectFakeAttestation?: boolean | undefined;
202
204
  proverId?: import("@aztec/foundation/schemas").EthAddress | undefined;
203
205
  archiverPollingIntervalMS?: number | undefined;
204
206
  archiverBatchSize?: number | undefined;
@@ -267,6 +269,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
267
269
  fakeProcessingDelayPerTxMs?: number | undefined;
268
270
  attestationPropagationTime?: number | undefined;
269
271
  skipCollectingAttestations?: boolean | undefined;
272
+ injectFakeAttestation?: boolean | undefined;
270
273
  proverId?: any;
271
274
  archiverPollingIntervalMS?: string | number | bigint | undefined;
272
275
  archiverBatchSize?: string | number | bigint | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"aztec-node-admin.d.ts","sourceRoot":"","sources":["../../src/interfaces/aztec-node-admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAE1F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUU,CAAC;AAElD,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,cAAc,CAYhE,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,OAAO,CAAC,kBAAkB,CAAM,EAC1C,KAAK,sBAAe,GACnB,cAAc,CAMhB"}
@@ -49,6 +49,8 @@ export interface SequencerConfig {
49
49
  skipCollectingAttestations?: boolean;
50
50
  /** Do not invalidate the previous block if invalid when we are the proposer (for testing only) */
51
51
  skipInvalidateBlockAsProposer?: boolean;
52
+ /** Inject a fake attestation (for testing only) */
53
+ injectFakeAttestation?: boolean;
52
54
  }
53
55
  export declare const SequencerConfigSchema: z.ZodObject<{
54
56
  transactionPollingIntervalMS: z.ZodOptional<z.ZodNumber>;
@@ -101,6 +103,7 @@ export declare const SequencerConfigSchema: z.ZodObject<{
101
103
  skipCollectingAttestations: z.ZodOptional<z.ZodBoolean>;
102
104
  secondsBeforeInvalidatingBlockAsCommitteeMember: z.ZodNumber;
103
105
  secondsBeforeInvalidatingBlockAsNonCommitteeMember: z.ZodNumber;
106
+ injectFakeAttestation: z.ZodOptional<z.ZodBoolean>;
104
107
  }, "strip", z.ZodTypeAny, {
105
108
  secondsBeforeInvalidatingBlockAsCommitteeMember: number;
106
109
  secondsBeforeInvalidatingBlockAsNonCommitteeMember: number;
@@ -132,6 +135,7 @@ export declare const SequencerConfigSchema: z.ZodObject<{
132
135
  fakeProcessingDelayPerTxMs?: number | undefined;
133
136
  attestationPropagationTime?: number | undefined;
134
137
  skipCollectingAttestations?: boolean | undefined;
138
+ injectFakeAttestation?: boolean | undefined;
135
139
  }, {
136
140
  secondsBeforeInvalidatingBlockAsCommitteeMember: number;
137
141
  secondsBeforeInvalidatingBlockAsNonCommitteeMember: number;
@@ -163,5 +167,6 @@ export declare const SequencerConfigSchema: z.ZodObject<{
163
167
  fakeProcessingDelayPerTxMs?: number | undefined;
164
168
  attestationPropagationTime?: number | undefined;
165
169
  skipCollectingAttestations?: boolean | undefined;
170
+ injectFakeAttestation?: boolean | undefined;
166
171
  }>;
167
172
  //# sourceMappingURL=configs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/interfaces/configs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,sBAAsB,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,gCAAgC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kCAAkC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,sBAAsB,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1C,qBAAqB;IACr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export const SequencerConfigSchema = z.object({
21
21
  attestationPropagationTime: z.number().optional(),
22
22
  skipCollectingAttestations: z.boolean().optional(),
23
23
  secondsBeforeInvalidatingBlockAsCommitteeMember: z.number(),
24
- secondsBeforeInvalidatingBlockAsNonCommitteeMember: z.number()
24
+ secondsBeforeInvalidatingBlockAsNonCommitteeMember: z.number(),
25
+ injectFakeAttestation: z.boolean().optional()
25
26
  });
@@ -48,6 +48,8 @@ export interface P2PApiWithAttestations extends P2PApiWithoutAttestations {
48
48
  * @returns BlockAttestations
49
49
  */
50
50
  getAttestationsForSlot(slot: bigint, proposalId?: string): Promise<BlockAttestation[]>;
51
+ /** Deletes a given attestation manually from the p2p client attestation pool. */
52
+ deleteAttestation(attestation: BlockAttestation): Promise<void>;
51
53
  }
52
54
  export interface P2PClient extends P2PApiWithAttestations {
53
55
  /** Manually adds an attestation to the p2p client attestation pool. */
@@ -1 +1 @@
1
- {"version":3,"file":"p2p.d.ts","sourceRoot":"","sources":["../../src/interfaces/p2p.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,MAAM,QAAQ,GAChB;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,GAC1E;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE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