@aztec/stdlib 3.0.0-nightly.20251005 → 3.0.0-nightly.20251008
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 +62 -78
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +8 -22
- package/dest/avm/avm_circuit_public_inputs.d.ts +19 -6
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +12 -11
- package/dest/avm/avm_proving_request.d.ts +49 -40
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/file-store/interface.d.ts +8 -2
- package/dest/file-store/interface.d.ts.map +1 -1
- package/dest/file-store/s3.d.ts +1 -0
- package/dest/file-store/s3.d.ts.map +1 -1
- package/dest/file-store/s3.js +81 -16
- package/dest/interfaces/aztec-node-admin.d.ts +3 -0
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/configs.d.ts +5 -0
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +2 -1
- package/dest/interfaces/proving-job.d.ts +49 -40
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +1 -1
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +3 -2
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts +4 -3
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/private_call_data.d.ts +4 -24
- package/dest/kernel/private_call_data.d.ts.map +1 -1
- package/dest/kernel/private_call_data.js +4 -16
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +3 -3
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +3 -3
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +5 -4
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.js +7 -6
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +1 -1
- package/dest/p2p/block_proposal.d.ts +2 -0
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.d.ts +4 -4
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.js +4 -4
- package/dest/rollup/checkpoint_constant_data.d.ts +4 -4
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.js +4 -4
- package/dest/rollup/epoch_constant_data.d.ts +4 -4
- package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
- package/dest/rollup/epoch_constant_data.js +5 -5
- package/dest/snapshots/download.d.ts.map +1 -1
- package/dest/snapshots/download.js +58 -2
- package/dest/snapshots/upload.d.ts.map +1 -1
- package/dest/snapshots/upload.js +1 -0
- package/dest/tests/factories.d.ts +5 -4
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +11 -10
- package/dest/tests/mocks.d.ts +2 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +2 -2
- package/dest/trees/index.d.ts +0 -1
- package/dest/trees/index.d.ts.map +1 -1
- package/dest/trees/index.js +0 -1
- package/dest/tx/index.d.ts +2 -0
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +2 -0
- package/dest/tx/private_tx_constant_data.d.ts +60 -0
- package/dest/tx/private_tx_constant_data.d.ts.map +1 -0
- package/dest/tx/private_tx_constant_data.js +69 -0
- package/dest/tx/protocol_contracts.d.ts +29 -0
- package/dest/tx/protocol_contracts.d.ts.map +1 -0
- package/dest/tx/protocol_contracts.js +49 -0
- package/dest/tx/tx_constant_data.d.ts +5 -37
- package/dest/tx/tx_constant_data.d.ts.map +1 -1
- package/dest/tx/tx_constant_data.js +8 -17
- package/dest/tx/validator/error_texts.d.ts +1 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +1 -1
- package/dest/versioning/versioning.d.ts +2 -2
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/versioning/versioning.js +8 -8
- package/package.json +8 -8
- package/src/avm/avm.ts +13 -24
- package/src/avm/avm_circuit_public_inputs.ts +11 -10
- package/src/file-store/interface.ts +8 -2
- package/src/file-store/s3.ts +83 -15
- package/src/interfaces/configs.ts +3 -0
- package/src/interfaces/validator.ts +1 -1
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +3 -2
- package/src/kernel/hints/nullifier_read_request_hints.ts +3 -3
- package/src/kernel/private_call_data.ts +2 -21
- package/src/kernel/private_kernel_circuit_public_inputs.ts +4 -4
- package/src/kernel/private_kernel_init_circuit_private_inputs.ts +5 -4
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +1 -1
- package/src/p2p/block_proposal.ts +2 -0
- package/src/rollup/block_constant_data.ts +3 -3
- package/src/rollup/checkpoint_constant_data.ts +3 -3
- package/src/rollup/epoch_constant_data.ts +3 -9
- package/src/snapshots/download.ts +66 -2
- package/src/snapshots/upload.ts +1 -0
- package/src/tests/factories.ts +12 -19
- package/src/tests/mocks.ts +3 -3
- package/src/trees/index.ts +0 -1
- package/src/tx/index.ts +2 -0
- package/src/tx/private_tx_constant_data.ts +94 -0
- package/src/tx/protocol_contracts.ts +70 -0
- package/src/tx/tx_constant_data.ts +6 -19
- package/src/tx/validator/error_texts.ts +1 -1
- package/src/versioning/versioning.ts +10 -10
- package/dest/trees/protocol_contract_leaf.d.ts +0 -84
- package/dest/trees/protocol_contract_leaf.d.ts.map +0 -1
- package/dest/trees/protocol_contract_leaf.js +0 -100
- package/src/trees/protocol_contract_leaf.ts +0 -128
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { MAX_PROTOCOL_CONTRACTS } from '@aztec/constants';
|
|
2
|
-
import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
3
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import { schemas } from '@aztec/foundation/schemas';
|
|
5
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
6
|
-
import type { IndexedTreeLeaf, IndexedTreeLeafPreimage } from '@aztec/foundation/trees';
|
|
7
|
-
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Class containing the data of a preimage of a single leaf in the protocol contract tree.
|
|
12
|
-
* Note: It's called preimage because this data gets hashed before being inserted as a node into the `IndexedTree`.
|
|
13
|
-
* Note: Though this tree contains addresses, they are converted to fields to avoid unnecessary conversions in the tree.
|
|
14
|
-
*/
|
|
15
|
-
export class ProtocolContractLeafPreimage implements IndexedTreeLeafPreimage {
|
|
16
|
-
constructor(
|
|
17
|
-
/**
|
|
18
|
-
* Leaf value inside the indexed tree's linked list.
|
|
19
|
-
*/
|
|
20
|
-
public address: Fr,
|
|
21
|
-
/**
|
|
22
|
-
* Next value inside the indexed tree's linked list.
|
|
23
|
-
*/
|
|
24
|
-
public nextAddress: Fr,
|
|
25
|
-
/**
|
|
26
|
-
* Index of the next leaf in the indexed tree's linked list.
|
|
27
|
-
*/
|
|
28
|
-
public nextIndex: bigint,
|
|
29
|
-
) {}
|
|
30
|
-
|
|
31
|
-
static get schema() {
|
|
32
|
-
return z
|
|
33
|
-
.object({
|
|
34
|
-
address: schemas.Fr,
|
|
35
|
-
nextAddress: schemas.Fr,
|
|
36
|
-
nextIndex: schemas.BigInt,
|
|
37
|
-
})
|
|
38
|
-
.transform(
|
|
39
|
-
({ address, nextAddress, nextIndex }) => new ProtocolContractLeafPreimage(address, nextAddress, nextIndex),
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
getKey(): bigint {
|
|
44
|
-
return this.address.toBigInt();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
getNextKey(): bigint {
|
|
48
|
-
return this.nextAddress.toBigInt();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
getNextIndex(): bigint {
|
|
52
|
-
return this.nextIndex;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
asLeaf(): ProtocolContractLeaf {
|
|
56
|
-
return new ProtocolContractLeaf(this.address);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
toBuffer(): Buffer {
|
|
60
|
-
return Buffer.concat(this.toHashInputs());
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
toHashInputs(): Buffer[] {
|
|
64
|
-
// Note: the protocol contract leaves only hash the value and next value.
|
|
65
|
-
return [Buffer.from(this.address.toBuffer()), Buffer.from(this.nextAddress.toBuffer())];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
toFields(): Fr[] {
|
|
69
|
-
return [this.address, this.nextAddress, new Fr(this.nextIndex)];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
static random() {
|
|
73
|
-
return new ProtocolContractLeafPreimage(
|
|
74
|
-
Fr.random(),
|
|
75
|
-
Fr.random(),
|
|
76
|
-
BigInt(Math.floor(Math.random() * 1000) % MAX_PROTOCOL_CONTRACTS),
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
static empty(): ProtocolContractLeafPreimage {
|
|
81
|
-
return new ProtocolContractLeafPreimage(Fr.ZERO, Fr.ZERO, 0n);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
static fromBuffer(buffer: Buffer | BufferReader): ProtocolContractLeafPreimage {
|
|
85
|
-
const reader = BufferReader.asReader(buffer);
|
|
86
|
-
return new ProtocolContractLeafPreimage(
|
|
87
|
-
reader.readObject(Fr),
|
|
88
|
-
reader.readObject(Fr),
|
|
89
|
-
toBigIntBE(reader.readBytes(32)),
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* An address to be inserted or checked in the protocol contract tree.
|
|
96
|
-
*/
|
|
97
|
-
export class ProtocolContractLeaf implements IndexedTreeLeaf {
|
|
98
|
-
constructor(
|
|
99
|
-
/**
|
|
100
|
-
* Address value.
|
|
101
|
-
*/
|
|
102
|
-
public address: Fr,
|
|
103
|
-
) {}
|
|
104
|
-
|
|
105
|
-
getKey(): bigint {
|
|
106
|
-
return this.address.toBigInt();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
toBuffer(): Buffer {
|
|
110
|
-
return this.address.toBuffer();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
isEmpty(): boolean {
|
|
114
|
-
return this.address.isZero();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
updateTo(_another: ProtocolContractLeaf): ProtocolContractLeaf {
|
|
118
|
-
throw new Error('Protocol contract tree is insert only');
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
static buildDummy(key: bigint): ProtocolContractLeaf {
|
|
122
|
-
return new ProtocolContractLeaf(new Fr(key));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
static fromBuffer(buf: Buffer): ProtocolContractLeaf {
|
|
126
|
-
return new ProtocolContractLeaf(Fr.fromBuffer(buf));
|
|
127
|
-
}
|
|
128
|
-
}
|