Skip to content

Commit

Permalink
chore: fix unencrypted logs mismatch for AVM with a +4 (#6580)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanks12 authored May 21, 2024
1 parent 221e247 commit da82b58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions yarn-project/circuit-types/src/logs/unencrypted_l2_log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class UnencryptedL2Log {
) {}

get length(): number {
// TODO(6578): explain magic number 4 here
return EventSelector.SIZE + this.data.length + AztecAddress.SIZE_IN_BYTES + 4;
}

Expand Down
3 changes: 2 additions & 1 deletion yarn-project/simulator/src/avm/journal/journal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ export class AvmPersistableStateManager {
this.transitionalExecutionResult.allUnencryptedLogs.push(ulog);
// this duplicates exactly what happens in the trace just for the purpose of transitional integration with the kernel
this.transitionalExecutionResult.unencryptedLogsHashes.push(
new LogHash(logHash, this.trace.accessCounter, new Fr(ulog.length)),
// TODO(6578): explain magic number 4 here
new LogHash(logHash, this.trace.accessCounter, new Fr(ulog.length + 4)),
);
// TODO(6206): likely need to track this here and not just in the transitional logic.

Expand Down

0 comments on commit da82b58

Please sign in to comment.