Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions yarn-project/simulator/src/avm/avm_simulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export class AvmSimulator {
const revertReason = reverted ? await revertReasonFromExplicitRevert(output, this.context) : undefined;
const results = new AvmContractCallResult(reverted, output, machineState.gasLeft, revertReason);
this.log.debug(`Context execution results: ${results.toString()}`);
this.log.debug(`Executed ${instrCounter} instructions`);

this.tallyPrintFunction();
// Return results for processing by calling context
Expand Down
5 changes: 3 additions & 2 deletions yarn-project/simulator/src/avm/journal/journal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@ export class AvmPersistableStateManager {
this.publicStorage.acceptAndMerge(forkedState.publicStorage);
this.nullifiers.acceptAndMerge(forkedState.nullifiers);
this.trace.merge(forkedState.trace, reverted);
if (!reverted) {
this.merkleTrees = forkedState.merkleTrees;
if (reverted) {
if (this.doMerkleOperations) {
this.log.debug(
`Rolled back nullifier tree to root ${this.merkleTrees.treeMap.get(MerkleTreeId.NULLIFIER_TREE)!.getRoot()}`,
);
}
} else {
this.merkleTrees = forkedState.merkleTrees;
Comment on lines -127 to +134

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This print was wrong. We rollback on revert.

}
}

Expand Down