@aztec/sequencer-client 0.34.0 → 0.35.0
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/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +3 -3
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +84 -7
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +4 -3
- package/dest/index.d.ts +0 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -2
- package/dest/sequencer/sequencer.d.ts +6 -7
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +10 -11
- package/dest/tx_validator/aggregate_tx_validator.d.ts +7 -0
- package/dest/tx_validator/aggregate_tx_validator.d.ts.map +1 -0
- package/dest/tx_validator/aggregate_tx_validator.js +23 -0
- package/dest/tx_validator/double_spend_validator.d.ts +11 -0
- package/dest/tx_validator/double_spend_validator.d.ts.map +1 -0
- package/dest/tx_validator/double_spend_validator.js +50 -0
- package/dest/tx_validator/gas_validator.d.ts +12 -0
- package/dest/tx_validator/gas_validator.d.ts.map +1 -0
- package/dest/tx_validator/gas_validator.js +62 -0
- package/dest/tx_validator/metadata_validator.d.ts +8 -0
- package/dest/tx_validator/metadata_validator.d.ts.map +1 -0
- package/dest/tx_validator/metadata_validator.js +50 -0
- package/dest/tx_validator/phases_validator.d.ts +13 -0
- package/dest/tx_validator/phases_validator.d.ts.map +1 -0
- package/dest/tx_validator/phases_validator.js +73 -0
- package/dest/tx_validator/tx_validator_factory.d.ts +13 -0
- package/dest/tx_validator/tx_validator_factory.d.ts.map +1 -0
- package/dest/tx_validator/tx_validator_factory.js +21 -0
- package/package.json +14 -13
- package/src/client/sequencer-client.ts +2 -3
- package/src/config.ts +93 -7
- package/src/global_variable_builder/global_builder.ts +3 -2
- package/src/index.ts +0 -1
- package/src/sequencer/sequencer.ts +27 -20
- package/src/tx_validator/aggregate_tx_validator.ts +24 -0
- package/src/tx_validator/double_spend_validator.ts +65 -0
- package/src/tx_validator/gas_validator.ts +81 -0
- package/src/tx_validator/metadata_validator.ts +60 -0
- package/src/tx_validator/phases_validator.ts +101 -0
- package/src/tx_validator/tx_validator_factory.ts +37 -0
- package/dest/sequencer/abstract_phase_manager.d.ts +0 -77
- package/dest/sequencer/abstract_phase_manager.d.ts.map +0 -1
- package/dest/sequencer/abstract_phase_manager.js +0 -307
- package/dest/sequencer/app_logic_phase_manager.d.ts +0 -28
- package/dest/sequencer/app_logic_phase_manager.d.ts.map +0 -1
- package/dest/sequencer/app_logic_phase_manager.js +0 -41
- package/dest/sequencer/hints_builder.d.ts +0 -23
- package/dest/sequencer/hints_builder.d.ts.map +0 -1
- package/dest/sequencer/hints_builder.js +0 -62
- package/dest/sequencer/phase_manager_factory.d.ts +0 -18
- package/dest/sequencer/phase_manager_factory.d.ts.map +0 -1
- package/dest/sequencer/phase_manager_factory.js +0 -56
- package/dest/sequencer/public_processor.d.ts +0 -54
- package/dest/sequencer/public_processor.d.ts.map +0 -1
- package/dest/sequencer/public_processor.js +0 -142
- package/dest/sequencer/setup_phase_manager.d.ts +0 -28
- package/dest/sequencer/setup_phase_manager.d.ts.map +0 -1
- package/dest/sequencer/setup_phase_manager.js +0 -30
- package/dest/sequencer/tail_phase_manager.d.ts +0 -29
- package/dest/sequencer/tail_phase_manager.d.ts.map +0 -1
- package/dest/sequencer/tail_phase_manager.js +0 -52
- package/dest/sequencer/teardown_phase_manager.d.ts +0 -28
- package/dest/sequencer/teardown_phase_manager.d.ts.map +0 -1
- package/dest/sequencer/teardown_phase_manager.js +0 -30
- package/dest/sequencer/tx_validator.d.ts +0 -29
- package/dest/sequencer/tx_validator.d.ts.map +0 -1
- package/dest/sequencer/tx_validator.js +0 -174
- package/dest/sequencer/tx_validator_factory.d.ts +0 -12
- package/dest/sequencer/tx_validator_factory.d.ts.map +0 -1
- package/dest/sequencer/tx_validator_factory.js +0 -17
- package/dest/sequencer/utils.d.ts +0 -8
- package/dest/sequencer/utils.d.ts.map +0 -1
- package/dest/sequencer/utils.js +0 -29
- package/dest/simulator/index.d.ts +0 -31
- package/dest/simulator/index.d.ts.map +0 -1
- package/dest/simulator/index.js +0 -2
- package/dest/simulator/public_executor.d.ts +0 -79
- package/dest/simulator/public_executor.d.ts.map +0 -1
- package/dest/simulator/public_executor.js +0 -198
- package/dest/simulator/public_kernel.d.ts +0 -37
- package/dest/simulator/public_kernel.d.ts.map +0 -1
- package/dest/simulator/public_kernel.js +0 -97
- package/src/sequencer/abstract_phase_manager.ts +0 -549
- package/src/sequencer/app_logic_phase_manager.ts +0 -62
- package/src/sequencer/hints_builder.ts +0 -119
- package/src/sequencer/phase_manager_factory.ts +0 -126
- package/src/sequencer/public_processor.ts +0 -209
- package/src/sequencer/setup_phase_manager.ts +0 -50
- package/src/sequencer/tail_phase_manager.ts +0 -111
- package/src/sequencer/teardown_phase_manager.ts +0 -50
- package/src/sequencer/tx_validator.ts +0 -265
- package/src/sequencer/tx_validator_factory.ts +0 -32
- package/src/sequencer/utils.ts +0 -31
- package/src/simulator/index.ts +0 -36
- package/src/simulator/public_executor.ts +0 -267
- package/src/simulator/public_kernel.ts +0 -139
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { type CircuitSimulationStats } from '@aztec/circuit-types/stats';
|
|
2
|
-
import {
|
|
3
|
-
type KernelCircuitPublicInputs,
|
|
4
|
-
type PublicKernelCircuitPrivateInputs,
|
|
5
|
-
type PublicKernelCircuitPublicInputs,
|
|
6
|
-
type PublicKernelTailCircuitPrivateInputs,
|
|
7
|
-
} from '@aztec/circuits.js';
|
|
8
|
-
import { createDebugLogger } from '@aztec/foundation/log';
|
|
9
|
-
import { elapsed } from '@aztec/foundation/timer';
|
|
10
|
-
import {
|
|
11
|
-
PublicKernelAppLogicArtifact,
|
|
12
|
-
PublicKernelSetupArtifact,
|
|
13
|
-
PublicKernelTailArtifact,
|
|
14
|
-
PublicKernelTeardownArtifact,
|
|
15
|
-
convertPublicInnerRollupInputsToWitnessMap,
|
|
16
|
-
convertPublicInnerRollupOutputFromWitnessMap,
|
|
17
|
-
convertPublicSetupRollupInputsToWitnessMap,
|
|
18
|
-
convertPublicSetupRollupOutputFromWitnessMap,
|
|
19
|
-
convertPublicTailInputsToWitnessMap,
|
|
20
|
-
convertPublicTailOutputFromWitnessMap,
|
|
21
|
-
convertPublicTeardownRollupInputsToWitnessMap,
|
|
22
|
-
convertPublicTeardownRollupOutputFromWitnessMap,
|
|
23
|
-
} from '@aztec/noir-protocol-circuits-types';
|
|
24
|
-
import { type SimulationProvider, WASMSimulator } from '@aztec/simulator';
|
|
25
|
-
|
|
26
|
-
import { type PublicKernelCircuitSimulator } from './index.js';
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Implements the PublicKernelCircuitSimulator.
|
|
30
|
-
*/
|
|
31
|
-
export class RealPublicKernelCircuitSimulator implements PublicKernelCircuitSimulator {
|
|
32
|
-
private log = createDebugLogger('aztec:public-kernel-simulator');
|
|
33
|
-
|
|
34
|
-
// Some circuits are so small it is faster to use WASM
|
|
35
|
-
private wasmSimulator: WASMSimulator = new WASMSimulator();
|
|
36
|
-
|
|
37
|
-
constructor(private simulator: SimulationProvider) {}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Simulates the public kernel setup circuit from its inputs.
|
|
41
|
-
* @param input - Inputs to the circuit.
|
|
42
|
-
* @returns The public inputs as outputs of the simulation.
|
|
43
|
-
*/
|
|
44
|
-
public async publicKernelCircuitSetup(
|
|
45
|
-
input: PublicKernelCircuitPrivateInputs,
|
|
46
|
-
): Promise<PublicKernelCircuitPublicInputs> {
|
|
47
|
-
if (!input.previousKernel.publicInputs.needsSetup) {
|
|
48
|
-
throw new Error(`Expected previous kernel inputs to need setup`);
|
|
49
|
-
}
|
|
50
|
-
const inputWitness = convertPublicSetupRollupInputsToWitnessMap(input);
|
|
51
|
-
const [duration, witness] = await elapsed(() =>
|
|
52
|
-
this.wasmSimulator.simulateCircuit(inputWitness, PublicKernelSetupArtifact),
|
|
53
|
-
);
|
|
54
|
-
const result = convertPublicSetupRollupOutputFromWitnessMap(witness);
|
|
55
|
-
this.log.debug(`Simulated public kernel setup circuit`, {
|
|
56
|
-
eventName: 'circuit-simulation',
|
|
57
|
-
circuitName: 'public-kernel-setup',
|
|
58
|
-
duration,
|
|
59
|
-
inputSize: input.toBuffer().length,
|
|
60
|
-
outputSize: result.toBuffer().length,
|
|
61
|
-
} satisfies CircuitSimulationStats);
|
|
62
|
-
return result;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Simulates the public kernel app logic circuit from its inputs.
|
|
67
|
-
* @param input - Inputs to the circuit.
|
|
68
|
-
* @returns The public inputs as outputs of the simulation.
|
|
69
|
-
*/
|
|
70
|
-
public async publicKernelCircuitAppLogic(
|
|
71
|
-
input: PublicKernelCircuitPrivateInputs,
|
|
72
|
-
): Promise<PublicKernelCircuitPublicInputs> {
|
|
73
|
-
if (!input.previousKernel.publicInputs.needsAppLogic) {
|
|
74
|
-
throw new Error(`Expected previous kernel inputs to need app logic`);
|
|
75
|
-
}
|
|
76
|
-
const inputWitness = convertPublicInnerRollupInputsToWitnessMap(input);
|
|
77
|
-
const [duration, witness] = await elapsed(() =>
|
|
78
|
-
this.wasmSimulator.simulateCircuit(inputWitness, PublicKernelAppLogicArtifact),
|
|
79
|
-
);
|
|
80
|
-
const result = convertPublicInnerRollupOutputFromWitnessMap(witness);
|
|
81
|
-
this.log.debug(`Simulated public kernel app logic circuit`, {
|
|
82
|
-
eventName: 'circuit-simulation',
|
|
83
|
-
circuitName: 'public-kernel-app-logic',
|
|
84
|
-
duration,
|
|
85
|
-
inputSize: input.toBuffer().length,
|
|
86
|
-
outputSize: result.toBuffer().length,
|
|
87
|
-
} satisfies CircuitSimulationStats);
|
|
88
|
-
return result;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Simulates the public kernel teardown circuit from its inputs.
|
|
93
|
-
* @param input - Inputs to the circuit.
|
|
94
|
-
* @returns The public inputs as outputs of the simulation.
|
|
95
|
-
*/
|
|
96
|
-
public async publicKernelCircuitTeardown(
|
|
97
|
-
input: PublicKernelCircuitPrivateInputs,
|
|
98
|
-
): Promise<PublicKernelCircuitPublicInputs> {
|
|
99
|
-
if (!input.previousKernel.publicInputs.needsTeardown) {
|
|
100
|
-
throw new Error(`Expected previous kernel inputs to need teardown`);
|
|
101
|
-
}
|
|
102
|
-
const inputWitness = convertPublicTeardownRollupInputsToWitnessMap(input);
|
|
103
|
-
const [duration, witness] = await elapsed(() =>
|
|
104
|
-
this.wasmSimulator.simulateCircuit(inputWitness, PublicKernelTeardownArtifact),
|
|
105
|
-
);
|
|
106
|
-
const result = convertPublicTeardownRollupOutputFromWitnessMap(witness);
|
|
107
|
-
this.log.debug(`Simulated public kernel teardown circuit`, {
|
|
108
|
-
eventName: 'circuit-simulation',
|
|
109
|
-
circuitName: 'public-kernel-teardown',
|
|
110
|
-
duration,
|
|
111
|
-
inputSize: input.toBuffer().length,
|
|
112
|
-
outputSize: result.toBuffer().length,
|
|
113
|
-
} satisfies CircuitSimulationStats);
|
|
114
|
-
return result;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Simulates the public kernel tail circuit from its inputs.
|
|
119
|
-
* @param input - Inputs to the circuit.
|
|
120
|
-
* @returns The public inputs as outputs of the simulation.
|
|
121
|
-
*/
|
|
122
|
-
public async publicKernelCircuitTail(
|
|
123
|
-
input: PublicKernelTailCircuitPrivateInputs,
|
|
124
|
-
): Promise<KernelCircuitPublicInputs> {
|
|
125
|
-
const inputWitness = convertPublicTailInputsToWitnessMap(input);
|
|
126
|
-
const [duration, witness] = await elapsed(() =>
|
|
127
|
-
this.wasmSimulator.simulateCircuit(inputWitness, PublicKernelTailArtifact),
|
|
128
|
-
);
|
|
129
|
-
const result = convertPublicTailOutputFromWitnessMap(witness);
|
|
130
|
-
this.log.debug(`Simulated public kernel tail circuit`, {
|
|
131
|
-
eventName: 'circuit-simulation',
|
|
132
|
-
circuitName: 'public-kernel-tail',
|
|
133
|
-
duration,
|
|
134
|
-
inputSize: input.toBuffer().length,
|
|
135
|
-
outputSize: result.toBuffer().length,
|
|
136
|
-
} satisfies CircuitSimulationStats);
|
|
137
|
-
return result;
|
|
138
|
-
}
|
|
139
|
-
}
|