Repository navigation
Show casts from keys revoked since; strict hex and base64 in message checks - #17
Merged
Merged
Conversation
Since Snapchain engine V14 a removed key's earlier messages stay on the network, but the client treated them as forgeries: every cast signed by a key revoked since (with ./outpost uninstall, for one) was reported as "signed by a key that is not the author's". - onchain key removed since: shown, marked "key revoked since" (Optimism shows it was the author's) - gasless key the second node does not list: held back and counted as "not listed: revoked since, or not the author's", not as a failure, because the HTTP API cannot tell the two apart - a key the node calls onchain that Optimism does not list: still dropped Message checks now accept only 0x lower-case hex (hash, signer, cast ids) and canonical base64 signatures. Null fields stay ignored, with the reason at extraField. README states the limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ut7NR5KyubX7WMMggTFNEb
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Outpost assumed that when a key is removed, the network deletes what it signed. Since Snapchain engine V14 it does not (
engine.rsshould_revoke_signer,version.rs:303; a gasless KEY_REMOVE deletes only the key record,gasless_key_merge.rs). So the client reported genuine old casts as forgeries: every cast signed by a key someone revoked since, including keys revoked with./outpost uninstall, showed up as "signed by a key that is not the author's".Draft. David decided on 23 Oct: merge after the prize deadline (Sat 24 Oct 14:47 UTC), together with #15. Before merging: mark ready, CI green. It merges cleanly with #15 in either order. Merging to
mainredeploys the hosted client on GitHub Pages.What changes
revoked.unlisted.verify.tsandsecondnode.ts.Trade-off: a node that forges a cast with a made-up gasless key is now reported as "not listed" rather than "failed verification". The forged cast is still never shown unless the reader asks, and then it is marked.
Encoding leniencies (reported by a blind verifier on PR #15)
hexToBytesskips the first two characters without checking them, so1x…decoded like0x…, and upper case read like lower case. Now only0xplus lower-case hex passes (hash, signer and cast ids). Snapchain writes lower case.atobignores the unused bits of the last base64 character, so another spelling of the same bytes passed. Now only the canonical spelling passes.extraField. Honest nodes send null fields the rebuilt message does not have, and a null carries nothing signed or shown; tightening it would reject honest data.Known limit, now in the README: Optimism records no removal time and a cast's date is signed by its own key, so a cast backdated with a leaked, removed onchain key and served by a dishonest node would show, marked "key revoked since". Honest nodes refuse such casts.
None of the three changed signed content; real mainnet fixtures still verify. Not covered: a cast delete's
targetHashis still decoded throughMessageData.fromJSON, which reads base64 loosely (no delete message in the fixtures to test against).Tests
npm test72 pass (2 new, 3 updated to the new outcomes),tscstrict plus--noUnusedLocals --noUnusedParametersclean, build clean, jscpd 0 clones. Blind verify round 1: FAIL (the null-field reason was only in this text, not the code; hex case was still lenient), both fixed; round 2: PASS (154 changed copies of real messages all rejected, all 7 fixtures verify, key checks as described). Merged locally withfeat/society-votes(PR #15): no conflicts, 93 tests pass, so either can go first.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ut7NR5KyubX7WMMggTFNEb