-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(avm-simulator): always set revertReason when reverting (#6297)
Part of the current setup seems to assume that a simulation reverts if and only if there's a revertReason. This is why some e2e tests were failing to see the revert (and throw an exception) when the revert message was empty. Example ```ts /** * Makes a processed tx out of source tx. * @param tx - Source tx. * @param kernelOutput - Output of the kernel circuit simulation for this tx. * @param proof - Proof of the kernel circuit for this tx. */ export function makeProcessedTx( tx: Tx, kernelOutput: KernelCircuitPublicInputs, proof: Proof, publicKernelRequests: PublicKernelRequest[], revertReason?: SimulationError, gasUsed: ProcessedTx['gasUsed'] = {}, ): ProcessedTx { return { hash: tx.getTxHash(), data: kernelOutput, proof, encryptedLogs: revertReason ? EncryptedTxL2Logs.empty() : tx.encryptedLogs, unencryptedLogs: revertReason ? UnencryptedTxL2Logs.empty() : tx.unencryptedLogs, isEmpty: false, revertReason, publicKernelRequests, gasUsed, }; } ``` cc @just-mitch because I see his name in some parts of the code.
- Loading branch information
Showing
5 changed files
with
28 additions
and
17 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
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