docs(lstar): clarify verify_signatures and ban "# Why:" labels - #917
Merged
tcoratger merged 1 commit intoJun 10, 2026
Merged
Conversation
Tighten the documentation in the lstar block signature verifier: - Rewrite the docstring to spell out the proof contract (the proof holds neither keys nor messages, so the caller rebuilds both) and show the two parallel lists as a layout diagram. - Correct the `Raises:` section: the function raises SpecRejectionError with one of three concrete reasons, not a bare AssertionError. - Add lean, glued one-line comments to each body step (key resolution, message binding, proposer entry, proof check), one sentence per line. - Drop a redundant to_validator_indices() recomputation and rename the loop variables to voter_index/voter_indices to disambiguate from the proposer. Also ban the "# Why:" inline-comment label in the documentation rules: a comment only exists when the reason is non-obvious, so the label is redundant noise. State the reason directly as plain prose. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Documentation-only cleanup of the lstar block signature verifier (
verify_signatures), plus a small readability refactor of its body and one new documentation rule.Raises:— the function raisesSpecRejectionErrorwith one of three concrete reasons (VALIDATOR_INDEX_OUT_OF_RANGE,PROPOSER_INDEX_OUT_OF_RANGE,INVALID_BLOCK_PROOF), not a bareAssertionError. Clients assert on.reason, so the docstring now names the real contract.to_validator_indices()recomputation and rename the loop variables tovoter_index/voter_indicesto disambiguate from the proposer index. No behavior change.# Why:inline-comment label. A comment only exists when the reason is non-obvious, so the label is redundant noise; state the reason directly as plain prose.Testing
just checkpasses (ruff lint, ruff format, ty, codespell, mdformat). No behavior change, so no fixtures regenerated.🤖 Generated with Claude Code