Repository navigation
Conversation
filecoin-encryption-envelope
@filoz/keysmith
@filoz/synapse-core
@filoz/synapse-react
@filoz/synapse-sdk
commit: |
|
Docs preview: https://pr-1192-synapse-dev.filoz.workers.dev Built from e20c5de. |
There was a problem hiding this comment.
ℹ️ The zero-address guard works as intended. One non-blocking suggestion inline.
Approach: Sound — validating in loginCall covers direct call construction, login, and loginSync before any RPC request.
Reviewed changes in the session-key actions, JSON-RPC mocks, and regression tests.
- Login validation:
loginCallthrows aValidationErrorfor the zero address and exposes it through all three actions’ error types. - Mocks and coverage: The mock registry supports
login. The tests cover a valid login and confirm that both write actions reject the zero address without issuing an RPC request. - Verification: All five focused tests passed in Node.js and Chromium. The
synapse-corebuild and lint also passed.
gpt-6.2-sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes in e20c5de since the prior Pullfrog review:
- Narrowed the guard to a direct comparison with
zeroAddress. The zero address still fails before any RPC request, and viem’s ABI encoder still handles other address validation. - Added a regression test confirming that
loginCallleaves a malformed nonzero address unchanged in the call arguments.
All six focused login tests passed in Node.js and Chromium. The synapse-core build and lint also passed.
gpt-6.2-sol | 𝕏

What
loginCallin@filoz/synapse-core/session-keynow throws aValidationErrorwhen the session key address is the zero address. Nothing is simulated or sent.Why
The zero address is what a malformed signature recovers to, so authorizing it as a session key is never valid. This is defense in depth alongside the matching contract change in FilOzone/filecoin-services#688, which makes signature verification reject a zero-address signer.
Covered entry points
loginCall: holds the checklogin: builds its request withloginCallloginSync: callsloginThese are the only places in the monorepo that build a
SessionKeyRegistry.logincall.secp256k1.tsderives the session key address from a private key and does not authorize anything, so it is unchanged.The JSON-RPC test mocks gain a
sessionKeyRegistry.loginhandler sologincan be tested against the mocked RPC.Verification
pnpm run lint: passpnpm run build: passpnpm turbo run test --filter=@filoz/synapse-core: pass (node and browser)pnpm turbo run test --filter=@filoz/synapse-sdk: pass (node and browser)test/login.test.ts:loginCall,loginandloginSyncthrow for the zero address,loginandloginSyncwith no RPC request made;loginwith a normal address still returns a transaction hash. The zero-address tests failed before the check was added.