-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove EOAs in all e2e tests * Increase timeout for e2e test * Add helper for deploying multiple L2 contracts in parallel * Fix private kernel and enqueued public executions * Revert helper due to incomprehensible CI error * Re-enable test moving dev dep to production dependency (I'll never understand build system) * Do not assume address is derived from pubkey in cross chain test * Use EOAs for p2p test * Add comment on private kernel fix
- Loading branch information
1 parent
27dc70f
commit 72524f8
Showing
27 changed files
with
399 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
yarn-project/acir-simulator/src/client/execution_result.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { PrivateCallStackItem, PublicCallRequest } from '@aztec/circuits.js'; | ||
import { Fr } from '@aztec/foundation/fields'; | ||
import { FunctionL2Logs } from '@aztec/types'; | ||
import { ACVMField } from '../acvm/index.js'; | ||
|
||
/** | ||
* The contents of a new note. | ||
*/ | ||
export interface NewNoteData { | ||
/** The preimage of the note. */ | ||
preimage: Fr[]; | ||
/** The storage slot of the note. */ | ||
storageSlot: Fr; | ||
/** The note owner. */ | ||
owner: { | ||
/** The x coordinate. */ | ||
x: Fr; | ||
/** The y coordinate. */ | ||
y: Fr; | ||
}; | ||
} | ||
|
||
/** | ||
* The contents of a nullified commitment. | ||
*/ | ||
export interface NewNullifierData { | ||
/** The preimage of the nullified commitment. */ | ||
preimage: Fr[]; | ||
/** The storage slot of the nullified commitment. */ | ||
storageSlot: Fr; | ||
/** The nullifier. */ | ||
nullifier: Fr; | ||
} | ||
|
||
/** | ||
* The preimages of the executed function. | ||
*/ | ||
export interface ExecutionPreimages { | ||
/** The preimages of the new notes. */ | ||
newNotes: NewNoteData[]; | ||
/** The preimages of the nullified commitments. */ | ||
nullifiedNotes: NewNullifierData[]; | ||
} | ||
|
||
/** | ||
* The result of executing a private function. | ||
*/ | ||
export interface ExecutionResult { | ||
// Needed for prover | ||
/** The ACIR bytecode. */ | ||
acir: Buffer; | ||
/** The verification key. */ | ||
vk: Buffer; | ||
/** The partial witness. */ | ||
partialWitness: Map<number, ACVMField>; | ||
// Needed for the verifier (kernel) | ||
/** The call stack item. */ | ||
callStackItem: PrivateCallStackItem; | ||
/** The indices (in private data tree) for commitments corresponding to read requests. */ | ||
readRequestCommitmentIndices: bigint[]; | ||
// Needed for the user | ||
/** The preimages of the executed function. */ | ||
preimages: ExecutionPreimages; | ||
/** The decoded return values of the executed function. */ | ||
returnValues: any[]; | ||
/** The nested executions. */ | ||
nestedExecutions: this[]; | ||
/** Enqueued public function execution requests to be picked up by the sequencer. */ | ||
enqueuedPublicFunctionCalls: PublicCallRequest[]; | ||
/** | ||
* Encrypted logs emitted during execution of this function call. | ||
* Note: These are preimages to `encryptedLogsHash`. | ||
*/ | ||
encryptedLogs: FunctionL2Logs; | ||
} | ||
|
||
/** | ||
* Collect all encrypted logs across all nested executions. | ||
* @param execResult - The topmost execution result. | ||
* @returns All encrypted logs. | ||
*/ | ||
export function collectEncryptedLogs(execResult: ExecutionResult): FunctionL2Logs[] { | ||
return [execResult.encryptedLogs, ...execResult.nestedExecutions.flatMap(collectEncryptedLogs)]; | ||
} | ||
|
||
/** | ||
* Collect all enqueued public function calls across all nested executions. | ||
* @param execResult - The topmost execution result. | ||
* @returns All enqueued public function calls. | ||
*/ | ||
export function collectEnqueuedPublicFunctionCalls(execResult: ExecutionResult): PublicCallRequest[] { | ||
return [ | ||
...execResult.enqueuedPublicFunctionCalls, | ||
...execResult.nestedExecutions.flatMap(collectEnqueuedPublicFunctionCalls), | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './private_execution.js'; | ||
export * from './simulator.js'; | ||
export * from './db_oracle.js'; | ||
export * from './execution_result.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.