From 8b310443d1c5ce6a37c4659a7f92fef2e602a566 Mon Sep 17 00:00:00 2001 From: LHerskind Date: Mon, 25 Mar 2024 14:11:32 +0000 Subject: [PATCH] feat: public constrained view messy --- .../docs_example_contract/src/main.nr | 30 +++----- .../aztec-node/src/aztec-node/server.ts | 3 +- .../contract/contract_function_interaction.ts | 16 ++--- .../src/interfaces/aztec-node.ts | 3 +- .../circuit-types/src/interfaces/pxe.ts | 8 ++- .../end-to-end/src/e2e_state_vars.test.ts | 69 ++++++++++--------- yarn-project/foundation/src/abi/decoder.ts | 1 + .../pxe/src/pxe_service/pxe_service.ts | 25 ++++--- .../src/sequencer/abstract_phase_manager.ts | 36 ++++++++-- .../src/sequencer/app_logic_phase_manager.ts | 4 +- .../src/sequencer/public_processor.ts | 14 +++- .../src/sequencer/sequencer.test.ts | 2 +- .../src/sequencer/setup_phase_manager.ts | 2 +- .../src/sequencer/tail_phase_manager.ts | 2 +- .../src/sequencer/teardown_phase_manager.ts | 2 +- 15 files changed, 126 insertions(+), 91 deletions(-) diff --git a/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr b/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr index 0fd22fb195e..ab272191ae7 100644 --- a/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr @@ -109,31 +109,21 @@ contract DocsExample { } #[aztec(private)] - fn multicall() -> pub AztecAddress { - AztecAddress::from_field( - context.call_private_function_no_args( - context.this_address(), - FunctionSelector::from_signature("get_message_sender()") - )[0] - ) - } - - #[aztec(private)] - fn multicall_public() { - context.call_public_function_no_args( + fn get_shared_immutable_constrained_private_indirect() -> pub Leader { + let ret = context.call_private_function_no_args( context.this_address(), - FunctionSelector::from_signature("get_message_sender_public()") + FunctionSelector::from_signature("get_shared_immutable_constrained_private()") ); - } - - #[aztec(private)] - fn get_message_sender() -> pub AztecAddress { - context.msg_sender() + Leader::deserialize([ret[0], ret[1]]) } #[aztec(public)] - fn get_message_sender_public() -> pub AztecAddress { - context.msg_sender() + fn get_shared_immutable_constrained_indirect() -> pub Leader { + let ret = context.call_public_function_no_args( + context.this_address(), + FunctionSelector::from_signature("get_shared_immutable_constrained()") + ); + Leader::deserialize([ret[0], ret[1]]) } #[aztec(public)] diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index f905fbe3186..278ed0c6df0 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -659,7 +659,7 @@ export class AztecNodeService implements AztecNode { new WASMSimulator(), ); const processor = await publicProcessorFactory.create(prevHeader, newGlobalVariables); - const [processedTxs, failedTxs] = await processor.process([tx]); + const [processedTxs, failedTxs, returns] = await processor.process([tx]); if (failedTxs.length) { this.log.warn(`Simulated tx ${tx.getTxHash()} fails: ${failedTxs[0].error}`); throw failedTxs[0].error; @@ -670,6 +670,7 @@ export class AztecNodeService implements AztecNode { throw reverted[0].revertReason; } this.log.info(`Simulated tx ${tx.getTxHash()} succeeds`); + return returns; } public setConfig(config: Partial): Promise { diff --git a/yarn-project/aztec.js/src/contract/contract_function_interaction.ts b/yarn-project/aztec.js/src/contract/contract_function_interaction.ts index 201d846f112..04ae273a2a5 100644 --- a/yarn-project/aztec.js/src/contract/contract_function_interaction.ts +++ b/yarn-project/aztec.js/src/contract/contract_function_interaction.ts @@ -86,21 +86,13 @@ export class ContractFunctionInteraction extends BaseContractInteraction { * @returns The result of the view transaction as returned by the contract function. */ public async viewConstrained(options: ViewMethodOptions = {}) { - // We need to create the request, but we need to change the entry-point slightly I think :thinking: - const packedArgs = PackedArguments.fromArgs(encodeArguments(this.functionDao, this.args)); - // I have forgotten what the hell origin is. - - const nodeInfo = await this.wallet.getNodeInfo(); - - // We need to figure something better around for doing the simulation to have a origin and a to that is different - // such that we can actually replace the "msg_sender" etc - - // Depending on public or not we need to do some changes. const a = FunctionData.fromAbi(this.functionDao); if (a.isPrivate) { + const nodeInfo = await this.wallet.getNodeInfo(); + const txRequest = TxExecutionRequest.from({ argsHash: packedArgs.hash, origin: this.contractAddress, @@ -111,11 +103,11 @@ export class ContractFunctionInteraction extends BaseContractInteraction { }); const vue = await this.pxe.simulateCall(txRequest, options.from ?? this.wallet.getAddress()); - return vue.rv; + return vue.privateReturnValues && vue.privateReturnValues[0]; } else { await this.create(); const vue = await this.pxe.simulateCall(this.txRequest!); - return vue.rv; + return vue.publicReturnValues && vue.publicReturnValues[0]; } } } diff --git a/yarn-project/circuit-types/src/interfaces/aztec-node.ts b/yarn-project/circuit-types/src/interfaces/aztec-node.ts index 5c03eddccbc..423d0469b37 100644 --- a/yarn-project/circuit-types/src/interfaces/aztec-node.ts +++ b/yarn-project/circuit-types/src/interfaces/aztec-node.ts @@ -7,6 +7,7 @@ import { PUBLIC_DATA_TREE_HEIGHT, } from '@aztec/circuits.js'; import { L1ContractAddresses } from '@aztec/ethereum'; +import { DecodedReturn, ProcessReturnValues } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { ContractClassPublic, ContractInstanceWithAddress } from '@aztec/types/contracts'; @@ -276,7 +277,7 @@ export interface AztecNode { * This currently just checks that the transaction execution succeeds. * @param tx - The transaction to simulate. **/ - simulatePublicCalls(tx: Tx): Promise; + simulatePublicCalls(tx: Tx): Promise; /** * Updates the configuration of this node. diff --git a/yarn-project/circuit-types/src/interfaces/pxe.ts b/yarn-project/circuit-types/src/interfaces/pxe.ts index 1b87304d9ec..0166adc6499 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.ts @@ -1,5 +1,5 @@ import { AztecAddress, CompleteAddress, Fr, GrumpkinPrivateKey, PartialAddress } from '@aztec/circuits.js'; -import { ContractArtifact, DecodedReturn } from '@aztec/foundation/abi'; +import { ContractArtifact, ProcessReturnValues } from '@aztec/foundation/abi'; import { ContractClassWithId, ContractInstanceWithAddress } from '@aztec/types/contracts'; import { NodeInfo } from '@aztec/types/interfaces'; @@ -14,7 +14,11 @@ import { TxExecutionRequest } from '../tx_execution_request.js'; import { SyncStatus } from './sync-status.js'; export class Vue { - constructor(public tx: Tx, public rv?: DecodedReturn) {} + constructor( + public tx: Tx, + public privateReturnValues?: ProcessReturnValues, + public publicReturnValues?: ProcessReturnValues, + ) {} } // docs:start:pxe-interface diff --git a/yarn-project/end-to-end/src/e2e_state_vars.test.ts b/yarn-project/end-to-end/src/e2e_state_vars.test.ts index c0afc2a4f09..cd6db79d6a2 100644 --- a/yarn-project/end-to-end/src/e2e_state_vars.test.ts +++ b/yarn-project/end-to-end/src/e2e_state_vars.test.ts @@ -1,51 +1,31 @@ -import { DebugLogger, FunctionSelector, Wallet } from '@aztec/aztec.js'; -import { decodeFunctionSignature } from '@aztec/foundation/abi'; +import { Wallet } from '@aztec/aztec.js'; import { DocsExampleContract } from '@aztec/noir-contracts.js'; +import { jest } from '@jest/globals'; + import { setup } from './fixtures/utils.js'; +const TIMEOUT = 100_000; + describe('e2e_state_vars', () => { + jest.setTimeout(TIMEOUT); + let wallet: Wallet; let teardown: () => Promise; let contract: DocsExampleContract; - let logger: DebugLogger; const POINTS = 1n; const RANDOMNESS = 2n; beforeAll(async () => { - ({ teardown, wallet, logger } = await setup()); + ({ teardown, wallet } = await setup()); contract = await DocsExampleContract.deploy(wallet).send().deployed(); - }, 25_000); + }, 30_000); afterAll(() => teardown()); describe('SharedImmutable', () => { - it.only('private read of uninitialized SharedImmutable', async () => { - await contract.methods.initialize_shared_immutable(1).send().wait(); - const returnsConstrained = await contract.methods.get_shared_immutable_constrained_private().viewConstrained(); - const returnsUnconstrained = await contract.methods.get_shared_immutable().view(); - - console.log(`Return values from private constrained:`, returnsConstrained); - console.log(`Return values from unconstrained:`, returnsUnconstrained); - - console.log(await contract.methods.get_message_sender().viewConstrained()); - - console.log(await contract.methods.multicall().viewConstrained()); - }); - - it('public read of uninitialized SharedImmutable', async () => { - DocsExampleContract.artifact.functions.forEach(fn => { - const sig = decodeFunctionSignature(fn.name, fn.parameters); - logger(`Function ${sig} and the selector: ${FunctionSelector.fromNameAndParameters(fn.name, fn.parameters)}`); - }); - - // await contract.methods.initialize_shared_immutable(1).send().wait(); - // console.log(await contract.methods.get_shared_immutable_constrained().viewConstrained()); - console.log(await contract.methods.get_message_sender_public().viewConstrained()); - }); - it('private read of uninitialized SharedImmutable', async () => { const s = await contract.methods.get_shared_immutable().view(); @@ -53,12 +33,35 @@ describe('e2e_state_vars', () => { await contract.methods.match_shared_immutable(s.account, s.points).send().wait(); }); - it('private read of initialized SharedImmutable', async () => { + it('private read of SharedImmutable', async () => { await contract.methods.initialize_shared_immutable(1).send().wait(); - const s = await contract.methods.get_shared_immutable().view(); - await contract.methods.match_shared_immutable(s.account, s.points).send().wait(); - }, 200_000); + const a = await contract.methods.get_shared_immutable_constrained_private().viewConstrained(); + const b = await contract.methods.get_shared_immutable_constrained_private_indirect().viewConstrained(); + const c = await contract.methods.get_shared_immutable().view(); + + expect((a as any)[0]).toEqual((c as any)['account'].toBigInt()); + expect((a as any)[1]).toEqual((c as any)['points']); + expect((b as any)[0]).toEqual((c as any)['account'].toBigInt()); + expect((b as any)[1]).toEqual((c as any)['points']); + + expect(a).toEqual(b); + await contract.methods.match_shared_immutable(c.account, c.points).send().wait(); + }); + + it('public read of SharedImmutable', async () => { + const a = await contract.methods.get_shared_immutable_constrained().viewConstrained(); + const b = await contract.methods.get_shared_immutable_constrained_indirect().viewConstrained(); + const c = await contract.methods.get_shared_immutable().view(); + + expect((a as any)[0]).toEqual((c as any)['account'].toBigInt()); + expect((a as any)[1]).toEqual((c as any)['points']); + expect((b as any)[0]).toEqual((c as any)['account'].toBigInt()); + expect((b as any)[1]).toEqual((c as any)['points']); + + expect(a).toEqual(b); + await contract.methods.match_shared_immutable(c.account, c.points).send().wait(); + }); it('initializing SharedImmutable the second time should fail', async () => { // Jest executes the tests sequentially and the first call to initialize_shared_immutable was executed diff --git a/yarn-project/foundation/src/abi/decoder.ts b/yarn-project/foundation/src/abi/decoder.ts index e1f4558afa2..a898334a8d0 100644 --- a/yarn-project/foundation/src/abi/decoder.ts +++ b/yarn-project/foundation/src/abi/decoder.ts @@ -7,6 +7,7 @@ import { isAztecAddressStruct } from './utils.js'; * The type of our decoded ABI. */ export type DecodedReturn = bigint | boolean | AztecAddress | DecodedReturn[] | { [key: string]: DecodedReturn }; +export type ProcessReturnValues = (DecodedReturn | undefined)[] | undefined; /** * Decodes return values from a function call. diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index 6a9ea418a96..87f80e25c14 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -37,7 +37,13 @@ import { getContractClassFromArtifact, } from '@aztec/circuits.js'; import { computeCommitmentNonce, siloNullifier } from '@aztec/circuits.js/hash'; -import { ContractArtifact, DecodedReturn, FunctionSelector, encodeArguments } from '@aztec/foundation/abi'; +import { + ContractArtifact, + DecodedReturn, + FunctionSelector, + ProcessReturnValues, + encodeArguments, +} from '@aztec/foundation/abi'; import { arrayNonEmptyLength, padArrayEnd } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; import { SerialQueue } from '@aztec/foundation/fifo'; @@ -420,10 +426,8 @@ export class PXEService implements PXE { const simulatePublic = msgSender === undefined; const vue = await this.#simulateCall(txRequest, msgSender); if (simulatePublic) { - await this.#simulatePublicCalls(vue.tx); - // console.log(returns); - /*const t = returns[0]; - vue.rv = t && t[0];*/ + // Only one transaction, so we can take index 0. + vue.publicReturnValues = (await this.#simulatePublicCalls(vue.tx))[0]; } return vue; }); @@ -464,8 +468,8 @@ export class PXEService implements PXE { `Needs setup: ${publicInputs.needsSetup}, needs app logic: ${publicInputs.needsAppLogic}, needs teardown: ${publicInputs.needsTeardown}`, ); - const encryptedLogs = new TxL2Logs(collectEncryptedLogs(executionResult)); - const unencryptedLogs = new TxL2Logs(collectUnencryptedLogs(executionResult)); + const encryptedLogs = new EncryptedTxL2Logs(collectEncryptedLogs(executionResult)); + const unencryptedLogs = new UnencryptedTxL2Logs(collectUnencryptedLogs(executionResult)); const enqueuedPublicFunctions = collectEnqueuedPublicFunctionCalls(executionResult); // HACK(#1639): Manually patches the ordering of the public call stack @@ -474,7 +478,10 @@ export class PXEService implements PXE { const tx = new Tx(publicInputs, proof, encryptedLogs, unencryptedLogs, enqueuedPublicFunctions); - return new Vue(tx, executionResult.returnValues); + // TODO - Consider whether it would be possible to abuse this to make a multicall + const privateReturn: ProcessReturnValues = [executionResult.returnValues]; + + return new Vue(tx, privateReturn); } public async sendTx(tx: Tx): Promise { @@ -641,7 +648,7 @@ export class PXEService implements PXE { */ async #simulatePublicCalls(tx: Tx) { try { - await this.node.simulatePublicCalls(tx); + return await this.node.simulatePublicCalls(tx); } catch (err) { // Try to fill in the noir call stack since the PXE may have access to the debug metadata if (err instanceof SimulationError) { diff --git a/yarn-project/sequencer-client/src/sequencer/abstract_phase_manager.ts b/yarn-project/sequencer-client/src/sequencer/abstract_phase_manager.ts index 6508ec26618..7300b465ed2 100644 --- a/yarn-project/sequencer-client/src/sequencer/abstract_phase_manager.ts +++ b/yarn-project/sequencer-client/src/sequencer/abstract_phase_manager.ts @@ -42,6 +42,13 @@ import { makeEmptyProof, } from '@aztec/circuits.js'; import { computeVarArgsHash } from '@aztec/circuits.js/hash'; +import { + ABIType, + DecodedReturn, + FunctionArtifact, + ProcessReturnValues, + decodeReturnValues, +} from '@aztec/foundation/abi'; import { arrayNonEmptyLength, padArrayEnd } from '@aztec/foundation/collection'; import { DebugLogger, createDebugLogger } from '@aztec/foundation/log'; import { Tuple } from '@aztec/foundation/serialize'; @@ -110,6 +117,7 @@ export abstract class AbstractPhaseManager { * revert reason, if any */ revertReason: SimulationError | undefined; + returnValues: ProcessReturnValues; }>; public static extractEnqueuedPublicCallsByPhase( @@ -180,14 +188,22 @@ export abstract class AbstractPhaseManager { tx: Tx, previousPublicKernelOutput: PublicKernelCircuitPublicInputs, previousPublicKernelProof: Proof, - ): Promise<[PublicKernelCircuitPublicInputs, Proof, UnencryptedFunctionL2Logs[], SimulationError | undefined]> { + ): Promise< + [ + PublicKernelCircuitPublicInputs, + Proof, + UnencryptedFunctionL2Logs[], + SimulationError | undefined, + ProcessReturnValues, + ] + > { let kernelOutput = previousPublicKernelOutput; let kernelProof = previousPublicKernelProof; const enqueuedCalls = this.extractEnqueuedPublicCalls(tx); if (!enqueuedCalls || !enqueuedCalls.length) { - return [kernelOutput, kernelProof, [], undefined]; + return [kernelOutput, kernelProof, [], undefined, undefined]; } const newUnencryptedFunctionLogs: UnencryptedFunctionL2Logs[] = []; @@ -196,9 +212,13 @@ export abstract class AbstractPhaseManager { // separate public callstacks to be proven by separate public kernel sequences // and submitted separately to the base rollup? + const returns = []; + for (const enqueuedCall of enqueuedCalls) { const executionStack: (PublicExecution | PublicExecutionResult)[] = [enqueuedCall]; + let currentReturn: DecodedReturn | undefined = undefined; + // Keep track of which result is for the top/enqueued call let enqueuedExecutionResult: PublicExecutionResult | undefined; @@ -252,22 +272,30 @@ export abstract class AbstractPhaseManager { result.revertReason }`, ); - return [kernelOutput, kernelProof, [], result.revertReason]; + return [kernelOutput, kernelProof, [], result.revertReason, undefined]; } if (!enqueuedExecutionResult) { enqueuedExecutionResult = result; + + // @todo @lherskind We need to get the proper artifact here + const returnTypes: ABIType[] = [{ kind: 'array', length: 4, type: { kind: 'field' } }]; + const mockArtifact = { returnTypes } as any as FunctionArtifact; + + currentReturn = decodeReturnValues(mockArtifact, result.returnValues); } } // HACK(#1622): Manually patches the ordering of public state actions // TODO(#757): Enforce proper ordering of public state actions patchPublicStorageActionOrdering(kernelOutput, enqueuedExecutionResult!, this.phase); + + returns.push(currentReturn); } // TODO(#3675): This should be done in a public kernel circuit removeRedundantPublicDataWrites(kernelOutput); - return [kernelOutput, kernelProof, newUnencryptedFunctionLogs, undefined]; + return [kernelOutput, kernelProof, newUnencryptedFunctionLogs, undefined, returns]; } protected async runKernelCircuit( diff --git a/yarn-project/sequencer-client/src/sequencer/app_logic_phase_manager.ts b/yarn-project/sequencer-client/src/sequencer/app_logic_phase_manager.ts index 9ba3cf97196..967e4013ed3 100644 --- a/yarn-project/sequencer-client/src/sequencer/app_logic_phase_manager.ts +++ b/yarn-project/sequencer-client/src/sequencer/app_logic_phase_manager.ts @@ -35,7 +35,7 @@ export class AppLogicPhaseManager extends AbstractPhaseManager { // TODO(@spalladino): Should we allow emitting contracts in the fee preparation phase? this.log(`Processing tx ${tx.getTxHash()}`); await this.publicContractsDB.addNewContracts(tx); - const [publicKernelOutput, publicKernelProof, newUnencryptedFunctionLogs, revertReason] = + const [publicKernelOutput, publicKernelProof, newUnencryptedFunctionLogs, revertReason, returnValues] = await this.processEnqueuedPublicCalls(tx, previousPublicKernelOutput, previousPublicKernelProof).catch( // if we throw for any reason other than simulation, we need to rollback and drop the TX async err => { @@ -52,6 +52,6 @@ export class AppLogicPhaseManager extends AbstractPhaseManager { await this.publicStateDB.checkpoint(); } - return { publicKernelOutput, publicKernelProof, revertReason }; + return { publicKernelOutput, publicKernelProof, revertReason, returnValues }; } } diff --git a/yarn-project/sequencer-client/src/sequencer/public_processor.ts b/yarn-project/sequencer-client/src/sequencer/public_processor.ts index bb0b3dfe93a..819f922121b 100644 --- a/yarn-project/sequencer-client/src/sequencer/public_processor.ts +++ b/yarn-project/sequencer-client/src/sequencer/public_processor.ts @@ -11,6 +11,7 @@ import { } from '@aztec/circuit-types'; import { TxSequencerProcessingStats } from '@aztec/circuit-types/stats'; import { GlobalVariables, Header } from '@aztec/circuits.js'; +import { ProcessReturnValues } from '@aztec/foundation/abi'; import { createDebugLogger } from '@aztec/foundation/log'; import { Timer } from '@aztec/foundation/timer'; import { PublicExecutor, PublicStateDB, SimulationProvider } from '@aztec/simulator'; @@ -20,7 +21,7 @@ import { MerkleTreeOperations } from '@aztec/world-state'; import { PublicKernelCircuitSimulator } from '../simulator/index.js'; import { ContractsDataSourcePublicDB, WorldStateDB, WorldStatePublicDB } from '../simulator/public_executor.js'; import { RealPublicKernelCircuitSimulator } from '../simulator/public_kernel.js'; -import { AbstractPhaseManager } from './abstract_phase_manager.js'; +import { AbstractPhaseManager, PublicKernelPhase } from './abstract_phase_manager.js'; import { PhaseManagerFactory } from './phase_manager_factory.js'; /** @@ -84,13 +85,15 @@ export class PublicProcessor { * @param txs - Txs to process. * @returns The list of processed txs with their circuit simulation outputs. */ - public async process(txs: Tx[]): Promise<[ProcessedTx[], FailedTx[]]> { + public async process(txs: Tx[]): Promise<[ProcessedTx[], FailedTx[], ProcessReturnValues[]]> { // The processor modifies the tx objects in place, so we need to clone them. txs = txs.map(tx => Tx.clone(tx)); const result: ProcessedTx[] = []; const failed: FailedTx[] = []; + const returns: ProcessReturnValues[] = []; for (const tx of txs) { + let returnValues: ProcessReturnValues = undefined; let phase: AbstractPhaseManager | undefined = PhaseManagerFactory.phaseFromTx( tx, this.db, @@ -108,6 +111,9 @@ export class PublicProcessor { try { while (phase) { const output = await phase.handle(tx, publicKernelPublicInput, proof); + if (phase.phase === PublicKernelPhase.APP_LOGIC) { + returnValues = output.returnValues; + } publicKernelPublicInput = output.publicKernelOutput; proof = output.publicKernelProof; revertReason ??= output.revertReason; @@ -128,6 +134,7 @@ export class PublicProcessor { validateProcessedTx(processedTransaction); result.push(processedTransaction); + returns.push(returnValues); this.log(`Processed public part of ${tx.data.endNonRevertibleData.newNullifiers[0].value}`, { eventName: 'tx-sequencer-processing', @@ -146,10 +153,11 @@ export class PublicProcessor { tx, error: err instanceof Error ? err : new Error(errorMessage), }); + returns.push([]); } } - return [result, failed]; + return [result, failed, returns]; } /** diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts index ed46187cd94..6a7542cc300 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts @@ -71,7 +71,7 @@ describe('sequencer', () => { }); publicProcessor = mock({ - process: async txs => [await Promise.all(txs.map(tx => makeProcessedTx(tx))), []], + process: async txs => [await Promise.all(txs.map(tx => makeProcessedTx(tx))), [], []], makeEmptyProcessedTx: () => makeEmptyProcessedTx(Header.empty(), chainId, version), }); diff --git a/yarn-project/sequencer-client/src/sequencer/setup_phase_manager.ts b/yarn-project/sequencer-client/src/sequencer/setup_phase_manager.ts index 76da4e232a6..c5eb00e3c03 100644 --- a/yarn-project/sequencer-client/src/sequencer/setup_phase_manager.ts +++ b/yarn-project/sequencer-client/src/sequencer/setup_phase_manager.ts @@ -40,6 +40,6 @@ export class SetupPhaseManager extends AbstractPhaseManager { ); tx.unencryptedLogs.addFunctionLogs(newUnencryptedFunctionLogs); await this.publicStateDB.checkpoint(); - return { publicKernelOutput, publicKernelProof, revertReason }; + return { publicKernelOutput, publicKernelProof, revertReason, returnValues: undefined }; } } diff --git a/yarn-project/sequencer-client/src/sequencer/tail_phase_manager.ts b/yarn-project/sequencer-client/src/sequencer/tail_phase_manager.ts index 0fe236452d9..91fbedcd541 100644 --- a/yarn-project/sequencer-client/src/sequencer/tail_phase_manager.ts +++ b/yarn-project/sequencer-client/src/sequencer/tail_phase_manager.ts @@ -37,6 +37,6 @@ export class TailPhaseManager extends AbstractPhaseManager { // commit the state updates from this transaction await this.publicStateDB.commit(); - return { publicKernelOutput, publicKernelProof, revertReason: undefined }; + return { publicKernelOutput, publicKernelProof, revertReason: undefined, returnValues: undefined}; } } diff --git a/yarn-project/sequencer-client/src/sequencer/teardown_phase_manager.ts b/yarn-project/sequencer-client/src/sequencer/teardown_phase_manager.ts index ddaaa7c8943..bc712cb2d41 100644 --- a/yarn-project/sequencer-client/src/sequencer/teardown_phase_manager.ts +++ b/yarn-project/sequencer-client/src/sequencer/teardown_phase_manager.ts @@ -40,6 +40,6 @@ export class TeardownPhaseManager extends AbstractPhaseManager { ); tx.unencryptedLogs.addFunctionLogs(newUnencryptedFunctionLogs); await this.publicStateDB.checkpoint(); - return { publicKernelOutput, publicKernelProof, revertReason }; + return { publicKernelOutput, publicKernelProof, revertReason, returnValues: undefined }; } }