You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(program): reduce PDA validation compute units
Replace find_program_address in validate_pda with create_program_address
since the bump is already provided in instruction data. Override
validate_self in Escrow, Receipt, AllowedMint, and EscrowExtensions to
use derive_address with the stored bump, avoiding the off-curve check
that is unnecessary for accounts validated at creation.
Also documents 2-step admin transfer as a future improvement.
Copy file name to clipboardExpand all lines: docs/IMPROVEMENTS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,3 +13,5 @@ The following enhancements could be considered for future iterations of the prog
13
13
5.**Receipt Seed Space Optimization** - The current `receipt_seed` uses a 32-byte `Address` type. Two alternatives could save space:
14
14
-**Use `u8` counter**: Change to a simple counter (0-255), saving 31 bytes per receipt. Limits to 256 receipts per depositor/escrow/mint combination, which is acceptable for most use cases.
15
15
-**Single receipt with `deposit_additional` instruction**: Allow users to add to an existing receipt rather than creating new ones. This would require handling complexities around `deposited_at` timestamps (e.g., weighted average, use latest, or track per-deposit).
16
+
17
+
6.**Two-Step Admin Transfer** - The current `UpdateAdmin` instruction requires both the current and new admin to sign the same transaction. This is problematic when transferring to/from multisig wallets (e.g., Squads), since both parties must be present in one transaction. A 2-step pattern (`ProposeAdmin` → `AcceptAdmin`, with optional `CancelAdminTransfer` and a timeout) would allow async coordination between parties and is the standard pattern for admin handoffs in production programs.
0 commit comments