Skip to content

fix(handler): call discard_tx() on custom halt to reset warm slots#206

Merged
cdrappi merged 2 commits intoveridise-audit-feb-2026from
cdai__ver-842
Mar 6, 2026
Merged

fix(handler): call discard_tx() on custom halt to reset warm slots#206
cdrappi merged 2 commits intoveridise-audit-feb-2026from
cdai__ver-842

Conversation

@drappi-ai
Copy link
Contributor

Re-opening #200 with rebase merge (was accidentally squash-merged).

Summary

Fixes Veridise audit issue VER-842: slot warmness persisting across transactions.

The custom halt path in execution_result() returned early without calling discard_tx(), so transaction_id was never advanced and warm/cold slot tracking carried over to subsequent transactions. This could cause undercharged gas for slots that should be cold.

  • Add discard_tx() call to the SeismicHaltReason halt path, matching the cleanup in catch_error()
  • Add regression test that asserts transaction_id advances after a custom halt

Test plan

  • New test fails without the fix, passes with it
  • All existing handler tests pass

Verify that transaction_id advances after a SeismicHaltReason halt,
which proves discard_tx() is called and warm/cold slot tracking is
properly reset between transactions.
The custom halt path in execution_result() returned early without
calling discard_tx(), leaving transaction_id un-advanced and warm/cold
slot tracking stale. A subsequent transaction reusing the same EVM
context would see previously warmed slots as warm, undercharging gas.

Add discard_tx() to the SeismicHaltReason halt path, matching the
cleanup already performed in catch_error().
@drappi-ai drappi-ai requested a review from cdrappi as a code owner March 6, 2026 20:00
@cdrappi cdrappi merged commit 90194cf into veridise-audit-feb-2026 Mar 6, 2026
12 checks passed
@cdrappi cdrappi deleted the cdai__ver-842 branch March 6, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants