@aztec/stdlib 0.87.2 → 0.87.3-nightly.20250528
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/abi/abi.d.ts +3 -0
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +38 -0
- package/dest/avm/avm.d.ts +696 -12
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +16 -8
- package/dest/avm/avm_accumulated_data.d.ts +77 -0
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +67 -0
- package/dest/avm/avm_circuit_public_inputs.d.ts +73 -3
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +19 -9
- package/dest/avm/avm_proving_request.d.ts +366 -0
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/body.d.ts +1 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +2 -2
- package/dest/block/index.d.ts +1 -0
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- package/dest/block/l2_block.d.ts +1 -1
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +2 -2
- package/dest/block/l2_block_source.d.ts +9 -4
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +1 -0
- package/dest/block/proposal/committee_attestation.d.ts +34 -0
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -0
- package/dest/block/proposal/committee_attestation.js +59 -0
- package/dest/block/proposal/index.d.ts +2 -0
- package/dest/block/proposal/index.d.ts.map +1 -0
- package/dest/block/proposal/index.js +1 -0
- package/dest/block/published_l2_block.d.ts +99 -69
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +38 -12
- package/dest/block/test/l2_tips_store_test_suite.js +1 -1
- package/dest/interfaces/archiver.js +2 -2
- package/dest/interfaces/aztec-node.js +2 -2
- package/dest/interfaces/prover-agent.d.ts +31 -6
- package/dest/interfaces/prover-agent.d.ts.map +1 -1
- package/dest/interfaces/prover-agent.js +15 -6
- package/dest/interfaces/proving-job.d.ts +370 -4
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +2 -2
- package/dest/interfaces/server_circuit_prover.d.ts +3 -2
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/kernel/index.d.ts +1 -0
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +1 -0
- package/dest/kernel/padded_side_effects.d.ts +26 -0
- package/dest/kernel/padded_side_effects.d.ts.map +1 -0
- package/dest/kernel/padded_side_effects.js +51 -0
- package/dest/kernel/private_kernel_data.d.ts +6 -25
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.js +8 -19
- package/dest/kernel/private_kernel_prover_output.d.ts +3 -0
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +5 -2
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.js +9 -5
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +10 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +8 -3
- package/dest/kernel/public_call_request.d.ts +54 -0
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +58 -0
- package/dest/logs/pending_tagged_log.d.ts +1 -1
- package/dest/logs/pending_tagged_log.js +1 -1
- package/dest/rollup/avm_proof_data.d.ts +7 -5
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.js +12 -4
- package/dest/rollup/previous_rollup_block_data.d.ts +6 -15
- package/dest/rollup/previous_rollup_block_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_block_data.js +8 -13
- package/dest/rollup/previous_rollup_data.d.ts +6 -15
- package/dest/rollup/previous_rollup_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_data.js +8 -13
- package/dest/rollup/private_tube_data.d.ts +3 -3
- package/dest/rollup/private_tube_data.d.ts.map +1 -1
- package/dest/rollup/private_tube_data.js +3 -3
- package/dest/rollup/public_tube_data.d.ts +3 -3
- package/dest/rollup/public_tube_data.d.ts.map +1 -1
- package/dest/rollup/public_tube_data.js +3 -3
- package/dest/rollup/root_rollup.d.ts +9 -10
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- package/dest/rollup/root_rollup.js +9 -20
- package/dest/tests/factories.d.ts +2 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +21 -15
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +4 -3
- package/dest/tx/private_execution_result.d.ts +6 -0
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/profiling.d.ts +41 -0
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +4 -1
- package/dest/tx/proven_tx.d.ts +40 -18
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +2 -2
- package/dest/tx/tx_effect.d.ts +1 -1
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +2 -2
- package/dest/validators/types.d.ts +4 -0
- package/dest/validators/types.d.ts.map +1 -1
- package/dest/vks/index.d.ts +1 -1
- package/dest/vks/index.d.ts.map +1 -1
- package/dest/vks/index.js +1 -1
- package/dest/vks/{vk_witness_data.d.ts → vk_data.d.ts} +8 -8
- package/dest/vks/vk_data.d.ts.map +1 -0
- package/dest/vks/{vk_witness_data.js → vk_data.js} +10 -10
- package/package.json +7 -7
- package/src/abi/abi.ts +37 -0
- package/src/avm/avm.ts +14 -0
- package/src/avm/avm_accumulated_data.ts +93 -0
- package/src/avm/avm_circuit_public_inputs.ts +22 -2
- package/src/block/body.ts +7 -2
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +2 -1
- package/src/block/l2_block_source.ts +9 -3
- package/src/block/proposal/committee_attestation.ts +70 -0
- package/src/block/proposal/index.ts +1 -0
- package/src/block/published_l2_block.ts +38 -24
- package/src/block/test/l2_tips_store_test_suite.ts +1 -1
- package/src/interfaces/archiver.ts +2 -2
- package/src/interfaces/aztec-node.ts +2 -2
- package/src/interfaces/prover-agent.ts +9 -10
- package/src/interfaces/proving-job.ts +3 -3
- package/src/interfaces/server_circuit_prover.ts +3 -2
- package/src/kernel/index.ts +1 -0
- package/src/kernel/padded_side_effects.ts +73 -0
- package/src/kernel/private_kernel_data.ts +7 -29
- package/src/kernel/private_kernel_prover_output.ts +1 -0
- package/src/kernel/private_kernel_reset_circuit_private_inputs.ts +6 -3
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +10 -2
- package/src/kernel/public_call_request.ts +66 -0
- package/src/logs/pending_tagged_log.ts +1 -1
- package/src/rollup/avm_proof_data.ts +14 -7
- package/src/rollup/previous_rollup_block_data.ts +6 -12
- package/src/rollup/previous_rollup_data.ts +6 -12
- package/src/rollup/private_tube_data.ts +4 -4
- package/src/rollup/public_tube_data.ts +4 -4
- package/src/rollup/root_rollup.ts +6 -19
- package/src/tests/factories.ts +32 -20
- package/src/tests/mocks.ts +6 -3
- package/src/tx/private_execution_result.ts +1 -1
- package/src/tx/profiling.ts +6 -1
- package/src/tx/proven_tx.ts +2 -2
- package/src/tx/tx_effect.ts +23 -5
- package/src/validators/types.ts +2 -0
- package/src/vks/index.ts +1 -1
- package/src/vks/{vk_witness_data.ts → vk_data.ts} +6 -6
- package/dest/vks/vk_witness_data.d.ts.map +0 -1
package/dest/block/l2_block.js
CHANGED
|
@@ -60,8 +60,8 @@ import { makeAppendOnlyTreeSnapshot, makeHeader } from './l2_block_code_to_purge
|
|
|
60
60
|
* @param numPublicLogsPerCall - The number of public logs per 1 public function invocation.
|
|
61
61
|
* @param inHash - The hash of the L1 to L2 messages subtree which got inserted in this block.
|
|
62
62
|
* @returns The L2 block.
|
|
63
|
-
*/ static async random(l2BlockNum, txsPerBlock = 4, numPublicCallsPerTx = 3, numPublicLogsPerCall = 1, inHash = undefined, slotNumber = undefined) {
|
|
64
|
-
const body = await Body.random(txsPerBlock, numPublicCallsPerTx, numPublicLogsPerCall);
|
|
63
|
+
*/ static async random(l2BlockNum, txsPerBlock = 4, numPublicCallsPerTx = 3, numPublicLogsPerCall = 1, inHash = undefined, slotNumber = undefined, maxEffects = undefined) {
|
|
64
|
+
const body = await Body.random(txsPerBlock, numPublicCallsPerTx, numPublicLogsPerCall, maxEffects);
|
|
65
65
|
return new L2Block(makeAppendOnlyTreeSnapshot(l2BlockNum + 1), makeHeader(0, txsPerBlock, l2BlockNum, slotNumber ?? l2BlockNum, inHash), body);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TypedEventEmitter } from '@aztec/foundation/types';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import type { L1RollupConstants } from '../epoch-helpers/index.js';
|
|
5
5
|
import type { BlockHeader } from '../tx/block_header.js';
|
|
@@ -106,7 +106,11 @@ export interface L2BlockSource {
|
|
|
106
106
|
* L2BlockSource that emits events upon pending / proven chain changes.
|
|
107
107
|
* see L2BlockSourceEvents for the events emitted.
|
|
108
108
|
*/
|
|
109
|
-
export
|
|
109
|
+
export type ArchiverEmitter = TypedEventEmitter<{
|
|
110
|
+
[L2BlockSourceEvents.L2PruneDetected]: (args: L2BlockSourceEvent) => void;
|
|
111
|
+
[L2BlockSourceEvents.L2BlockProven]: (args: L2BlockSourceEvent) => void;
|
|
112
|
+
}>;
|
|
113
|
+
export interface L2BlockSourceEventEmitter extends L2BlockSource, ArchiverEmitter {
|
|
110
114
|
}
|
|
111
115
|
/**
|
|
112
116
|
* Identifier for L2 block tags.
|
|
@@ -244,10 +248,11 @@ export declare const L2TipsSchema: z.ZodObject<{
|
|
|
244
248
|
};
|
|
245
249
|
}>;
|
|
246
250
|
export declare enum L2BlockSourceEvents {
|
|
247
|
-
L2PruneDetected = "l2PruneDetected"
|
|
251
|
+
L2PruneDetected = "l2PruneDetected",
|
|
252
|
+
L2BlockProven = "l2BlockProven"
|
|
248
253
|
}
|
|
249
254
|
export type L2BlockSourceEvent = {
|
|
250
|
-
type: 'l2PruneDetected';
|
|
255
|
+
type: 'l2PruneDetected' | 'l2BlockProven';
|
|
251
256
|
blockNumber: bigint;
|
|
252
257
|
slotNumber: bigint;
|
|
253
258
|
epochNumber: bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_block_source.d.ts","sourceRoot":"","sources":["../../src/block/l2_block_source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"l2_block_source.d.ts","sourceRoot":"","sources":["../../src/block/l2_block_source.ts"],"names":[],"mappings":"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"}
|
|
@@ -26,5 +26,6 @@ export const L2TipsSchema = z.object({
|
|
|
26
26
|
});
|
|
27
27
|
export var L2BlockSourceEvents = /*#__PURE__*/ function(L2BlockSourceEvents) {
|
|
28
28
|
L2BlockSourceEvents["L2PruneDetected"] = "l2PruneDetected";
|
|
29
|
+
L2BlockSourceEvents["L2BlockProven"] = "l2BlockProven";
|
|
29
30
|
return L2BlockSourceEvents;
|
|
30
31
|
}({});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ViemCommitteeAttestation } from '@aztec/ethereum';
|
|
2
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export { Signature };
|
|
6
|
+
export { EthAddress };
|
|
7
|
+
export declare class CommitteeAttestation {
|
|
8
|
+
readonly address: EthAddress;
|
|
9
|
+
readonly signature: Signature;
|
|
10
|
+
constructor(address: EthAddress, signature: Signature);
|
|
11
|
+
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
12
|
+
address: z.ZodType<EthAddress, any, string>;
|
|
13
|
+
signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, Signature, string>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
address: EthAddress;
|
|
16
|
+
signature: Signature;
|
|
17
|
+
}, {
|
|
18
|
+
address: string;
|
|
19
|
+
signature: string;
|
|
20
|
+
}>, CommitteeAttestation, {
|
|
21
|
+
address: string;
|
|
22
|
+
signature: string;
|
|
23
|
+
}>;
|
|
24
|
+
static fromAddress(address: EthAddress): CommitteeAttestation;
|
|
25
|
+
static fromAddressAndSignature(address: EthAddress, signature: Signature): CommitteeAttestation;
|
|
26
|
+
static fromViem(viem: ViemCommitteeAttestation): CommitteeAttestation;
|
|
27
|
+
static fromBuffer(buffer: Buffer): CommitteeAttestation;
|
|
28
|
+
static random(): CommitteeAttestation;
|
|
29
|
+
static empty(): CommitteeAttestation;
|
|
30
|
+
toBuffer(): Buffer;
|
|
31
|
+
equals(other: CommitteeAttestation): boolean;
|
|
32
|
+
toViem(): ViemCommitteeAttestation;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=committee_attestation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"committee_attestation.d.ts","sourceRoot":"","sources":["../../../src/block/proposal/committee_attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAG5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,qBAAa,oBAAoB;aAEb,OAAO,EAAE,UAAU;aACnB,SAAS,EAAE,SAAS;gBADpB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,SAAS;IAGtC,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;IAGD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,oBAAoB;IAK7D,MAAM,CAAC,uBAAuB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,oBAAoB;IAI/F,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG,oBAAoB;IAIrE,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB;IAOvD,MAAM,CAAC,MAAM,IAAI,oBAAoB;IAKrC,MAAM,CAAC,KAAK,IAAI,oBAAoB;IAIpC,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAI5C,MAAM,IAAI,wBAAwB;CAMnC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export { Signature };
|
|
6
|
+
export { EthAddress };
|
|
7
|
+
export class CommitteeAttestation {
|
|
8
|
+
address;
|
|
9
|
+
signature;
|
|
10
|
+
constructor(address, signature){
|
|
11
|
+
this.address = address;
|
|
12
|
+
this.signature = signature;
|
|
13
|
+
}
|
|
14
|
+
static get schema() {
|
|
15
|
+
return z.object({
|
|
16
|
+
address: EthAddress.schema,
|
|
17
|
+
signature: Signature.schema
|
|
18
|
+
}).transform(({ address, signature })=>new CommitteeAttestation(address, signature));
|
|
19
|
+
}
|
|
20
|
+
// Create an empty attestation for an address that has not signed
|
|
21
|
+
static fromAddress(address) {
|
|
22
|
+
return new CommitteeAttestation(address, Signature.empty());
|
|
23
|
+
}
|
|
24
|
+
// Create an attestation from an address and a signature
|
|
25
|
+
static fromAddressAndSignature(address, signature) {
|
|
26
|
+
return new CommitteeAttestation(address, signature);
|
|
27
|
+
}
|
|
28
|
+
static fromViem(viem) {
|
|
29
|
+
return new CommitteeAttestation(EthAddress.fromString(viem.addr), Signature.fromViemSignature(viem.signature));
|
|
30
|
+
}
|
|
31
|
+
static fromBuffer(buffer) {
|
|
32
|
+
const reader = BufferReader.asReader(buffer);
|
|
33
|
+
const address = reader.readObject(EthAddress);
|
|
34
|
+
const signature = reader.readObject(Signature);
|
|
35
|
+
return new CommitteeAttestation(address, signature);
|
|
36
|
+
}
|
|
37
|
+
static random() {
|
|
38
|
+
// note: will be invalid
|
|
39
|
+
return new CommitteeAttestation(EthAddress.random(), Signature.random());
|
|
40
|
+
}
|
|
41
|
+
static empty() {
|
|
42
|
+
return new CommitteeAttestation(EthAddress.ZERO, Signature.empty());
|
|
43
|
+
}
|
|
44
|
+
toBuffer() {
|
|
45
|
+
return serializeToBuffer([
|
|
46
|
+
this.address,
|
|
47
|
+
this.signature
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
equals(other) {
|
|
51
|
+
return this.address.equals(other.address) && this.signature.equals(other.signature);
|
|
52
|
+
}
|
|
53
|
+
toViem() {
|
|
54
|
+
return {
|
|
55
|
+
addr: this.address.toString(),
|
|
56
|
+
signature: this.signature.toViemSignature()
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/block/proposal/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './committee_attestation.js';
|
|
@@ -1,54 +1,13 @@
|
|
|
1
|
-
import { Signature } from '@aztec/foundation/eth-signature';
|
|
2
|
-
import { L2Block } from '@aztec/stdlib/block';
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
5
|
-
|
|
3
|
+
import { L2Block } from './l2_block.js';
|
|
4
|
+
import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
5
|
+
export declare class L1PublishedData {
|
|
6
6
|
blockNumber: bigint;
|
|
7
7
|
timestamp: bigint;
|
|
8
8
|
blockHash: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
block: L2Block;
|
|
12
|
-
l1: L1PublishedData;
|
|
13
|
-
signatures: Signature[];
|
|
14
|
-
};
|
|
15
|
-
export declare const PublishedL2BlockSchema: z.ZodObject<{
|
|
16
|
-
block: z.ZodEffects<z.ZodObject<{
|
|
17
|
-
archive: z.ZodEffects<z.ZodObject<{
|
|
18
|
-
root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
|
|
19
|
-
nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
root: import("@aztec/foundation/schemas").Fr;
|
|
22
|
-
nextAvailableLeafIndex: number;
|
|
23
|
-
}, {
|
|
24
|
-
root: string;
|
|
25
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
26
|
-
}>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
|
|
27
|
-
root: string;
|
|
28
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
29
|
-
}>;
|
|
30
|
-
header: import("@aztec/foundation/schemas").ZodFor<import("../tx/block_header.js").BlockHeader>;
|
|
31
|
-
body: import("@aztec/foundation/schemas").ZodFor<import("@aztec/stdlib/block").Body>;
|
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
34
|
-
header: import("../tx/block_header.js").BlockHeader;
|
|
35
|
-
body: import("@aztec/stdlib/block").Body;
|
|
36
|
-
}, {
|
|
37
|
-
archive: {
|
|
38
|
-
root: string;
|
|
39
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
40
|
-
};
|
|
41
|
-
header?: any;
|
|
42
|
-
body?: any;
|
|
43
|
-
}>, L2Block, {
|
|
44
|
-
archive: {
|
|
45
|
-
root: string;
|
|
46
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
47
|
-
};
|
|
48
|
-
header?: any;
|
|
49
|
-
body?: any;
|
|
50
|
-
}>;
|
|
51
|
-
l1: z.ZodObject<{
|
|
9
|
+
constructor(blockNumber: bigint, timestamp: bigint, blockHash: string);
|
|
10
|
+
static get schema(): z.ZodObject<{
|
|
52
11
|
blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
53
12
|
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
54
13
|
blockHash: z.ZodString;
|
|
@@ -61,30 +20,101 @@ export declare const PublishedL2BlockSchema: z.ZodObject<{
|
|
|
61
20
|
timestamp: string | number | bigint;
|
|
62
21
|
blockHash: string;
|
|
63
22
|
}>;
|
|
64
|
-
|
|
65
|
-
|
|
23
|
+
}
|
|
24
|
+
export declare class PublishedL2Block {
|
|
66
25
|
block: L2Block;
|
|
67
|
-
l1:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
26
|
+
l1: L1PublishedData;
|
|
27
|
+
attestations: CommitteeAttestation[];
|
|
28
|
+
constructor(block: L2Block, l1: L1PublishedData, attestations: CommitteeAttestation[]);
|
|
29
|
+
static get schema(): z.ZodObject<{
|
|
30
|
+
block: z.ZodEffects<z.ZodObject<{
|
|
31
|
+
archive: z.ZodEffects<z.ZodObject<{
|
|
32
|
+
root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
|
|
33
|
+
nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
root: import("@aztec/foundation/schemas").Fr;
|
|
36
|
+
nextAvailableLeafIndex: number;
|
|
37
|
+
}, {
|
|
38
|
+
root: string;
|
|
39
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
40
|
+
}>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
|
|
41
|
+
root: string;
|
|
42
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
43
|
+
}>;
|
|
44
|
+
header: import("@aztec/foundation/schemas").ZodFor<import("../tx/block_header.js").BlockHeader>;
|
|
45
|
+
body: import("@aztec/foundation/schemas").ZodFor<import("./body.js").Body>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
48
|
+
header: import("../tx/block_header.js").BlockHeader;
|
|
49
|
+
body: import("./body.js").Body;
|
|
50
|
+
}, {
|
|
51
|
+
archive: {
|
|
52
|
+
root: string;
|
|
53
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
54
|
+
};
|
|
55
|
+
header?: any;
|
|
56
|
+
body?: any;
|
|
57
|
+
}>, L2Block, {
|
|
58
|
+
archive: {
|
|
59
|
+
root: string;
|
|
60
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
61
|
+
};
|
|
62
|
+
header?: any;
|
|
63
|
+
body?: any;
|
|
64
|
+
}>;
|
|
65
|
+
l1: z.ZodObject<{
|
|
66
|
+
blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
67
|
+
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
68
|
+
blockHash: z.ZodString;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
blockNumber: bigint;
|
|
71
|
+
timestamp: bigint;
|
|
72
|
+
blockHash: string;
|
|
73
|
+
}, {
|
|
74
|
+
blockNumber: string | number | bigint;
|
|
75
|
+
timestamp: string | number | bigint;
|
|
76
|
+
blockHash: string;
|
|
77
|
+
}>;
|
|
78
|
+
attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
79
|
+
address: z.ZodType<import("@aztec/foundation/schemas").EthAddress, any, string>;
|
|
80
|
+
signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./proposal/committee_attestation.js").Signature, string>;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
address: import("@aztec/foundation/schemas").EthAddress;
|
|
83
|
+
signature: import("./proposal/committee_attestation.js").Signature;
|
|
84
|
+
}, {
|
|
85
|
+
address: string;
|
|
86
|
+
signature: string;
|
|
87
|
+
}>, CommitteeAttestation, {
|
|
88
|
+
address: string;
|
|
89
|
+
signature: string;
|
|
90
|
+
}>, "many">;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
block: L2Block;
|
|
93
|
+
l1: {
|
|
94
|
+
blockNumber: bigint;
|
|
95
|
+
timestamp: bigint;
|
|
96
|
+
blockHash: string;
|
|
78
97
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
98
|
+
attestations: CommitteeAttestation[];
|
|
99
|
+
}, {
|
|
100
|
+
block: {
|
|
101
|
+
archive: {
|
|
102
|
+
root: string;
|
|
103
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
104
|
+
};
|
|
105
|
+
header?: any;
|
|
106
|
+
body?: any;
|
|
107
|
+
};
|
|
108
|
+
l1: {
|
|
109
|
+
blockNumber: string | number | bigint;
|
|
110
|
+
timestamp: string | number | bigint;
|
|
111
|
+
blockHash: string;
|
|
112
|
+
};
|
|
113
|
+
attestations: {
|
|
114
|
+
address: string;
|
|
115
|
+
signature: string;
|
|
116
|
+
}[];
|
|
117
|
+
}>;
|
|
118
|
+
}
|
|
89
119
|
export declare function getAttestationsFromPublishedL2Block(block: PublishedL2Block): BlockAttestation[];
|
|
90
120
|
//# sourceMappingURL=published_l2_block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"published_l2_block.d.ts","sourceRoot":"","sources":["../../src/block/published_l2_block.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"published_l2_block.d.ts","sourceRoot":"","sources":["../../src/block/published_l2_block.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,qBAAa,eAAe;IAEjB,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;gBAFjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM;IAG1B,MAAM,KAAK,MAAM;;;;;;;;;;;;OAMhB;CACF;AAED,qBAAa,gBAAgB;IAElB,KAAK,EAAE,OAAO;IACd,EAAE,EAAE,eAAe;IACnB,YAAY,EAAE,oBAAoB,EAAE;gBAFpC,KAAK,EAAE,OAAO,EACd,EAAE,EAAE,eAAe,EACnB,YAAY,EAAE,oBAAoB,EAAE;IAG7C,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAMhB;CACF;AAED,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,gBAAgB,sBAQ1E"}
|
|
@@ -1,19 +1,45 @@
|
|
|
1
|
-
import
|
|
1
|
+
// Ignoring import issue to fix portable inferred type issue in zod schema
|
|
2
2
|
import { schemas } from '@aztec/foundation/schemas';
|
|
3
|
-
import { L2Block } from '@aztec/stdlib/block';
|
|
4
3
|
import { z } from 'zod';
|
|
5
4
|
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
6
5
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
import { L2Block } from './l2_block.js';
|
|
7
|
+
import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
8
|
+
export class L1PublishedData {
|
|
9
|
+
blockNumber;
|
|
10
|
+
timestamp;
|
|
11
|
+
blockHash;
|
|
12
|
+
constructor(blockNumber, timestamp, blockHash){
|
|
13
|
+
this.blockNumber = blockNumber;
|
|
14
|
+
this.timestamp = timestamp;
|
|
15
|
+
this.blockHash = blockHash;
|
|
16
|
+
}
|
|
17
|
+
static get schema() {
|
|
18
|
+
return z.object({
|
|
19
|
+
blockNumber: schemas.BigInt,
|
|
20
|
+
timestamp: schemas.BigInt,
|
|
21
|
+
blockHash: z.string()
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export class PublishedL2Block {
|
|
26
|
+
block;
|
|
27
|
+
l1;
|
|
28
|
+
attestations;
|
|
29
|
+
constructor(block, l1, attestations){
|
|
30
|
+
this.block = block;
|
|
31
|
+
this.l1 = l1;
|
|
32
|
+
this.attestations = attestations;
|
|
33
|
+
}
|
|
34
|
+
static get schema() {
|
|
35
|
+
return z.object({
|
|
36
|
+
block: L2Block.schema,
|
|
37
|
+
l1: L1PublishedData.schema,
|
|
38
|
+
attestations: z.array(CommitteeAttestation.schema)
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
16
42
|
export function getAttestationsFromPublishedL2Block(block) {
|
|
17
43
|
const payload = ConsensusPayload.fromBlock(block.block);
|
|
18
|
-
return block.
|
|
44
|
+
return block.attestations.filter((attestation)=>!attestation.signature.isEmpty()).map((attestation)=>new BlockAttestation(block.block.header.globalVariables.blockNumber, payload, attestation.signature));
|
|
19
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { L2Block } from '../block/l2_block.js';
|
|
3
3
|
import { L2TipsSchema } from '../block/l2_block_source.js';
|
|
4
|
-
import {
|
|
4
|
+
import { PublishedL2Block } from '../block/published_l2_block.js';
|
|
5
5
|
import { ContractClassPublicSchema, ContractInstanceWithAddressSchema } from '../contract/index.js';
|
|
6
6
|
import { L1RollupConstantsSchema } from '../epoch-helpers/index.js';
|
|
7
7
|
import { LogFilterSchema } from '../logs/log_filter.js';
|
|
@@ -24,7 +24,7 @@ export const ArchiverApiSchema = {
|
|
|
24
24
|
z.literal('latest')
|
|
25
25
|
])).returns(BlockHeader.schema.optional()),
|
|
26
26
|
getBlocks: z.function().args(schemas.Integer, schemas.Integer, optional(z.boolean())).returns(z.array(L2Block.schema)),
|
|
27
|
-
getPublishedBlocks: z.function().args(schemas.Integer, schemas.Integer, optional(z.boolean())).returns(z.array(
|
|
27
|
+
getPublishedBlocks: z.function().args(schemas.Integer, schemas.Integer, optional(z.boolean())).returns(z.array(PublishedL2Block.schema)),
|
|
28
28
|
getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
|
|
29
29
|
getSettledTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema.optional()),
|
|
30
30
|
getL2SlotNumber: z.function().args().returns(schemas.BigInt),
|
|
@@ -7,7 +7,7 @@ import { inBlockSchemaFor } from '../block/in_block.js';
|
|
|
7
7
|
import { L2Block } from '../block/l2_block.js';
|
|
8
8
|
import { L2BlockNumberSchema } from '../block/l2_block_number.js';
|
|
9
9
|
import { L2TipsSchema } from '../block/l2_block_source.js';
|
|
10
|
-
import {
|
|
10
|
+
import { PublishedL2Block } from '../block/published_l2_block.js';
|
|
11
11
|
import { ContractClassPublicSchema, ContractInstanceWithAddressSchema, NodeInfoSchema, ProtocolContractAddressesSchema } from '../contract/index.js';
|
|
12
12
|
import { GasFees } from '../gas/gas_fees.js';
|
|
13
13
|
import { LogFilterSchema } from '../logs/log_filter.js';
|
|
@@ -48,7 +48,7 @@ export const AztecNodeApiSchema = {
|
|
|
48
48
|
isReady: z.function().returns(z.boolean()),
|
|
49
49
|
getNodeInfo: z.function().returns(NodeInfoSchema),
|
|
50
50
|
getBlocks: z.function().args(z.number(), z.number()).returns(z.array(L2Block.schema)),
|
|
51
|
-
getPublishedBlocks: z.function().args(z.number(), z.number()).returns(z.array(
|
|
51
|
+
getPublishedBlocks: z.function().args(z.number(), z.number()).returns(z.array(PublishedL2Block.schema)),
|
|
52
52
|
getCurrentBaseFees: z.function().returns(GasFees.schema),
|
|
53
53
|
getNodeVersion: z.function().returns(z.string()),
|
|
54
54
|
getVersion: z.function().returns(z.number()),
|
|
@@ -1,11 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import type { ApiSchemaFor } from '../schemas/index.js';
|
|
3
|
+
export declare const ProverAgentStatusSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
4
|
+
status: z.ZodLiteral<"stopped">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
status: "stopped";
|
|
7
|
+
}, {
|
|
8
|
+
status: "stopped";
|
|
9
|
+
}>, z.ZodObject<{
|
|
10
|
+
status: z.ZodLiteral<"running">;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
status: "running";
|
|
13
|
+
}, {
|
|
14
|
+
status: "running";
|
|
15
|
+
}>, z.ZodObject<{
|
|
16
|
+
status: z.ZodLiteral<"proving">;
|
|
17
|
+
jobId: z.ZodString;
|
|
18
|
+
proofType: z.ZodNumber;
|
|
19
|
+
startedAtISO: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
status: "proving";
|
|
22
|
+
jobId: string;
|
|
23
|
+
proofType: number;
|
|
24
|
+
startedAtISO: string;
|
|
25
|
+
}, {
|
|
26
|
+
status: "proving";
|
|
27
|
+
jobId: string;
|
|
28
|
+
proofType: number;
|
|
29
|
+
startedAtISO: string;
|
|
30
|
+
}>]>;
|
|
31
|
+
export type ProverAgentStatus = z.infer<typeof ProverAgentStatusSchema>;
|
|
2
32
|
export interface ProverAgentApi {
|
|
3
|
-
|
|
4
|
-
isRunning(): Promise<boolean>;
|
|
5
|
-
getCurrentJobs(): Promise<{
|
|
6
|
-
id: string;
|
|
7
|
-
type: string;
|
|
8
|
-
}[]>;
|
|
33
|
+
getStatus(): Promise<unknown>;
|
|
9
34
|
}
|
|
10
35
|
export declare const ProverAgentApiSchema: ApiSchemaFor<ProverAgentApi>;
|
|
11
36
|
//# sourceMappingURL=prover-agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prover-agent.d.ts","sourceRoot":"","sources":["../../src/interfaces/prover-agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prover-agent.d.ts","sourceRoot":"","sources":["../../src/interfaces/prover-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,MAAM,WAAW,cAAc;IAC7B,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,cAAc,CAE7D,CAAC"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export const ProverAgentStatusSchema = z.discriminatedUnion('status', [
|
|
3
|
+
z.object({
|
|
4
|
+
status: z.literal('stopped')
|
|
5
|
+
}),
|
|
6
|
+
z.object({
|
|
7
|
+
status: z.literal('running')
|
|
8
|
+
}),
|
|
9
|
+
z.object({
|
|
10
|
+
status: z.literal('proving'),
|
|
11
|
+
jobId: z.string(),
|
|
12
|
+
proofType: z.number(),
|
|
13
|
+
startedAtISO: z.string()
|
|
14
|
+
})
|
|
15
|
+
]);
|
|
2
16
|
export const ProverAgentApiSchema = {
|
|
3
|
-
|
|
4
|
-
isRunning: z.function().args().returns(z.boolean()),
|
|
5
|
-
getCurrentJobs: z.function().args().returns(z.array(z.object({
|
|
6
|
-
id: z.string(),
|
|
7
|
-
type: z.string()
|
|
8
|
-
})))
|
|
17
|
+
getStatus: z.function().args().returns(ProverAgentStatusSchema)
|
|
9
18
|
};
|