@aztec/stdlib 3.0.0-nightly.20251010 → 3.0.0-nightly.20251011

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.
@@ -1,11 +1,9 @@
1
1
  import { Buffer32 } from '@aztec/foundation/buffer';
2
2
  import type { TopicType } from './topic_type.js';
3
3
  export declare class P2PMessage {
4
- readonly publishTime: Date;
5
- readonly id: Buffer32;
6
4
  readonly payload: Buffer;
7
- constructor(publishTime: Date, id: Buffer32, payload: Buffer);
8
- static fromGossipable(message: Gossipable): Promise<P2PMessage>;
5
+ constructor(payload: Buffer);
6
+ static fromGossipable(message: Gossipable): P2PMessage;
9
7
  static fromMessageData(messageData: Buffer): P2PMessage;
10
8
  toMessageData(): Buffer;
11
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gossipable.d.ts","sourceRoot":"","sources":["../../src/p2p/gossipable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,qBAAa,UAAU;aAEH,WAAW,EAAE,IAAI;aACjB,EAAE,EAAE,QAAQ;aACZ,OAAO,EAAE,MAAM;gBAFf,WAAW,EAAE,IAAI,EACjB,EAAE,EAAE,QAAQ,EACZ,OAAO,EAAE,MAAM;WAGpB,cAAc,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAIrE,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU;IAQvD,aAAa,IAAI,MAAM;CAOxB;AAED;;;;GAIG;AACH,8BAAsB,UAAU;IAC9B,OAAO,CAAC,QAAQ,CAAuB;IACvC;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC;IAE3B;;;OAGG;IACG,oBAAoB,IAAI,OAAO,CAAC,QAAQ,CAAC;IAQ/C,QAAQ,CAAC,4BAA4B,IAAI,OAAO,CAAC,QAAQ,CAAC;IAE1D;;;OAGG;IACH,QAAQ,CAAC,QAAQ,IAAI,MAAM;IAE3B,SAAS,IAAI,MAAM;IAInB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,IAAI,MAAM;CAC3B"}
1
+ {"version":3,"file":"gossipable.d.ts","sourceRoot":"","sources":["../../src/p2p/gossipable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,qBAAa,UAAU;aACO,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM;IAE3C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU;IAItD,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU;IAMvD,aAAa,IAAI,MAAM;CAGxB;AAED;;;;GAIG;AACH,8BAAsB,UAAU;IAC9B,OAAO,CAAC,QAAQ,CAAuB;IACvC;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC;IAE3B;;;OAGG;IACG,oBAAoB,IAAI,OAAO,CAAC,QAAQ,CAAC;IAQ/C,QAAQ,CAAC,4BAA4B,IAAI,OAAO,CAAC,QAAQ,CAAC;IAE1D;;;OAGG;IACH,QAAQ,CAAC,QAAQ,IAAI,MAAM;IAE3B,SAAS,IAAI,MAAM;IAInB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,IAAI,MAAM;CAC3B"}
@@ -1,28 +1,19 @@
1
- import { Buffer32 } from '@aztec/foundation/buffer';
2
- import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
1
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
3
2
  export class P2PMessage {
4
- publishTime;
5
- id;
6
3
  payload;
7
- constructor(publishTime, id, payload){
8
- this.publishTime = publishTime;
9
- this.id = id;
4
+ constructor(payload){
10
5
  this.payload = payload;
11
6
  }
12
- static async fromGossipable(message) {
13
- return new P2PMessage(new Date(), await message.p2pMessageIdentifier(), message.toBuffer());
7
+ static fromGossipable(message) {
8
+ return new P2PMessage(message.toBuffer());
14
9
  }
15
10
  static fromMessageData(messageData) {
16
11
  const reader = new BufferReader(messageData);
17
- const publishTime = reader.readUInt64();
18
- const id = Buffer32.fromBuffer(reader);
19
12
  const payload = reader.readBuffer();
20
- return new P2PMessage(new Date(Number(publishTime)), id, payload);
13
+ return new P2PMessage(payload);
21
14
  }
22
15
  toMessageData() {
23
16
  return serializeToBuffer([
24
- bigintToUInt64BE(BigInt(this.publishTime.getTime())),
25
- this.id,
26
17
  serializeToBuffer(this.payload.length, this.payload)
27
18
  ]);
28
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/stdlib",
3
- "version": "3.0.0-nightly.20251010",
3
+ "version": "3.0.0-nightly.20251011",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json",
@@ -70,13 +70,13 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@aws-sdk/client-s3": "^3.892.0",
73
- "@aztec/bb.js": "3.0.0-nightly.20251010",
74
- "@aztec/blob-lib": "3.0.0-nightly.20251010",
75
- "@aztec/constants": "3.0.0-nightly.20251010",
76
- "@aztec/ethereum": "3.0.0-nightly.20251010",
77
- "@aztec/foundation": "3.0.0-nightly.20251010",
78
- "@aztec/l1-artifacts": "3.0.0-nightly.20251010",
79
- "@aztec/noir-noirc_abi": "3.0.0-nightly.20251010",
73
+ "@aztec/bb.js": "3.0.0-nightly.20251011",
74
+ "@aztec/blob-lib": "3.0.0-nightly.20251011",
75
+ "@aztec/constants": "3.0.0-nightly.20251011",
76
+ "@aztec/ethereum": "3.0.0-nightly.20251011",
77
+ "@aztec/foundation": "3.0.0-nightly.20251011",
78
+ "@aztec/l1-artifacts": "3.0.0-nightly.20251011",
79
+ "@aztec/noir-noirc_abi": "3.0.0-nightly.20251011",
80
80
  "@google-cloud/storage": "^7.15.0",
81
81
  "axios": "^1.12.0",
82
82
  "json-stringify-deterministic": "1.0.12",
@@ -1,33 +1,23 @@
1
1
  import { Buffer32 } from '@aztec/foundation/buffer';
2
- import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
2
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
3
3
 
4
4
  import type { TopicType } from './topic_type.js';
5
5
 
6
6
  export class P2PMessage {
7
- constructor(
8
- public readonly publishTime: Date,
9
- public readonly id: Buffer32,
10
- public readonly payload: Buffer,
11
- ) {}
7
+ constructor(public readonly payload: Buffer) {}
12
8
 
13
- static async fromGossipable(message: Gossipable): Promise<P2PMessage> {
14
- return new P2PMessage(new Date(), await message.p2pMessageIdentifier(), message.toBuffer());
9
+ static fromGossipable(message: Gossipable): P2PMessage {
10
+ return new P2PMessage(message.toBuffer());
15
11
  }
16
12
 
17
13
  static fromMessageData(messageData: Buffer): P2PMessage {
18
14
  const reader = new BufferReader(messageData);
19
- const publishTime = reader.readUInt64();
20
- const id = Buffer32.fromBuffer(reader);
21
15
  const payload = reader.readBuffer();
22
- return new P2PMessage(new Date(Number(publishTime)), id, payload);
16
+ return new P2PMessage(payload);
23
17
  }
24
18
 
25
19
  toMessageData(): Buffer {
26
- return serializeToBuffer([
27
- bigintToUInt64BE(BigInt(this.publishTime.getTime())),
28
- this.id,
29
- serializeToBuffer(this.payload.length, this.payload),
30
- ]);
20
+ return serializeToBuffer([serializeToBuffer(this.payload.length, this.payload)]);
31
21
  }
32
22
  }
33
23