@aztec/stdlib 3.0.0-nightly.20251022 → 3.0.0-nightly.20251024
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/contract/contract_address.d.ts +1 -1
- package/dest/contract/contract_address.js +1 -1
- package/dest/interfaces/aztec-node-admin.d.ts +36 -35
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +2 -2
- package/dest/interfaces/validator.d.ts +96 -1
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +7 -0
- package/dest/note/index.d.ts +1 -1
- package/dest/note/index.d.ts.map +1 -1
- package/dest/note/index.js +1 -1
- package/dest/note/unique_note.d.ts +43 -0
- package/dest/note/unique_note.d.ts.map +1 -0
- package/dest/note/{extended_note.js → unique_note.js} +9 -48
- package/dest/parity/parity_base_private_inputs.d.ts +2 -2
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_base_private_inputs.js +5 -1
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +3 -3
- package/dest/tests/mocks.d.ts +1 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +1 -4
- package/package.json +8 -8
- package/src/contract/contract_address.ts +1 -1
- package/src/interfaces/aztec-node-admin.ts +2 -2
- package/src/interfaces/validator.ts +15 -1
- package/src/note/index.ts +1 -1
- package/src/note/{extended_note.ts → unique_note.ts} +14 -75
- package/src/parity/parity_base_private_inputs.ts +8 -6
- package/src/tests/mocks.ts +1 -17
- package/dest/note/extended_note.d.ts +0 -111
- package/dest/note/extended_note.d.ts.map +0 -1
|
@@ -3,7 +3,7 @@ import { type FunctionAbi, FunctionSelector } from '../abi/index.js';
|
|
|
3
3
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
4
4
|
import type { ContractInstance } from './interfaces/contract_instance.js';
|
|
5
5
|
/**
|
|
6
|
-
* Returns the deployment address for a given contract instance
|
|
6
|
+
* Returns the deployment address for a given contract instance.
|
|
7
7
|
* ```
|
|
8
8
|
* salted_initialization_hash = pedersen([salt, initialization_hash, deployer], GENERATOR__SALTED_INITIALIZATION_HASH)
|
|
9
9
|
* partial_address = pedersen([contract_class_id, salted_initialization_hash], GENERATOR__CONTRACT_PARTIAL_ADDRESS_V1)
|
|
@@ -6,7 +6,7 @@ import { computeVarArgsHash } from '../hash/hash.js';
|
|
|
6
6
|
import { computeAddress } from '../keys/index.js';
|
|
7
7
|
// TODO(@spalladino): Review all generator indices in this file
|
|
8
8
|
/**
|
|
9
|
-
* Returns the deployment address for a given contract instance
|
|
9
|
+
* Returns the deployment address for a given contract instance.
|
|
10
10
|
* ```
|
|
11
11
|
* salted_initialization_hash = pedersen([salt, initialization_hash, deployer], GENERATOR__SALTED_INITIALIZATION_HASH)
|
|
12
12
|
* partial_address = pedersen([contract_class_id, salted_initialization_hash], GENERATOR__CONTRACT_PARTIAL_ADDRESS_V1)
|
|
@@ -55,37 +55,6 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
|
|
|
55
55
|
feeRecipient: z.ZodOptional<import("../schemas/schemas.js").ZodFor<import("../aztec-address/index.js").AztecAddress>>;
|
|
56
56
|
acvmWorkingDirectory: z.ZodOptional<z.ZodString>;
|
|
57
57
|
acvmBinaryPath: z.ZodOptional<z.ZodString>;
|
|
58
|
-
txPublicSetupAllowList: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
59
|
-
address: import("../schemas/schemas.js").ZodFor<import("../aztec-address/index.js").AztecAddress>;
|
|
60
|
-
selector: import("../schemas/schemas.js").ZodFor<import("../abi/function_selector.js").FunctionSelector>;
|
|
61
|
-
}, "strip", z.ZodTypeAny, {
|
|
62
|
-
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
63
|
-
address: import("../aztec-address/index.js").AztecAddress;
|
|
64
|
-
}, {
|
|
65
|
-
selector?: any;
|
|
66
|
-
address?: any;
|
|
67
|
-
}>, z.ZodObject<{
|
|
68
|
-
address: import("../schemas/schemas.js").ZodFor<import("../aztec-address/index.js").AztecAddress>;
|
|
69
|
-
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
address: import("../aztec-address/index.js").AztecAddress;
|
|
71
|
-
}, {
|
|
72
|
-
address?: any;
|
|
73
|
-
}>, z.ZodObject<{
|
|
74
|
-
classId: import("../schemas/schemas.js").ZodFor<import("@aztec/foundation/schemas").Fr>;
|
|
75
|
-
selector: import("../schemas/schemas.js").ZodFor<import("../abi/function_selector.js").FunctionSelector>;
|
|
76
|
-
}, "strip", z.ZodTypeAny, {
|
|
77
|
-
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
78
|
-
classId: import("@aztec/foundation/schemas").Fr;
|
|
79
|
-
}, {
|
|
80
|
-
selector?: any;
|
|
81
|
-
classId?: any;
|
|
82
|
-
}>, z.ZodObject<{
|
|
83
|
-
classId: import("../schemas/schemas.js").ZodFor<import("@aztec/foundation/schemas").Fr>;
|
|
84
|
-
}, "strip", z.ZodTypeAny, {
|
|
85
|
-
classId: import("@aztec/foundation/schemas").Fr;
|
|
86
|
-
}, {
|
|
87
|
-
classId?: any;
|
|
88
|
-
}>]>, "many">>;
|
|
89
58
|
maxBlockSizeInBytes: z.ZodOptional<z.ZodNumber>;
|
|
90
59
|
governanceProposerPayload: z.ZodOptional<import("../schemas/schemas.js").ZodFor<import("@aztec/foundation/schemas").EthAddress>>;
|
|
91
60
|
maxL1TxInclusionTimeIntoSlot: z.ZodOptional<z.ZodNumber>;
|
|
@@ -95,9 +64,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
|
|
|
95
64
|
skipCollectingAttestations: z.ZodOptional<z.ZodBoolean>;
|
|
96
65
|
secondsBeforeInvalidatingBlockAsCommitteeMember: z.ZodNumber;
|
|
97
66
|
secondsBeforeInvalidatingBlockAsNonCommitteeMember: z.ZodNumber;
|
|
98
|
-
broadcastInvalidBlockProposal: z.ZodOptional<z.ZodBoolean>;
|
|
99
67
|
injectFakeAttestation: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
-
} & {
|
|
101
68
|
nodeUrl: z.ZodOptional<z.ZodString>;
|
|
102
69
|
realProofs: z.ZodBoolean;
|
|
103
70
|
proverId: z.ZodOptional<import("../schemas/schemas.js").ZodFor<import("@aztec/foundation/schemas").EthAddress>>;
|
|
@@ -105,7 +72,6 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
|
|
|
105
72
|
proverTestDelayMs: z.ZodNumber;
|
|
106
73
|
proverTestDelayFactor: z.ZodNumber;
|
|
107
74
|
proverAgentCount: z.ZodNumber;
|
|
108
|
-
} & {
|
|
109
75
|
slashOverridePayload: z.ZodOptional<z.ZodType<import("@aztec/foundation/schemas").EthAddress, any, string>>;
|
|
110
76
|
slashMinPenaltyPercentage: z.ZodNumber;
|
|
111
77
|
slashMaxPenaltyPercentage: z.ZodNumber;
|
|
@@ -122,7 +88,6 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
|
|
|
122
88
|
slashOffenseExpirationRounds: z.ZodNumber;
|
|
123
89
|
slashMaxPayloadSize: z.ZodNumber;
|
|
124
90
|
slashGracePeriodL2Slots: z.ZodNumber;
|
|
125
|
-
slashBroadcastedInvalidBlockPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
126
91
|
slashExecuteRoundsLookBack: z.ZodNumber;
|
|
127
92
|
slashSelfAllowed: z.ZodOptional<z.ZodBoolean>;
|
|
128
93
|
} & {
|
|
@@ -133,6 +98,40 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
|
|
|
133
98
|
validatorReexecute: z.ZodBoolean;
|
|
134
99
|
validatorReexecuteDeadlineMs: z.ZodNumber;
|
|
135
100
|
alwaysReexecuteBlockProposals: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
txPublicSetupAllowList: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
102
|
+
address: import("../schemas/schemas.js").ZodFor<import("../aztec-address/index.js").AztecAddress>;
|
|
103
|
+
selector: import("../schemas/schemas.js").ZodFor<import("../abi/function_selector.js").FunctionSelector>;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
106
|
+
address: import("../aztec-address/index.js").AztecAddress;
|
|
107
|
+
}, {
|
|
108
|
+
selector?: any;
|
|
109
|
+
address?: any;
|
|
110
|
+
}>, z.ZodObject<{
|
|
111
|
+
address: import("../schemas/schemas.js").ZodFor<import("../aztec-address/index.js").AztecAddress>;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
address: import("../aztec-address/index.js").AztecAddress;
|
|
114
|
+
}, {
|
|
115
|
+
address?: any;
|
|
116
|
+
}>, z.ZodObject<{
|
|
117
|
+
classId: import("../schemas/schemas.js").ZodFor<import("@aztec/foundation/schemas").Fr>;
|
|
118
|
+
selector: import("../schemas/schemas.js").ZodFor<import("../abi/function_selector.js").FunctionSelector>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
121
|
+
classId: import("@aztec/foundation/schemas").Fr;
|
|
122
|
+
}, {
|
|
123
|
+
selector?: any;
|
|
124
|
+
classId?: any;
|
|
125
|
+
}>, z.ZodObject<{
|
|
126
|
+
classId: import("../schemas/schemas.js").ZodFor<import("@aztec/foundation/schemas").Fr>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
classId: import("@aztec/foundation/schemas").Fr;
|
|
129
|
+
}, {
|
|
130
|
+
classId?: any;
|
|
131
|
+
}>]>, "many">>;
|
|
132
|
+
broadcastInvalidBlockProposal: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
+
slashBroadcastedInvalidBlockPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
134
|
+
disableTransactions: z.ZodOptional<z.ZodBoolean>;
|
|
136
135
|
} & Pick<{
|
|
137
136
|
archiverPollingIntervalMS: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
|
|
138
137
|
archiverBatchSize: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
|
|
@@ -212,6 +211,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
|
|
|
212
211
|
nodeUrl?: string | undefined;
|
|
213
212
|
validatorAddresses?: import("@aztec/foundation/schemas").EthAddress[] | undefined;
|
|
214
213
|
alwaysReexecuteBlockProposals?: boolean | undefined;
|
|
214
|
+
disableTransactions?: boolean | undefined;
|
|
215
215
|
}, {
|
|
216
216
|
secondsBeforeInvalidatingBlockAsCommitteeMember: number;
|
|
217
217
|
secondsBeforeInvalidatingBlockAsNonCommitteeMember: number;
|
|
@@ -282,6 +282,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
|
|
|
282
282
|
nodeUrl?: string | undefined;
|
|
283
283
|
validatorAddresses?: string[] | undefined;
|
|
284
284
|
alwaysReexecuteBlockProposals?: boolean | undefined;
|
|
285
|
+
disableTransactions?: boolean | undefined;
|
|
285
286
|
}>;
|
|
286
287
|
export declare const AztecNodeAdminApiSchema: ApiSchemaFor<AztecNodeAdmin>;
|
|
287
288
|
export declare function createAztecNodeAdminClient(url: string, versions?: Partial<ComponentsVersions>, fetch?: typeof defaultFetch): AztecNodeAdmin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec-node-admin.d.ts","sourceRoot":"","sources":["../../src/interfaces/aztec-node-admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAE1F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,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CACxC,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,OAAO,CAAC,kBAAkB,CAAM,EAC1C,KAAK,sBAAe,GACnB,cAAc,CAMhB"}
|
|
@@ -6,8 +6,8 @@ import { ArchiverSpecificConfigSchema } from './archiver.js';
|
|
|
6
6
|
import { SequencerConfigSchema } from './configs.js';
|
|
7
7
|
import { ProverConfigSchema } from './prover-client.js';
|
|
8
8
|
import { SlasherConfigSchema } from './slasher.js';
|
|
9
|
-
import {
|
|
10
|
-
export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema).merge(SlasherConfigSchema).merge(
|
|
9
|
+
import { ValidatorClientFullConfigSchema } from './validator.js';
|
|
10
|
+
export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema).merge(SlasherConfigSchema).merge(ValidatorClientFullConfigSchema).merge(ArchiverSpecificConfigSchema.pick({
|
|
11
11
|
archiverPollingIntervalMS: true,
|
|
12
12
|
skipValidateBlockAttestations: true,
|
|
13
13
|
archiverBatchSize: true
|
|
@@ -2,6 +2,7 @@ import type { SecretValue } from '@aztec/foundation/config';
|
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import type { Signature } from '@aztec/foundation/eth-signature';
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
5
|
+
import { type ZodFor } from '@aztec/foundation/schemas';
|
|
5
6
|
import type { SequencerConfig, SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
6
7
|
import type { BlockAttestation, BlockProposal, BlockProposalOptions } from '@aztec/stdlib/p2p';
|
|
7
8
|
import type { StateReference, Tx } from '@aztec/stdlib/tx';
|
|
@@ -30,7 +31,13 @@ export interface ValidatorClientConfig {
|
|
|
30
31
|
/** Whether to always reexecute block proposals, even for non-validator nodes or when out of the currnet committee */
|
|
31
32
|
alwaysReexecuteBlockProposals?: boolean;
|
|
32
33
|
}
|
|
33
|
-
export type ValidatorClientFullConfig = ValidatorClientConfig & Pick<SequencerConfig, 'txPublicSetupAllowList' | 'broadcastInvalidBlockProposal'> & Pick<SlasherConfig, 'slashBroadcastedInvalidBlockPenalty'
|
|
34
|
+
export type ValidatorClientFullConfig = ValidatorClientConfig & Pick<SequencerConfig, 'txPublicSetupAllowList' | 'broadcastInvalidBlockProposal'> & Pick<SlasherConfig, 'slashBroadcastedInvalidBlockPenalty'> & {
|
|
35
|
+
/**
|
|
36
|
+
* Whether transactions are disabled for this node
|
|
37
|
+
* @remarks This should match the property in P2PConfig. It's not picked from there to avoid circular dependencies.
|
|
38
|
+
*/
|
|
39
|
+
disableTransactions?: boolean;
|
|
40
|
+
};
|
|
34
41
|
export declare const ValidatorClientConfigSchema: z.ZodObject<{
|
|
35
42
|
validatorAddresses: z.ZodOptional<z.ZodArray<z.ZodType<EthAddress, any, string>, "many">>;
|
|
36
43
|
disableValidator: z.ZodBoolean;
|
|
@@ -56,6 +63,94 @@ export declare const ValidatorClientConfigSchema: z.ZodObject<{
|
|
|
56
63
|
validatorAddresses?: string[] | undefined;
|
|
57
64
|
alwaysReexecuteBlockProposals?: boolean | undefined;
|
|
58
65
|
}>;
|
|
66
|
+
export declare const ValidatorClientFullConfigSchema: z.ZodObject<{
|
|
67
|
+
validatorAddresses: z.ZodOptional<z.ZodArray<z.ZodType<EthAddress, any, string>, "many">>;
|
|
68
|
+
disableValidator: z.ZodBoolean;
|
|
69
|
+
disabledValidators: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
|
|
70
|
+
attestationPollingIntervalMs: z.ZodNumber;
|
|
71
|
+
validatorReexecute: z.ZodBoolean;
|
|
72
|
+
validatorReexecuteDeadlineMs: z.ZodNumber;
|
|
73
|
+
alwaysReexecuteBlockProposals: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
} & {
|
|
75
|
+
txPublicSetupAllowList: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
76
|
+
address: ZodFor<import("../aztec-address/index.js").AztecAddress>;
|
|
77
|
+
selector: ZodFor<import("../abi/function_selector.js").FunctionSelector>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
80
|
+
address: import("../aztec-address/index.js").AztecAddress;
|
|
81
|
+
}, {
|
|
82
|
+
selector?: any;
|
|
83
|
+
address?: any;
|
|
84
|
+
}>, z.ZodObject<{
|
|
85
|
+
address: ZodFor<import("../aztec-address/index.js").AztecAddress>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
address: import("../aztec-address/index.js").AztecAddress;
|
|
88
|
+
}, {
|
|
89
|
+
address?: any;
|
|
90
|
+
}>, z.ZodObject<{
|
|
91
|
+
classId: ZodFor<Fr>;
|
|
92
|
+
selector: ZodFor<import("../abi/function_selector.js").FunctionSelector>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
95
|
+
classId: Fr;
|
|
96
|
+
}, {
|
|
97
|
+
selector?: any;
|
|
98
|
+
classId?: any;
|
|
99
|
+
}>, z.ZodObject<{
|
|
100
|
+
classId: ZodFor<Fr>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
classId: Fr;
|
|
103
|
+
}, {
|
|
104
|
+
classId?: any;
|
|
105
|
+
}>]>, "many">>;
|
|
106
|
+
broadcastInvalidBlockProposal: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
slashBroadcastedInvalidBlockPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
108
|
+
disableTransactions: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
slashBroadcastedInvalidBlockPenalty: bigint;
|
|
111
|
+
disableValidator: boolean;
|
|
112
|
+
disabledValidators: EthAddress[];
|
|
113
|
+
attestationPollingIntervalMs: number;
|
|
114
|
+
validatorReexecute: boolean;
|
|
115
|
+
validatorReexecuteDeadlineMs: number;
|
|
116
|
+
txPublicSetupAllowList?: ({
|
|
117
|
+
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
118
|
+
address: import("../aztec-address/index.js").AztecAddress;
|
|
119
|
+
} | {
|
|
120
|
+
address: import("../aztec-address/index.js").AztecAddress;
|
|
121
|
+
} | {
|
|
122
|
+
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
123
|
+
classId: Fr;
|
|
124
|
+
} | {
|
|
125
|
+
classId: Fr;
|
|
126
|
+
})[] | undefined;
|
|
127
|
+
broadcastInvalidBlockProposal?: boolean | undefined;
|
|
128
|
+
validatorAddresses?: EthAddress[] | undefined;
|
|
129
|
+
alwaysReexecuteBlockProposals?: boolean | undefined;
|
|
130
|
+
disableTransactions?: boolean | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
slashBroadcastedInvalidBlockPenalty: string | number | bigint;
|
|
133
|
+
disableValidator: boolean;
|
|
134
|
+
disabledValidators: string[];
|
|
135
|
+
attestationPollingIntervalMs: number;
|
|
136
|
+
validatorReexecute: boolean;
|
|
137
|
+
validatorReexecuteDeadlineMs: number;
|
|
138
|
+
txPublicSetupAllowList?: ({
|
|
139
|
+
selector?: any;
|
|
140
|
+
address?: any;
|
|
141
|
+
} | {
|
|
142
|
+
address?: any;
|
|
143
|
+
} | {
|
|
144
|
+
selector?: any;
|
|
145
|
+
classId?: any;
|
|
146
|
+
} | {
|
|
147
|
+
classId?: any;
|
|
148
|
+
})[] | undefined;
|
|
149
|
+
broadcastInvalidBlockProposal?: boolean | undefined;
|
|
150
|
+
validatorAddresses?: string[] | undefined;
|
|
151
|
+
alwaysReexecuteBlockProposals?: boolean | undefined;
|
|
152
|
+
disableTransactions?: boolean | undefined;
|
|
153
|
+
}>;
|
|
59
154
|
export interface Validator {
|
|
60
155
|
start(): Promise<void>;
|
|
61
156
|
updateConfig(config: Partial<ValidatorClientFullConfig>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/interfaces/validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/interfaces/validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGvE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,WAAW,CAAC,KAAK,MAAM,EAAE,EAAE,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,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,GAAG,SAAS,CAAC,CAAC;IAEnG,sBAAsB,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,mBAAmB,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC5G,0BAA0B,CACxB,sBAAsB,EAAE,+BAA+B,EACvD,QAAQ,EAAE,UAAU,GACnB,OAAO,CAAC,SAAS,CAAC,CAAC;CACvB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { schemas } from '@aztec/foundation/schemas';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { AllowedElementSchema } from './allowed_element.js';
|
|
3
4
|
export const ValidatorClientConfigSchema = z.object({
|
|
4
5
|
validatorAddresses: z.array(schemas.EthAddress).optional(),
|
|
5
6
|
disableValidator: z.boolean(),
|
|
@@ -9,3 +10,9 @@ export const ValidatorClientConfigSchema = z.object({
|
|
|
9
10
|
validatorReexecuteDeadlineMs: z.number().min(0),
|
|
10
11
|
alwaysReexecuteBlockProposals: z.boolean().optional()
|
|
11
12
|
});
|
|
13
|
+
export const ValidatorClientFullConfigSchema = ValidatorClientConfigSchema.extend({
|
|
14
|
+
txPublicSetupAllowList: z.array(AllowedElementSchema).optional(),
|
|
15
|
+
broadcastInvalidBlockProposal: z.boolean().optional(),
|
|
16
|
+
slashBroadcastedInvalidBlockPenalty: schemas.BigInt,
|
|
17
|
+
disableTransactions: z.boolean().optional()
|
|
18
|
+
});
|
package/dest/note/index.d.ts
CHANGED
package/dest/note/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/note/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/note/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC"}
|
package/dest/note/index.js
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
+
import { AztecAddress } from '../aztec-address/index.js';
|
|
4
|
+
import { type ZodFor } from '../schemas/index.js';
|
|
5
|
+
import { TxHash } from '../tx/tx_hash.js';
|
|
6
|
+
import { Note } from './note.js';
|
|
7
|
+
/**
|
|
8
|
+
* A note with contextual data and a nonce that makes it unique.
|
|
9
|
+
*/
|
|
10
|
+
export declare class UniqueNote {
|
|
11
|
+
/** The note as emitted from the Noir contract. */
|
|
12
|
+
note: Note;
|
|
13
|
+
/** The recipient whose public key was used to encrypt the note. */
|
|
14
|
+
recipient: AztecAddress;
|
|
15
|
+
/** The contract address this note is created in. */
|
|
16
|
+
contractAddress: AztecAddress;
|
|
17
|
+
/** The specific storage location of the note on the contract. */
|
|
18
|
+
storageSlot: Fr;
|
|
19
|
+
/** The hash of the tx the note was created in. */
|
|
20
|
+
txHash: TxHash;
|
|
21
|
+
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
22
|
+
noteNonce: Fr;
|
|
23
|
+
constructor(
|
|
24
|
+
/** The note as emitted from the Noir contract. */
|
|
25
|
+
note: Note,
|
|
26
|
+
/** The recipient whose public key was used to encrypt the note. */
|
|
27
|
+
recipient: AztecAddress,
|
|
28
|
+
/** The contract address this note is created in. */
|
|
29
|
+
contractAddress: AztecAddress,
|
|
30
|
+
/** The specific storage location of the note on the contract. */
|
|
31
|
+
storageSlot: Fr,
|
|
32
|
+
/** The hash of the tx the note was created in. */
|
|
33
|
+
txHash: TxHash,
|
|
34
|
+
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
35
|
+
noteNonce: Fr);
|
|
36
|
+
static get schema(): ZodFor<UniqueNote>;
|
|
37
|
+
toBuffer(): Buffer;
|
|
38
|
+
static random(): Promise<UniqueNote>;
|
|
39
|
+
static fromBuffer(buffer: Buffer | BufferReader): UniqueNote;
|
|
40
|
+
static fromString(str: string): UniqueNote;
|
|
41
|
+
toString(): `0x${string}`;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=unique_note.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unique_note.d.ts","sourceRoot":"","sources":["../../src/note/unique_note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAK9E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;GAEG;AACH,qBAAa,UAAU;IAEnB,kDAAkD;IAC3C,IAAI,EAAE,IAAI;IACjB,mEAAmE;IAC5D,SAAS,EAAE,YAAY;IAC9B,oDAAoD;IAC7C,eAAe,EAAE,YAAY;IACpC,iEAAiE;IAC1D,WAAW,EAAE,EAAE;IACtB,kDAAkD;IAC3C,MAAM,EAAE,MAAM;IACrB,gGAAgG;IACzF,SAAS,EAAE,EAAE;;IAXpB,kDAAkD;IAC3C,IAAI,EAAE,IAAI;IACjB,mEAAmE;IAC5D,SAAS,EAAE,YAAY;IAC9B,oDAAoD;IAC7C,eAAe,EAAE,YAAY;IACpC,iEAAiE;IAC1D,WAAW,EAAE,EAAE;IACtB,kDAAkD;IAC3C,MAAM,EAAE,MAAM;IACrB,gGAAgG;IACzF,SAAS,EAAE,EAAE;IAGtB,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,CAatC;IAED,QAAQ,IAAI,MAAM;WAWL,MAAM;IAWnB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAa/C,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,QAAQ;CAGT"}
|
|
@@ -7,63 +7,21 @@ import { schemas } from '../schemas/index.js';
|
|
|
7
7
|
import { TxHash } from '../tx/tx_hash.js';
|
|
8
8
|
import { Note } from './note.js';
|
|
9
9
|
/**
|
|
10
|
-
* A note with contextual data.
|
|
11
|
-
*/ export class
|
|
10
|
+
* A note with contextual data and a nonce that makes it unique.
|
|
11
|
+
*/ export class UniqueNote {
|
|
12
12
|
note;
|
|
13
13
|
recipient;
|
|
14
14
|
contractAddress;
|
|
15
15
|
storageSlot;
|
|
16
16
|
txHash;
|
|
17
|
-
|
|
17
|
+
noteNonce;
|
|
18
|
+
constructor(/** The note as emitted from the Noir contract. */ note, /** The recipient whose public key was used to encrypt the note. */ recipient, /** The contract address this note is created in. */ contractAddress, /** The specific storage location of the note on the contract. */ storageSlot, /** The hash of the tx the note was created in. */ txHash, /** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */ noteNonce){
|
|
18
19
|
this.note = note;
|
|
19
20
|
this.recipient = recipient;
|
|
20
21
|
this.contractAddress = contractAddress;
|
|
21
22
|
this.storageSlot = storageSlot;
|
|
22
23
|
this.txHash = txHash;
|
|
23
|
-
|
|
24
|
-
toBuffer() {
|
|
25
|
-
return serializeToBuffer([
|
|
26
|
-
this.note,
|
|
27
|
-
this.recipient,
|
|
28
|
-
this.contractAddress,
|
|
29
|
-
this.storageSlot,
|
|
30
|
-
this.txHash
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
static fromBuffer(buffer) {
|
|
34
|
-
const reader = BufferReader.asReader(buffer);
|
|
35
|
-
const note = reader.readObject(Note);
|
|
36
|
-
const recipient = reader.readObject(AztecAddress);
|
|
37
|
-
const contractAddress = reader.readObject(AztecAddress);
|
|
38
|
-
const storageSlot = reader.readObject(Fr);
|
|
39
|
-
const txHash = reader.readObject(TxHash);
|
|
40
|
-
return new this(note, recipient, contractAddress, storageSlot, txHash);
|
|
41
|
-
}
|
|
42
|
-
static get schema() {
|
|
43
|
-
return z.object({
|
|
44
|
-
note: Note.schema,
|
|
45
|
-
recipient: schemas.AztecAddress,
|
|
46
|
-
contractAddress: schemas.AztecAddress,
|
|
47
|
-
storageSlot: schemas.Fr,
|
|
48
|
-
txHash: TxHash.schema
|
|
49
|
-
}).transform(({ note, recipient, contractAddress, storageSlot, txHash })=>{
|
|
50
|
-
return new ExtendedNote(note, recipient, contractAddress, storageSlot, txHash);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
toString() {
|
|
54
|
-
return bufferToHex(this.toBuffer());
|
|
55
|
-
}
|
|
56
|
-
static fromString(str) {
|
|
57
|
-
return ExtendedNote.fromBuffer(hexToBuffer(str));
|
|
58
|
-
}
|
|
59
|
-
static async random() {
|
|
60
|
-
return new ExtendedNote(Note.random(), await AztecAddress.random(), await AztecAddress.random(), Fr.random(), TxHash.random());
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
export class UniqueNote extends ExtendedNote {
|
|
64
|
-
noteNonce;
|
|
65
|
-
constructor(/** The note as emitted from the Noir contract. */ note, /** The recipient whose public key was used to encrypt the note. */ recipient, /** The contract address this note is created in. */ contractAddress, /** The specific storage location of the note on the contract. */ storageSlot, /** The hash of the tx the note was created in. */ txHash, /** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */ noteNonce){
|
|
66
|
-
super(note, recipient, contractAddress, storageSlot, txHash), this.noteNonce = noteNonce;
|
|
24
|
+
this.noteNonce = noteNonce;
|
|
67
25
|
}
|
|
68
26
|
static get schema() {
|
|
69
27
|
return z.object({
|
|
@@ -98,9 +56,12 @@ export class UniqueNote extends ExtendedNote {
|
|
|
98
56
|
const storageSlot = reader.readObject(Fr);
|
|
99
57
|
const txHash = reader.readObject(TxHash);
|
|
100
58
|
const noteNonce = reader.readObject(Fr);
|
|
101
|
-
return new
|
|
59
|
+
return new UniqueNote(note, recipient, contractAddress, storageSlot, txHash, noteNonce);
|
|
102
60
|
}
|
|
103
61
|
static fromString(str) {
|
|
104
62
|
return UniqueNote.fromBuffer(hexToBuffer(str));
|
|
105
63
|
}
|
|
64
|
+
toString() {
|
|
65
|
+
return bufferToHex(this.toBuffer());
|
|
66
|
+
}
|
|
106
67
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NUM_MSGS_PER_BASE_PARITY } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
|
|
4
4
|
export declare class ParityBasePrivateInputs {
|
|
@@ -11,7 +11,7 @@ export declare class ParityBasePrivateInputs {
|
|
|
11
11
|
msgs: Tuple<Fr, typeof NUM_MSGS_PER_BASE_PARITY>,
|
|
12
12
|
/** Root of the VK tree */
|
|
13
13
|
vkTreeRoot: Fr);
|
|
14
|
-
static fromSlice(array:
|
|
14
|
+
static fromSlice(array: Fr[], index: number, vkTreeRoot: Fr): ParityBasePrivateInputs;
|
|
15
15
|
/** Serializes the inputs to a buffer. */
|
|
16
16
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
17
17
|
/** Serializes the inputs to a hex string. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parity_base_private_inputs.d.ts","sourceRoot":"","sources":["../../src/parity/parity_base_private_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"parity_base_private_inputs.d.ts","sourceRoot":"","sources":["../../src/parity/parity_base_private_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAG1F,qBAAa,uBAAuB;IAEhC,6DAA6D;aAC7C,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,wBAAwB,CAAC;IAChE,0BAA0B;aACV,UAAU,EAAE,EAAE;;IAH9B,6DAA6D;IAC7C,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,wBAAwB,CAAC;IAChE,0BAA0B;IACV,UAAU,EAAE,EAAE;WAGlB,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,GAAG,uBAAuB;IAa5F,yCAAyC;IACzC,QAAQ;IAIR,6CAA6C;IAC7C,QAAQ;IAIR;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,8DAA8D;IAC9D,MAAM;IAIN,6CAA6C;IAC7C,MAAM,KAAK,MAAM,gEAEhB;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NUM_MSGS_PER_BASE_PARITY } from '@aztec/constants';
|
|
1
|
+
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, NUM_MSGS_PER_BASE_PARITY } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
4
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
@@ -11,6 +11,10 @@ export class ParityBasePrivateInputs {
|
|
|
11
11
|
this.vkTreeRoot = vkTreeRoot;
|
|
12
12
|
}
|
|
13
13
|
static fromSlice(array, index, vkTreeRoot) {
|
|
14
|
+
// Can't use Tuple<Fr, typeof NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP> due to length
|
|
15
|
+
if (array.length !== NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP) {
|
|
16
|
+
throw new Error(`Msgs array length must be NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP=${NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP}`);
|
|
17
|
+
}
|
|
14
18
|
const start = index * NUM_MSGS_PER_BASE_PARITY;
|
|
15
19
|
const end = start + NUM_MSGS_PER_BASE_PARITY;
|
|
16
20
|
const msgs = array.slice(start, end);
|
|
@@ -53,7 +53,7 @@ export declare class BlockRootFirstRollupPrivateInputs {
|
|
|
53
53
|
*/
|
|
54
54
|
newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>);
|
|
55
55
|
static from(fields: FieldsOf<BlockRootFirstRollupPrivateInputs>): BlockRootFirstRollupPrivateInputs;
|
|
56
|
-
static getFields(fields: FieldsOf<BlockRootFirstRollupPrivateInputs>): readonly [UltraHonkProofData<ParityPublicInputs>, [RollupHonkProofData<TxRollupPublicInputs>, RollupHonkProofData<TxRollupPublicInputs>], AppendOnlyTreeSnapshot, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr
|
|
56
|
+
static getFields(fields: FieldsOf<BlockRootFirstRollupPrivateInputs>): readonly [UltraHonkProofData<ParityPublicInputs>, [RollupHonkProofData<TxRollupPublicInputs>, RollupHonkProofData<TxRollupPublicInputs>], AppendOnlyTreeSnapshot, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr], [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr]];
|
|
57
57
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
58
58
|
static fromBuffer(buffer: Buffer | BufferReader): BlockRootFirstRollupPrivateInputs;
|
|
59
59
|
toJSON(): Buffer<ArrayBufferLike>;
|
|
@@ -102,7 +102,7 @@ export declare class BlockRootSingleTxFirstRollupPrivateInputs {
|
|
|
102
102
|
*/
|
|
103
103
|
newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>);
|
|
104
104
|
static from(fields: FieldsOf<BlockRootSingleTxFirstRollupPrivateInputs>): BlockRootSingleTxFirstRollupPrivateInputs;
|
|
105
|
-
static getFields(fields: FieldsOf<BlockRootSingleTxFirstRollupPrivateInputs>): readonly [UltraHonkProofData<ParityPublicInputs>, RollupHonkProofData<TxRollupPublicInputs>, AppendOnlyTreeSnapshot, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr
|
|
105
|
+
static getFields(fields: FieldsOf<BlockRootSingleTxFirstRollupPrivateInputs>): readonly [UltraHonkProofData<ParityPublicInputs>, RollupHonkProofData<TxRollupPublicInputs>, AppendOnlyTreeSnapshot, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr], [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr]];
|
|
106
106
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
107
107
|
static fromBuffer(buffer: Buffer | BufferReader): BlockRootSingleTxFirstRollupPrivateInputs;
|
|
108
108
|
toJSON(): Buffer<ArrayBufferLike>;
|
|
@@ -177,7 +177,7 @@ export declare class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
177
177
|
*/
|
|
178
178
|
newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>);
|
|
179
179
|
static from(fields: FieldsOf<BlockRootEmptyTxFirstRollupPrivateInputs>): BlockRootEmptyTxFirstRollupPrivateInputs;
|
|
180
|
-
static getFields(fields: FieldsOf<BlockRootEmptyTxFirstRollupPrivateInputs>): readonly [UltraHonkProofData<ParityPublicInputs>, AppendOnlyTreeSnapshot, StateReference, CheckpointConstantData, SpongeBlob, bigint, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr
|
|
180
|
+
static getFields(fields: FieldsOf<BlockRootEmptyTxFirstRollupPrivateInputs>): readonly [UltraHonkProofData<ParityPublicInputs>, AppendOnlyTreeSnapshot, StateReference, CheckpointConstantData, SpongeBlob, bigint, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr], [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr]];
|
|
181
181
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
182
182
|
static fromBuffer(buffer: Buffer | BufferReader): BlockRootEmptyTxFirstRollupPrivateInputs;
|
|
183
183
|
toJSON(): Buffer<ArrayBufferLike>;
|
package/dest/tests/mocks.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { PublishedL2Block } from '../block/published_l2_block.js';
|
|
|
9
9
|
import type { ContractInstanceWithAddress } from '../contract/index.js';
|
|
10
10
|
import { Gas } from '../gas/gas.js';
|
|
11
11
|
import { GasFees } from '../gas/gas_fees.js';
|
|
12
|
-
import {
|
|
12
|
+
import { UniqueNote } from '../note/unique_note.js';
|
|
13
13
|
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
14
14
|
import { BlockProposal } from '../p2p/block_proposal.js';
|
|
15
15
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
@@ -17,7 +17,6 @@ import { StateReference, Tx } from '../tx/index.js';
|
|
|
17
17
|
import { TxSimulationResult } from '../tx/simulated_tx.js';
|
|
18
18
|
import { TxHash } from '../tx/tx_hash.js';
|
|
19
19
|
export declare const randomTxHash: () => TxHash;
|
|
20
|
-
export declare const randomExtendedNote: ({ note, recipient, contractAddress, txHash, storageSlot, }?: Partial<ExtendedNote>) => Promise<ExtendedNote>;
|
|
21
20
|
export declare const randomUniqueNote: ({ note, recipient, contractAddress, txHash, storageSlot, noteNonce, }?: Partial<UniqueNote>) => Promise<UniqueNote>;
|
|
22
21
|
export declare const mockTx: (seed?: number, { numberOfNonRevertiblePublicCallRequests, numberOfRevertiblePublicCallRequests, numberOfRevertibleNullifiers, hasPublicTeardownCallRequest, publicCalldataSize, feePayer, clientIvcProof, maxPriorityFeesPerGas, gasUsed, chainId, version, vkTreeRoot, protocolContractsHash, }?: {
|
|
23
22
|
numberOfNonRevertiblePublicCallRequests?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../src/tests/mocks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAe,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAyC,aAAa,EAAE,MAAM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F,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,EAAE,CAAC;IACb,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;CACZ;AAqBD,eAAO,MAAM,0CAA0C,GACrD,wBAAwB,+BAA+B,EACvD,SAAQ,eAA0C,0CAOnD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,UAAU,2BAA2B,KAAG,aAOzE,CAAC;AAGF,eAAO,MAAM,oBAAoB,GAAI,UAAU,2BAA2B,KAAG,gBAyB5E,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACxC,OAAO,OAAO,EACd,iBAAiB,eAAe,EAChC,iBAAiB,eAAe,KAC/B,gBAsBF,CAAC;AAEF,wBAAsB,sBAAsB,CAC1C,aAAa,EAAE,MAAM,EACrB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,eAAe,EAAE,CAAA;CAAO,GACzC,OAAO,CAAC,gBAAgB,CAAC,CAc3B"}
|
package/dest/tests/mocks.js
CHANGED
|
@@ -17,8 +17,8 @@ import { Nullifier } from '../kernel/nullifier.js';
|
|
|
17
17
|
import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inputs.js';
|
|
18
18
|
import { PartialPrivateTailPublicInputsForPublic, PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
19
19
|
import { PrivateToPublicAccumulatedDataBuilder } from '../kernel/private_to_public_accumulated_data_builder.js';
|
|
20
|
-
import { ExtendedNote, UniqueNote } from '../note/extended_note.js';
|
|
21
20
|
import { Note } from '../note/note.js';
|
|
21
|
+
import { UniqueNote } from '../note/unique_note.js';
|
|
22
22
|
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
23
23
|
import { BlockProposal } from '../p2p/block_proposal.js';
|
|
24
24
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
@@ -31,9 +31,6 @@ import { TxEffect } from '../tx/tx_effect.js';
|
|
|
31
31
|
import { TxHash } from '../tx/tx_hash.js';
|
|
32
32
|
import { makeGas, makeGlobalVariables, makeL2BlockHeader, makePublicCallRequest } from './factories.js';
|
|
33
33
|
export const randomTxHash = ()=>TxHash.random();
|
|
34
|
-
export const randomExtendedNote = async ({ note = Note.random(), recipient = undefined, contractAddress = undefined, txHash = randomTxHash(), storageSlot = Fr.random() } = {})=>{
|
|
35
|
-
return new ExtendedNote(note, recipient ?? await AztecAddress.random(), contractAddress ?? await AztecAddress.random(), storageSlot, txHash);
|
|
36
|
-
};
|
|
37
34
|
export const randomUniqueNote = async ({ note = Note.random(), recipient = undefined, contractAddress = undefined, txHash = randomTxHash(), storageSlot = Fr.random(), noteNonce = Fr.random() } = {})=>{
|
|
38
35
|
return new UniqueNote(note, recipient ?? await AztecAddress.random(), contractAddress ?? await AztecAddress.random(), storageSlot, txHash, noteNonce);
|
|
39
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251024",
|
|
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.
|
|
74
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
75
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
76
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
77
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
78
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
79
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
73
|
+
"@aztec/bb.js": "3.0.0-nightly.20251024",
|
|
74
|
+
"@aztec/blob-lib": "3.0.0-nightly.20251024",
|
|
75
|
+
"@aztec/constants": "3.0.0-nightly.20251024",
|
|
76
|
+
"@aztec/ethereum": "3.0.0-nightly.20251024",
|
|
77
|
+
"@aztec/foundation": "3.0.0-nightly.20251024",
|
|
78
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20251024",
|
|
79
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20251024",
|
|
80
80
|
"@google-cloud/storage": "^7.15.0",
|
|
81
81
|
"axios": "^1.12.0",
|
|
82
82
|
"json-stringify-deterministic": "1.0.12",
|
|
@@ -11,7 +11,7 @@ import type { ContractInstance } from './interfaces/contract_instance.js';
|
|
|
11
11
|
// TODO(@spalladino): Review all generator indices in this file
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Returns the deployment address for a given contract instance
|
|
14
|
+
* Returns the deployment address for a given contract instance.
|
|
15
15
|
* ```
|
|
16
16
|
* salted_initialization_hash = pedersen([salt, initialization_hash, deployer], GENERATOR__SALTED_INITIALIZATION_HASH)
|
|
17
17
|
* partial_address = pedersen([contract_class_id, salted_initialization_hash], GENERATOR__CONTRACT_PARTIAL_ADDRESS_V1)
|
|
@@ -9,7 +9,7 @@ import { type ArchiverSpecificConfig, ArchiverSpecificConfigSchema } from './arc
|
|
|
9
9
|
import { type SequencerConfig, SequencerConfigSchema } from './configs.js';
|
|
10
10
|
import { type ProverConfig, ProverConfigSchema } from './prover-client.js';
|
|
11
11
|
import { type SlasherConfig, SlasherConfigSchema } from './slasher.js';
|
|
12
|
-
import {
|
|
12
|
+
import { type ValidatorClientFullConfig, ValidatorClientFullConfigSchema } from './validator.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Aztec node admin API.
|
|
@@ -62,7 +62,7 @@ export type AztecNodeAdminConfig = ValidatorClientFullConfig &
|
|
|
62
62
|
|
|
63
63
|
export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema)
|
|
64
64
|
.merge(SlasherConfigSchema)
|
|
65
|
-
.merge(
|
|
65
|
+
.merge(ValidatorClientFullConfigSchema)
|
|
66
66
|
.merge(
|
|
67
67
|
ArchiverSpecificConfigSchema.pick({
|
|
68
68
|
archiverPollingIntervalMS: true,
|
|
@@ -12,6 +12,7 @@ import { z } from 'zod';
|
|
|
12
12
|
|
|
13
13
|
import type { CommitteeAttestationsAndSigners } from '../block/index.js';
|
|
14
14
|
import type { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
15
|
+
import { AllowedElementSchema } from './allowed_element.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Validator client configuration
|
|
@@ -44,7 +45,13 @@ export interface ValidatorClientConfig {
|
|
|
44
45
|
|
|
45
46
|
export type ValidatorClientFullConfig = ValidatorClientConfig &
|
|
46
47
|
Pick<SequencerConfig, 'txPublicSetupAllowList' | 'broadcastInvalidBlockProposal'> &
|
|
47
|
-
Pick<SlasherConfig, 'slashBroadcastedInvalidBlockPenalty'
|
|
48
|
+
Pick<SlasherConfig, 'slashBroadcastedInvalidBlockPenalty'> & {
|
|
49
|
+
/**
|
|
50
|
+
* Whether transactions are disabled for this node
|
|
51
|
+
* @remarks This should match the property in P2PConfig. It's not picked from there to avoid circular dependencies.
|
|
52
|
+
*/
|
|
53
|
+
disableTransactions?: boolean;
|
|
54
|
+
};
|
|
48
55
|
|
|
49
56
|
export const ValidatorClientConfigSchema = z.object({
|
|
50
57
|
validatorAddresses: z.array(schemas.EthAddress).optional(),
|
|
@@ -56,6 +63,13 @@ export const ValidatorClientConfigSchema = z.object({
|
|
|
56
63
|
alwaysReexecuteBlockProposals: z.boolean().optional(),
|
|
57
64
|
}) satisfies ZodFor<Omit<ValidatorClientConfig, 'validatorPrivateKeys'>>;
|
|
58
65
|
|
|
66
|
+
export const ValidatorClientFullConfigSchema = ValidatorClientConfigSchema.extend({
|
|
67
|
+
txPublicSetupAllowList: z.array(AllowedElementSchema).optional(),
|
|
68
|
+
broadcastInvalidBlockProposal: z.boolean().optional(),
|
|
69
|
+
slashBroadcastedInvalidBlockPenalty: schemas.BigInt,
|
|
70
|
+
disableTransactions: z.boolean().optional(),
|
|
71
|
+
}) satisfies ZodFor<Omit<ValidatorClientFullConfig, 'validatorPrivateKeys'>>;
|
|
72
|
+
|
|
59
73
|
export interface Validator {
|
|
60
74
|
start(): Promise<void>;
|
|
61
75
|
updateConfig(config: Partial<ValidatorClientFullConfig>): void;
|
package/src/note/index.ts
CHANGED
|
@@ -10,13 +10,13 @@ import { TxHash } from '../tx/tx_hash.js';
|
|
|
10
10
|
import { Note } from './note.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* A note with contextual data.
|
|
13
|
+
* A note with contextual data and a nonce that makes it unique.
|
|
14
14
|
*/
|
|
15
|
-
export class
|
|
15
|
+
export class UniqueNote {
|
|
16
16
|
constructor(
|
|
17
17
|
/** The note as emitted from the Noir contract. */
|
|
18
18
|
public note: Note,
|
|
19
|
-
/** The
|
|
19
|
+
/** The recipient whose public key was used to encrypt the note. */
|
|
20
20
|
public recipient: AztecAddress,
|
|
21
21
|
/** The contract address this note is created in. */
|
|
22
22
|
public contractAddress: AztecAddress,
|
|
@@ -24,76 +24,11 @@ export class ExtendedNote {
|
|
|
24
24
|
public storageSlot: Fr,
|
|
25
25
|
/** The hash of the tx the note was created in. */
|
|
26
26
|
public txHash: TxHash,
|
|
27
|
-
) {}
|
|
28
|
-
|
|
29
|
-
toBuffer(): Buffer {
|
|
30
|
-
return serializeToBuffer([this.note, this.recipient, this.contractAddress, this.storageSlot, this.txHash]);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
34
|
-
const reader = BufferReader.asReader(buffer);
|
|
35
|
-
|
|
36
|
-
const note = reader.readObject(Note);
|
|
37
|
-
const recipient = reader.readObject(AztecAddress);
|
|
38
|
-
const contractAddress = reader.readObject(AztecAddress);
|
|
39
|
-
const storageSlot = reader.readObject(Fr);
|
|
40
|
-
const txHash = reader.readObject(TxHash);
|
|
41
|
-
|
|
42
|
-
return new this(note, recipient, contractAddress, storageSlot, txHash);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
static get schema(): ZodFor<ExtendedNote> {
|
|
46
|
-
return z
|
|
47
|
-
.object({
|
|
48
|
-
note: Note.schema,
|
|
49
|
-
recipient: schemas.AztecAddress,
|
|
50
|
-
contractAddress: schemas.AztecAddress,
|
|
51
|
-
storageSlot: schemas.Fr,
|
|
52
|
-
txHash: TxHash.schema,
|
|
53
|
-
})
|
|
54
|
-
.transform(({ note, recipient, contractAddress, storageSlot, txHash }) => {
|
|
55
|
-
return new ExtendedNote(note, recipient, contractAddress, storageSlot, txHash);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
toString() {
|
|
60
|
-
return bufferToHex(this.toBuffer());
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
static fromString(str: string) {
|
|
64
|
-
return ExtendedNote.fromBuffer(hexToBuffer(str));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
static async random() {
|
|
68
|
-
return new ExtendedNote(
|
|
69
|
-
Note.random(),
|
|
70
|
-
await AztecAddress.random(),
|
|
71
|
-
await AztecAddress.random(),
|
|
72
|
-
Fr.random(),
|
|
73
|
-
TxHash.random(),
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export class UniqueNote extends ExtendedNote {
|
|
79
|
-
constructor(
|
|
80
|
-
/** The note as emitted from the Noir contract. */
|
|
81
|
-
note: Note,
|
|
82
|
-
/** The recipient whose public key was used to encrypt the note. */
|
|
83
|
-
recipient: AztecAddress,
|
|
84
|
-
/** The contract address this note is created in. */
|
|
85
|
-
contractAddress: AztecAddress,
|
|
86
|
-
/** The specific storage location of the note on the contract. */
|
|
87
|
-
storageSlot: Fr,
|
|
88
|
-
/** The hash of the tx the note was created in. */
|
|
89
|
-
txHash: TxHash,
|
|
90
27
|
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
91
28
|
public noteNonce: Fr,
|
|
92
|
-
) {
|
|
93
|
-
super(note, recipient, contractAddress, storageSlot, txHash);
|
|
94
|
-
}
|
|
29
|
+
) {}
|
|
95
30
|
|
|
96
|
-
static
|
|
31
|
+
static get schema(): ZodFor<UniqueNote> {
|
|
97
32
|
return z
|
|
98
33
|
.object({
|
|
99
34
|
note: Note.schema,
|
|
@@ -108,7 +43,7 @@ export class UniqueNote extends ExtendedNote {
|
|
|
108
43
|
});
|
|
109
44
|
}
|
|
110
45
|
|
|
111
|
-
|
|
46
|
+
toBuffer(): Buffer {
|
|
112
47
|
return serializeToBuffer([
|
|
113
48
|
this.note,
|
|
114
49
|
this.recipient,
|
|
@@ -119,7 +54,7 @@ export class UniqueNote extends ExtendedNote {
|
|
|
119
54
|
]);
|
|
120
55
|
}
|
|
121
56
|
|
|
122
|
-
static
|
|
57
|
+
static async random() {
|
|
123
58
|
return new UniqueNote(
|
|
124
59
|
Note.random(),
|
|
125
60
|
await AztecAddress.random(),
|
|
@@ -130,7 +65,7 @@ export class UniqueNote extends ExtendedNote {
|
|
|
130
65
|
);
|
|
131
66
|
}
|
|
132
67
|
|
|
133
|
-
static
|
|
68
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
134
69
|
const reader = BufferReader.asReader(buffer);
|
|
135
70
|
|
|
136
71
|
const note = reader.readObject(Note);
|
|
@@ -140,10 +75,14 @@ export class UniqueNote extends ExtendedNote {
|
|
|
140
75
|
const txHash = reader.readObject(TxHash);
|
|
141
76
|
const noteNonce = reader.readObject(Fr);
|
|
142
77
|
|
|
143
|
-
return new
|
|
78
|
+
return new UniqueNote(note, recipient, contractAddress, storageSlot, txHash, noteNonce);
|
|
144
79
|
}
|
|
145
80
|
|
|
146
|
-
static
|
|
81
|
+
static fromString(str: string) {
|
|
147
82
|
return UniqueNote.fromBuffer(hexToBuffer(str));
|
|
148
83
|
}
|
|
84
|
+
|
|
85
|
+
toString() {
|
|
86
|
+
return bufferToHex(this.toBuffer());
|
|
87
|
+
}
|
|
149
88
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, NUM_MSGS_PER_BASE_PARITY } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
4
|
import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
@@ -12,11 +12,13 @@ export class ParityBasePrivateInputs {
|
|
|
12
12
|
public readonly vkTreeRoot: Fr,
|
|
13
13
|
) {}
|
|
14
14
|
|
|
15
|
-
public static fromSlice(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
public static fromSlice(array: Fr[], index: number, vkTreeRoot: Fr): ParityBasePrivateInputs {
|
|
16
|
+
// Can't use Tuple<Fr, typeof NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP> due to length
|
|
17
|
+
if (array.length !== NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`Msgs array length must be NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP=${NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP}`,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
20
22
|
const start = index * NUM_MSGS_PER_BASE_PARITY;
|
|
21
23
|
const end = start + NUM_MSGS_PER_BASE_PARITY;
|
|
22
24
|
const msgs = array.slice(start, end);
|
package/src/tests/mocks.ts
CHANGED
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
PrivateKernelTailCircuitPublicInputs,
|
|
25
25
|
} from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
26
26
|
import { PrivateToPublicAccumulatedDataBuilder } from '../kernel/private_to_public_accumulated_data_builder.js';
|
|
27
|
-
import { ExtendedNote, UniqueNote } from '../note/extended_note.js';
|
|
28
27
|
import { Note } from '../note/note.js';
|
|
28
|
+
import { UniqueNote } from '../note/unique_note.js';
|
|
29
29
|
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
30
30
|
import { BlockProposal } from '../p2p/block_proposal.js';
|
|
31
31
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
@@ -40,22 +40,6 @@ import { makeGas, makeGlobalVariables, makeL2BlockHeader, makePublicCallRequest
|
|
|
40
40
|
|
|
41
41
|
export const randomTxHash = (): TxHash => TxHash.random();
|
|
42
42
|
|
|
43
|
-
export const randomExtendedNote = async ({
|
|
44
|
-
note = Note.random(),
|
|
45
|
-
recipient = undefined,
|
|
46
|
-
contractAddress = undefined,
|
|
47
|
-
txHash = randomTxHash(),
|
|
48
|
-
storageSlot = Fr.random(),
|
|
49
|
-
}: Partial<ExtendedNote> = {}) => {
|
|
50
|
-
return new ExtendedNote(
|
|
51
|
-
note,
|
|
52
|
-
recipient ?? (await AztecAddress.random()),
|
|
53
|
-
contractAddress ?? (await AztecAddress.random()),
|
|
54
|
-
storageSlot,
|
|
55
|
-
txHash,
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
43
|
export const randomUniqueNote = async ({
|
|
60
44
|
note = Note.random(),
|
|
61
45
|
recipient = undefined,
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
import { AztecAddress } from '../aztec-address/index.js';
|
|
5
|
-
import { type ZodFor } from '../schemas/index.js';
|
|
6
|
-
import { TxHash } from '../tx/tx_hash.js';
|
|
7
|
-
import { Note } from './note.js';
|
|
8
|
-
/**
|
|
9
|
-
* A note with contextual data.
|
|
10
|
-
*/
|
|
11
|
-
export declare class ExtendedNote {
|
|
12
|
-
/** The note as emitted from the Noir contract. */
|
|
13
|
-
note: Note;
|
|
14
|
-
/** The address whose public key was used to encrypt the note. */
|
|
15
|
-
recipient: AztecAddress;
|
|
16
|
-
/** The contract address this note is created in. */
|
|
17
|
-
contractAddress: AztecAddress;
|
|
18
|
-
/** The specific storage location of the note on the contract. */
|
|
19
|
-
storageSlot: Fr;
|
|
20
|
-
/** The hash of the tx the note was created in. */
|
|
21
|
-
txHash: TxHash;
|
|
22
|
-
constructor(
|
|
23
|
-
/** The note as emitted from the Noir contract. */
|
|
24
|
-
note: Note,
|
|
25
|
-
/** The address whose public key was used to encrypt the note. */
|
|
26
|
-
recipient: AztecAddress,
|
|
27
|
-
/** The contract address this note is created in. */
|
|
28
|
-
contractAddress: AztecAddress,
|
|
29
|
-
/** The specific storage location of the note on the contract. */
|
|
30
|
-
storageSlot: Fr,
|
|
31
|
-
/** The hash of the tx the note was created in. */
|
|
32
|
-
txHash: TxHash);
|
|
33
|
-
toBuffer(): Buffer;
|
|
34
|
-
static fromBuffer(buffer: Buffer | BufferReader): ExtendedNote;
|
|
35
|
-
static get schema(): ZodFor<ExtendedNote>;
|
|
36
|
-
toString(): `0x${string}`;
|
|
37
|
-
static fromString(str: string): ExtendedNote;
|
|
38
|
-
static random(): Promise<ExtendedNote>;
|
|
39
|
-
}
|
|
40
|
-
export declare class UniqueNote extends ExtendedNote {
|
|
41
|
-
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
42
|
-
noteNonce: Fr;
|
|
43
|
-
constructor(
|
|
44
|
-
/** The note as emitted from the Noir contract. */
|
|
45
|
-
note: Note,
|
|
46
|
-
/** The recipient whose public key was used to encrypt the note. */
|
|
47
|
-
recipient: AztecAddress,
|
|
48
|
-
/** The contract address this note is created in. */
|
|
49
|
-
contractAddress: AztecAddress,
|
|
50
|
-
/** The specific storage location of the note on the contract. */
|
|
51
|
-
storageSlot: Fr,
|
|
52
|
-
/** The hash of the tx the note was created in. */
|
|
53
|
-
txHash: TxHash,
|
|
54
|
-
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
55
|
-
noteNonce: Fr);
|
|
56
|
-
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
57
|
-
note: z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Buffer<ArrayBuffer>, string>, z.ZodEffects<z.ZodObject<{
|
|
58
|
-
type: z.ZodLiteral<"Buffer">;
|
|
59
|
-
data: z.ZodArray<z.ZodNumber, "many">;
|
|
60
|
-
}, "strip", z.ZodTypeAny, {
|
|
61
|
-
type: "Buffer";
|
|
62
|
-
data: number[];
|
|
63
|
-
}, {
|
|
64
|
-
type: "Buffer";
|
|
65
|
-
data: number[];
|
|
66
|
-
}>, Buffer<ArrayBuffer>, {
|
|
67
|
-
type: "Buffer";
|
|
68
|
-
data: number[];
|
|
69
|
-
}>]>, Note, string | {
|
|
70
|
-
type: "Buffer";
|
|
71
|
-
data: number[];
|
|
72
|
-
}>;
|
|
73
|
-
recipient: ZodFor<AztecAddress>;
|
|
74
|
-
contractAddress: ZodFor<AztecAddress>;
|
|
75
|
-
storageSlot: ZodFor<Fr>;
|
|
76
|
-
txHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, TxHash, string>;
|
|
77
|
-
noteNonce: ZodFor<Fr>;
|
|
78
|
-
}, "strip", z.ZodTypeAny, {
|
|
79
|
-
storageSlot: Fr;
|
|
80
|
-
contractAddress: AztecAddress;
|
|
81
|
-
recipient: AztecAddress;
|
|
82
|
-
note: Note;
|
|
83
|
-
txHash: TxHash;
|
|
84
|
-
noteNonce: Fr;
|
|
85
|
-
}, {
|
|
86
|
-
note: string | {
|
|
87
|
-
type: "Buffer";
|
|
88
|
-
data: number[];
|
|
89
|
-
};
|
|
90
|
-
txHash: string;
|
|
91
|
-
storageSlot?: any;
|
|
92
|
-
contractAddress?: any;
|
|
93
|
-
recipient?: any;
|
|
94
|
-
noteNonce?: any;
|
|
95
|
-
}>, UniqueNote, {
|
|
96
|
-
note: string | {
|
|
97
|
-
type: "Buffer";
|
|
98
|
-
data: number[];
|
|
99
|
-
};
|
|
100
|
-
txHash: string;
|
|
101
|
-
storageSlot?: any;
|
|
102
|
-
contractAddress?: any;
|
|
103
|
-
recipient?: any;
|
|
104
|
-
noteNonce?: any;
|
|
105
|
-
}>;
|
|
106
|
-
toBuffer(): Buffer;
|
|
107
|
-
static random(): Promise<UniqueNote>;
|
|
108
|
-
static fromBuffer(buffer: Buffer | BufferReader): UniqueNote;
|
|
109
|
-
static fromString(str: string): UniqueNote;
|
|
110
|
-
}
|
|
111
|
-
//# sourceMappingURL=extended_note.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extended_note.d.ts","sourceRoot":"","sources":["../../src/note/extended_note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;GAEG;AACH,qBAAa,YAAY;IAErB,kDAAkD;IAC3C,IAAI,EAAE,IAAI;IACjB,iEAAiE;IAC1D,SAAS,EAAE,YAAY;IAC9B,oDAAoD;IAC7C,eAAe,EAAE,YAAY;IACpC,iEA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