Skip to content

Commit 92cecbd

Browse files
committed
chore(fast-inbox): clarify bucket-reference tail compatibility comments (A-1388)
The optional bucket-reference tail keeps proposals that omit it round-tripping cleanly; it does not make the wire byte-identical to the pre-inHash-removal format. Reword the toBuffer/fromBuffer comments to describe only the tail's unset case.
1 parent 47babed commit 92cecbd

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

yarn-project/stdlib/src/p2p/block_proposal.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ export class BlockProposal extends Gossipable implements Signable {
268268
} else {
269269
buffer.push(0); // hasSignedTxs = false
270270
}
271-
// Optional bucket-reference tail (AZIP-22 Fast Inbox). Appended only when set, so pre-flip proposals serialize
272-
// byte-identically to the legacy format and mixed-version peers keep decoding them.
271+
// Optional bucket-reference tail (AZIP-22 Fast Inbox). Appended only when set, so a proposal without a reference
272+
// serializes without the tail and a decoder that reaches EOF reads it as unset.
273273
if (this.bucketRef) {
274274
buffer.push(1); // hasBucketRef = true
275275
buffer.push(this.bucketRef.toBuffer());
@@ -299,8 +299,8 @@ export class BlockProposal extends Gossipable implements Signable {
299299
}
300300
}
301301

302-
// Optional bucket-reference tail (AZIP-22 Fast Inbox). Legacy buffers end after the signedTxs flag, so EOF here
303-
// decodes as "no reference" — this is the cross-version tolerance that keeps mixed-version gossip working.
302+
// Optional bucket-reference tail (AZIP-22 Fast Inbox). A buffer that ends after the signedTxs flag decodes as
303+
// "no reference", so proposals written without the tail round-trip cleanly.
304304
let bucketRef: InboxBucketRef | undefined;
305305
if (!reader.isEmpty()) {
306306
const hasBucketRef = reader.readNumber();

yarn-project/stdlib/src/p2p/checkpoint_proposal.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ export class CheckpointProposal extends Gossipable implements Signable {
294294
} else {
295295
buffer.push(0); // hasSignedTxs = false
296296
}
297-
// Optional bucket-reference tail (AZIP-22 Fast Inbox). Appended only when set, so pre-flip proposals serialize
298-
// byte-identically to the legacy format and mixed-version peers keep decoding them.
297+
// Optional bucket-reference tail (AZIP-22 Fast Inbox). Appended only when set, so a proposal without a reference
298+
// serializes without the tail and a decoder that reaches EOF reads it as unset.
299299
if (this.lastBlock.bucketRef) {
300300
buffer.push(1); // hasBucketRef = true
301301
buffer.push(this.lastBlock.bucketRef.toBuffer());
@@ -336,8 +336,8 @@ export class CheckpointProposal extends Gossipable implements Signable {
336336
}
337337
}
338338

339-
// Optional bucket-reference tail (AZIP-22 Fast Inbox). Legacy buffers end after the signedTxs flag, so EOF here
340-
// decodes as "no reference" — the cross-version tolerance that keeps mixed-version gossip working.
339+
// Optional bucket-reference tail (AZIP-22 Fast Inbox). A buffer that ends after the signedTxs flag decodes as
340+
// "no reference", so proposals written without the tail round-trip cleanly.
341341
let bucketRef: InboxBucketRef | undefined;
342342
if (!reader.isEmpty()) {
343343
const hasBucketRef = reader.readNumber();

0 commit comments

Comments
 (0)