From 3516654bfe77373fd4c78a5c24e87d57341c0c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= <38285177+OlivierBBB@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:03:15 +0200 Subject: [PATCH] Basic HUB debugging (#1413) --- .../net/consensys/linea/zktracer/module/hub/Hub.java | 2 +- .../module/hub/fragment/common/CommonFragment.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java index 93ec4cdaaf..a67ffae2d6 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java @@ -869,7 +869,7 @@ public final MessageFrame messageFrame() { private void handleStack(MessageFrame frame) { this.currentFrame() .stack() - .processInstruction(this, frame, MULTIPLIER___STACK_HEIGHT * stamp()); + .processInstruction(this, frame, MULTIPLIER___STACK_HEIGHT * (stamp() + 1)); } void triggerModules(MessageFrame frame) { diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragment.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragment.java index 489a24be1e..49623bffea 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragment.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragment.java @@ -93,8 +93,14 @@ public Trace trace(Trace trace) { .codeFragmentIndex(commonFragmentValues.codeFragmentIndex) .programCounter(commonFragmentValues.pc) .programCounterNew(commonFragmentValues.pcNew) - .height(commonFragmentValues.height) - .heightNew(commonFragmentValues.heightNew) + .height( + commonFragmentValues.hubProcessingPhase == HubProcessingPhase.TX_EXEC + ? commonFragmentValues.height + : 0) + .heightNew( + commonFragmentValues.hubProcessingPhase == HubProcessingPhase.TX_EXEC + ? commonFragmentValues.heightNew + : 0) // peeking flags are traced in the respective fragments .gasExpected(Bytes.ofUnsignedLong(commonFragmentValues.gasExpected)) .gasActual(Bytes.ofUnsignedLong(commonFragmentValues.gasActual))