apollo_starknet_os_program: apply v0.14.3 OS-core audit review comments#14870
Draft
Yoni-Starkware wants to merge 1 commit into
Draft
apollo_starknet_os_program: apply v0.14.3 OS-core audit review comments#14870Yoni-Starkware wants to merge 1 commit into
Yoni-Starkware wants to merge 1 commit into
Conversation
Documentation clarifications plus one redundant-code removal from the audit review on PR #14827. Verified bytecode-neutral: after a clean rebuild the compiled os / virtual_os program hashes and bytecode lengths are unchanged. - naive_blake.cairo: document the u32 range-check and canonical-value assumptions of the felt<->u32 encoding helpers and their entrypoints. - syscall_impls.cairo: align the sha512 relocation comment with sha256's. - os_config.cairo: trim the config-hash comment; drop the redundant `tempvar hash_state = hash_state;` in the if branch (the compiler already aligns the stack) and label the remaining else-branch alignment tempvar. - state.cairo: document why the alias contract's storage cannot be accessed before the separate squash. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Yoni-Starkware
force-pushed
the
worktree-audit-v0.14.3-doc-fixes
branch
from
July 22, 2026 08:22
05741e7 to
be78af9
Compare
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.
Purpose
Applies the action items from the v0.14.3 OS audit review (PR #14827), over
main.Verified bytecode-neutral: after
cargo clean -p apollo_starknet_os_program+ full rebuild, the compiledos/virtual_osprogram hashes and bytecode lengths are unchanged. No fixture regeneration.Audit comments addressed (8 of 10)
naive_blake.cairofelt_from_le_u32sassumes each limb is a valid u32; caller/Blake opcode guarantees itnaive_blake.caironaive_blake.cairoexecution/syscall_impls.cairoos_config/os_config.cairoos_config/os_config.cairotempvar hash_state = hash_state;in the if branch (compiler already aligns the stack) — confirmed no bytecode changeos_config/os_config.cairostate/state.cairoNot included
calc_naive_blake_hashis unused on main, but it is not dead code: it was added via apollo_starknet_os_program,starknet_os: add calc_naive_blake_hash with unit test #13201 (with an#[ignore]d cross-check test whose TODO says "remove#[ignore]oncecalc_naive_blake_hashis used in the virtual OS program"), and its real consumer lives on the unmerged branchyonatan/virtual-os-blake-message-hash(Poseidon→Blake2s for virtual-OS L2→L1 message hashes). Kept as-is. (The reviewer's alternative — repurposing it into the config hash — would change the config-hash value, a protocol change, out of scope here.)blake_with_opcode" targets the cairo-lang library (starkware/cairo/common/cairo_blake2s/blake2s.cairo), not this repo; belongs in the cairo-lang mirror PR.Verification
cargo test -p apollo_starknet_os_program(after clean rebuild) — 6 passed / 0 failed:test_program_hashes,test_program_bytecode_lengths,test_os_constants,test_cairo0_formatting,test_virtual_os_swapped_files,test_get_code_snippet.🤖 Generated with Claude Code