refactor: derive deploy salt from canonical XDR(owner)#56
Conversation
derive_salt hashed owner.to_string() (StrKey display text) into a fixed 56-byte buffer. That ties the deterministic vault address to a display encoding and contradicts the README, which documents the preimage as raw owner address bytes. An off-chain client precomputing the address would naturally produce the canonical XDR bytes, not the StrKey string, causing precomputed and on-chain addresses to diverge. Hash the owner's canonical XDR serialization (Address::to_xdr) instead, and document the exact preimage (keccak256(user_salt || XDR(owner))) in the README. Safe to change now: no client precomputes addresses yet and no production vaults are deployed. Determinism and owner/salt binding are unchanged and remain covered by the existing factory address tests.
|
Warning Review limit reached
More reviews will be available in 9 minutes and 35 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Summary
derive_salthashedowner.to_string()(StrKey display text) into a fixed 56-byte buffer. This ties the deterministic vault address to a display encoding and contradicts the README, which documents the preimage as raw owner address bytes.This PR hashes the owner's canonical XDR serialization (
Address::to_xdr) instead, and documents the exact preimage in the README.Why
owner_address_bytes).[u8; 56]buffer assumption.Safety
Safe to change now: no off-chain client precomputes addresses yet, and no production vaults are deployed. Changing the derivation only affects addresses for a given
(owner, salt)going forward.