Skip to content

Conversation

@Tristan-Wilson
Copy link
Member

The Solidity executeValidatePreimage function was missing validations present in the equivalent Rust ValidateCertificate opcode handler.

  • Add check for preimageType > 255, setting ERRORED status
  • Add check for preimageType 4-255, returning 0 without memory access
  • Add ptr validation using isValidLeaf() before memory proof
  • Reorder operations to validate preimageType before memory access

The Solidity executeValidatePreimage function was missing validations
present in the equivalent Rust ValidateCertificate opcode handler.

- Add check for preimageType > 255, setting ERRORED status
- Add check for preimageType 4-255, returning 0 without memory access
- Add ptr validation using isValidLeaf() before memory proof
- Reorder operations to validate preimageType before memory access
@gzeoneth gzeoneth changed the base branch from develop to release-3.2.0 December 29, 2025 14:50
@OffchainLabs OffchainLabs deleted a comment from sherlock-ai-beta bot Dec 29, 2025
Tristan-Wilson and others added 5 commits December 31, 2025 10:42
… of ERRORED

When preimageType exceeds 255 (can't fit in u8), the Rust execution code
uses the ? operator to propagate an error from step_n(), rather than
calling error!() which would set MachineStatus::Errored. The Solidity
one-step prover should match this behavior by reverting (proof is invalid)
rather than setting ERRORED (valid machine state transition).
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.

3 participants