Skip to content

fix: no-gas execute public-value digest extraction (#2780)#2782

Open
Kuhai9801 wants to merge 1 commit into
succinctlabs:mainfrom
Kuhai9801:codex/fix-no-gas-public-value-digest
Open

fix: no-gas execute public-value digest extraction (#2780)#2782
Kuhai9801 wants to merge 1 commit into
succinctlabs:mainfrom
Kuhai9801:codex/fix-no-gas-public-value-digest

Conversation

@Kuhai9801
Copy link
Copy Markdown

@Kuhai9801 Kuhai9801 commented May 8, 2026

fix: no-gas execute public-value digest extraction (#2780)

Summary

Fixes execute().calculate_gas(false) returning Failed to extract public value digest after a guest successfully commits public values.

The no-gas path still runs the minimal executor and produces public values, but it skips gas replay. Before this change, digest extraction always required FinalVmState, which is only populated by the gas-executing worker. With gas disabled, FinalVmState stays unset and execution fails after the guest has completed successfully.

This change records the public-value digest words emitted by guest COMMIT syscalls during minimal execution and uses those words when gas replay is disabled. The gas-enabled path continues to use FinalVmState.

What Changed

  • Track committed public-value digest words in the minimal executor.
  • Share PV_DIGEST_NUM_WORDS from sp1-primitives::consts and keep the existing sp1_hypercube::air re-export.
  • Thread the digest through portable, x86_64/JIT, native runner, and runner-binary paths.
  • Use FinalVmState for gas-enabled execution and the minimal-execution digest for no-gas execution.
  • Avoid panicking on malformed minimal-executor COMMIT digest indices by checking the write before updating the digest array.
  • Expand test_execute_with_optional_gas to compare gas/no-gas behavior for both SHA and BLAKE3 public-value digest modes.

Why

calculate_gas(false) is intended to skip gas accounting while still returning committed public values. On the affected path, the guest can successfully commit public values, but the host returns an error because digest extraction depends on state that the skipped gas worker would have populated.

Validation

Local branch is based on current upstream main:

  • base: succinctlabs/sp1@5c7f4e50759e482359c3b74316d1712cf0726ad7
  • branch: codex/fix-no-gas-public-value-digest

Checks run locally on this branch:

git diff --check
cargo check -p sp1-jit --target x86_64-unknown-linux-gnu
cargo check -p sp1-core-executor --target x86_64-unknown-linux-gnu

Notes For Maintainers

This intentionally does not recompute the digest from SP1PublicValues on the host. The guest/runtime already commits digest words through COMMIT; preserving those words keeps SHA and BLAKE3 public-value behavior aligned with the gas-enabled path.

Closes #2780.

@Kuhai9801 Kuhai9801 changed the title Fix #2780: no-gas execute public-value digest extraction fix: no-gas execute public-value digest extraction (#2780) May 8, 2026
@Kuhai9801 Kuhai9801 marked this pull request as ready for review May 12, 2026 11:09
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.

execute().calculate_gas(false) returns "Failed to extract public value digest" on a clean guest run (v6.1.0)

1 participant