fix(ttx): avoid GetSigner for remote identities via IsMe gate#1564
fix(ttx): avoid GetSigner for remote identities via IsMe gate#1564atharrva01 wants to merge 2 commits into
Conversation
|
hi @adecaro , I gated |
59e2fcc to
f5bf435
Compare
|
Hi @atharrva01 , thank you for submitting this and sorry for the late reply 🙏 I'll review ASAP. I'm curious to look at your approach more carefully 😄 |
…edger-labs#1226) Gate GetSigner() behind a cheap IsMe() check to skip the expensive idemix sign-and-verify deserialization for remote identities. Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
… testifylint Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
f5bf435 to
6417f23
Compare
|
Hi @atharrva01 , apologies for this late reply. I just want to double check the semantic. |
|
Hi @adecaro! You're right to flag this. The issue is that I fixed it by calling Also, for idemixnym identities specifically, All identity and ttx tests pass. |
Closes #1226
Every token transfer has a list of signer identities -- some local, some remote. Before this fix,
requestSignatures()was callingGetSigner()on every identity unconditionally.For regular X.509 identities that's a cheap failure. For idemix pseudonyms it's not:
GetSigner()internally callsDeserializeSigningIdentity(), which generates a real cryptographic signature as a liveness check -- even for remote identities that will just fail anyway. In a multi-party transfer, this adds up.The fix
I gated
GetSigner()behindIsMe():IsMe()uses an in-memory cache + lightweight DB lookup -- no crypto, no key deserialization. Remote identities are filtered out before any crypto is touched. The rest of the flow (owner-wallet check, remote signing) is unchanged.Testing
Added
TestRequestSignatures_RemoteIdentity_SkipsGetSigner-- sets up a remote identity, configuresIsMe()to return false, and assertsGetSignercall count stays at zero. All existingtoken/services/ttx/...tests pass.