fix: no-gas execute public-value digest extraction (#2780)#2782
Open
Kuhai9801 wants to merge 1 commit into
Open
fix: no-gas execute public-value digest extraction (#2780)#2782Kuhai9801 wants to merge 1 commit into
Kuhai9801 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: no-gas execute public-value digest extraction (#2780)
Summary
Fixes
execute().calculate_gas(false)returningFailed to extract public value digestafter 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,FinalVmStatestays unset and execution fails after the guest has completed successfully.This change records the public-value digest words emitted by guest
COMMITsyscalls during minimal execution and uses those words when gas replay is disabled. The gas-enabled path continues to useFinalVmState.What Changed
PV_DIGEST_NUM_WORDSfromsp1-primitives::constsand keep the existingsp1_hypercube::airre-export.FinalVmStatefor gas-enabled execution and the minimal-execution digest for no-gas execution.COMMITdigest indices by checking the write before updating the digest array.test_execute_with_optional_gasto 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:succinctlabs/sp1@5c7f4e50759e482359c3b74316d1712cf0726ad7codex/fix-no-gas-public-value-digestChecks run locally on this branch:
Notes For Maintainers
This intentionally does not recompute the digest from
SP1PublicValueson the host. The guest/runtime already commits digest words throughCOMMIT; preserving those words keeps SHA and BLAKE3 public-value behavior aligned with the gas-enabled path.Closes #2780.