@aztec-labs/stdlib 6.0.0-rc.1 → 6.0.0-rc.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.
- package/dest/avm/avm.d.ts +210 -210
- package/dest/avm/message_pack.d.ts +1 -1
- package/dest/avm/message_pack.d.ts.map +1 -1
- package/dest/avm/message_pack.js +10 -0
- package/dest/block/block_parameter.d.ts +10 -1
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +8 -3
- package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts +11 -1
- package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_reexecution_tracker.js +12 -0
- package/dest/checkpoint/validate.d.ts +2 -1
- package/dest/checkpoint/validate.d.ts.map +1 -1
- package/dest/checkpoint/validate.js +9 -0
- package/dest/config/network-consensus-config.d.ts +17 -5
- package/dest/config/network-consensus-config.d.ts.map +1 -1
- package/dest/config/network-consensus-config.js +54 -8
- package/dest/gas/gas_fees.d.ts +27 -1
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_fees.js +3 -0
- package/dest/interfaces/aztec-node-admin.d.ts +2 -1
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.d.ts +27 -5
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +8 -1
- package/dest/interfaces/configs.d.ts +9 -1
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +2 -1
- package/dest/interfaces/prover-broker.d.ts +3 -1
- package/dest/interfaces/prover-broker.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +70 -70
- package/dest/interfaces/server_circuit_prover.d.ts +4 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/p2p/block_proposal.d.ts +1 -1
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +5 -0
- package/dest/p2p/checkpoint_proposal.d.ts +1 -1
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +5 -0
- package/dest/p2p/gossipable.d.ts +1 -1
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/gossipable.js +6 -0
- package/package.json +7 -7
- package/src/avm/message_pack.ts +10 -0
- package/src/block/block_parameter.ts +13 -1
- package/src/checkpoint/checkpoint_reexecution_tracker.ts +14 -0
- package/src/checkpoint/validate.ts +14 -0
- package/src/config/network-consensus-config.ts +70 -11
- package/src/gas/gas_fees.ts +35 -0
- package/src/interfaces/aztec-node.ts +41 -4
- package/src/interfaces/configs.ts +8 -0
- package/src/interfaces/prover-broker.ts +2 -0
- package/src/interfaces/server_circuit_prover.ts +3 -2
- package/src/p2p/block_proposal.ts +6 -0
- package/src/p2p/checkpoint_proposal.ts +6 -0
- package/src/p2p/gossipable.ts +6 -0
|
@@ -281,6 +281,12 @@ export class BlockProposal extends Gossipable implements Signable {
|
|
|
281
281
|
static fromBuffer(buf: Buffer | BufferReader): BlockProposal {
|
|
282
282
|
const reader = BufferReader.asReader(buf);
|
|
283
283
|
|
|
284
|
+
// Decoding is lenient on purpose, for forward compatibility: trailing bytes are ignored and any non-zero
|
|
285
|
+
// presence flag reads as present, so a newer version can append fields that older nodes skip over. Rejecting
|
|
286
|
+
// them would make every wire extension a coordinated upgrade. Lenient decoding does not let one proposal take
|
|
287
|
+
// several identities, since the P2P message identifier and the signature both cover the signed payload rather
|
|
288
|
+
// than the raw bytes.
|
|
289
|
+
|
|
284
290
|
const blockHeader = reader.readObject(BlockHeader);
|
|
285
291
|
const indexWithinCheckpoint = IndexWithinCheckpoint(reader.readNumber());
|
|
286
292
|
const archiveRoot = reader.readObject(Fr);
|
|
@@ -308,6 +308,12 @@ export class CheckpointProposal extends Gossipable implements Signable {
|
|
|
308
308
|
static fromBuffer(buf: Buffer | BufferReader): CheckpointProposal {
|
|
309
309
|
const reader = BufferReader.asReader(buf);
|
|
310
310
|
|
|
311
|
+
// Decoding is lenient on purpose, for forward compatibility: trailing bytes are ignored and any non-zero
|
|
312
|
+
// presence flag reads as present, so a newer version can append fields that older nodes skip over. Rejecting
|
|
313
|
+
// them would make every wire extension a coordinated upgrade. Lenient decoding does not let one proposal take
|
|
314
|
+
// several identities, since the P2P message identifier and the signature both cover the signed payload rather
|
|
315
|
+
// than the raw bytes.
|
|
316
|
+
|
|
311
317
|
const checkpointHeader = reader.readObject(CheckpointHeader);
|
|
312
318
|
const archive = reader.readObject(Fr);
|
|
313
319
|
const feeAssetPriceModifier = reader.readInt256();
|
package/src/p2p/gossipable.ts
CHANGED
|
@@ -26,6 +26,12 @@ export class P2PMessage {
|
|
|
26
26
|
traceContext = reader.readString();
|
|
27
27
|
}
|
|
28
28
|
const payload = reader.readBuffer();
|
|
29
|
+
// Reject trailing bytes: padding leaves the same payload but a new message id, so a copy evades
|
|
30
|
+
// both the seen-message dedup and the duplicate-delivery peer scoring, letting a peer replay one
|
|
31
|
+
// valid message (e.g. a proposal it cannot forge) as fresh deliveries.
|
|
32
|
+
if (!reader.isEmpty()) {
|
|
33
|
+
throw new Error('P2PMessage has trailing bytes after its payload');
|
|
34
|
+
}
|
|
29
35
|
return new P2PMessage(payload, timestamp, traceContext);
|
|
30
36
|
}
|
|
31
37
|
|