docs: correct doc comments that describe behaviour the code does not have - #136
Open
0xrlawrence wants to merge 1 commit into
Open
docs: correct doc comments that describe behaviour the code does not have#1360xrlawrence wants to merge 1 commit into
0xrlawrence wants to merge 1 commit into
Conversation
…have Four comments that a reader would reasonably act on, each contradicted by the code immediately below it. - pallet-validator-set documents a bond it never takes. The module header attributes spam resistance partly to a bond, `ApprovedValidators` says approval happens "after bond", and `PendingValidators` describes its entries as having a "bond locked". `register_validator` locks nothing and there is no currency dependency in the pallet's Config. Removed the bond references and stated what actually bounds the queue, including the point that `register_relayer` is `ManageOrigin`-gated, so the relayer prerequisite is a stronger gate than the header implied. - The `change_encrypted_memo` comment on `unshield` lists a 116-byte plaintext and omits `circuit_version`. `MemoData` has been 120 bytes since `circuit_version` was added, so a client written against this comment would produce a memo the pallet accepts and no wallet can decrypt. Corrected, and added the 180-byte wire format for the same reason. - `NullifiersSpent` and `CommitmentsInserted` both claim the split between them prevents graph correlation. It does not: both are deposited by the same extrinsic and carry the same `Phase::ApplyExtrinsic` index, so joining them is a one-line query. The split is still worth keeping, but the guarantee comes from the commitments and nullifiers being opaque. Reworded so the comment does not imply a property the runtime cannot provide. - The mainnet genesis preset passes an all-zero sudo key, empty validator and session-key lists, and no verification keys. A chain built from it cannot produce a block and has no governance origin to repair itself. Added a doc comment saying so, since nothing in the file marks it as a placeholder. Comments only. No executable code, signature, or type is changed. Co-Authored-By: Claude Opus 5 <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.
Four comments that a reader would reasonably act on, each contradicted by the code immediately below it. Comments only, no executable code, signature, or type is changed.
1.
pallet-validator-setdocuments a bond it never takesThree places refer to one: the module header attributes spam resistance partly to it,
ApprovedValidatorssays approval happens "after bond", andPendingValidatorsdescribes its entries as having a "bond locked".register_validatorlocks nothing, and the pallet'sConfighas no currency dependency at all, so there is nothing to lock with. The queue is bounded byMaxPendingValidatorsand the two prerequisites, and it is worth noting explicitly thatregister_relayeris itselfManageOrigin-gated, which makes the relayer prerequisite a considerably stronger gate than the header implies. Someone reading the current text could reasonably conclude there is economic skin in the game here.2. The
unshieldchange-memo comment is 4 bytes out of dateIt lists the plaintext as
[value_lo(8), value_hi(8), owner_pk(32), blinding(32), asset_id(4), counterparty_pk(32)], which is 116 bytes.MemoDatahas been 120 sincecircuit_versionwas appended.This one has teeth: a client written against the comment produces a memo the pallet accepts (
is_valid_size()only checks non-empty on this path) and that no wallet can decrypt, so the change note is silently unrecoverable. Corrected, and added the 180-byte wire format since that is the number a client actually needs.3. The event split does not prevent graph correlation
NullifiersSpentandCommitmentsInsertedeach say they are "emitted independently ... to prevent graph correlation". Both are deposited by the same extrinsic and therefore carry the samePhase::ApplyExtrinsicindex, so joining them is a one-line indexer query.The split is still worth keeping, and the actual unlinkability is real, it just comes from the commitments and nullifiers being opaque rather than from the events being separate. Reworded so the comment does not claim a property the runtime cannot provide, since a privacy claim in a doc comment tends to get repeated downstream.
4. The mainnet genesis preset is an unmarked placeholder
mainnet()passes an all-zero sudo key, empty validator and session-key lists, and no verification keys. Nothing in the file says it is a placeholder, and it sits next todevelopment()andtestnet(), which are real.Each of the three is independently fatal: nobody holds the secret for the zero account, so there is no governance origin and no way to register verification keys; the empty validator list means
pallet-sessionhands Aura an empty authority set and no block is ever produced; and with no VKs every shielded operation fails regardless. Added a doc comment saying so rather than changing the values, since I do not know what they should be.Verification
I was not able to build the workspace, so I have not run
cargo checkorcargo fmt --checkagainst this. The changes are all inside//and///comments with hard-tab indentation matching the surrounding code, so I would expect both to pass, but please treat that as unverified.Separately, I have emailed
security@orbinum.netabout a small number of higher-severity findings from the same review pass. Those are deliberately not in this PR, in any other PR, or in a public issue. Happy to hold them for as long as you need.