-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
In the first phase of DLP v2, implement the following ix:
delegatecommitfinalizeundelegatecall_handler
performance tips
-
validations:
- avoid
find_program_address; pass bumps. - avoid
create_program_addressif possible; consider usingderive_addressinstead. - minimize key comparisons.
- fail early, cheap checks first.
- avoid
-
memory & data:
- avoid heap allocation; use zero-copy aggressively.
- avoid copies as well for bigger types (> 8 bytes).
- avoid wide arithmetic (u128 / U256) in hot path.
- prefer fixed-size account layouts.
- smaller binary: try to reuse code.
-
accounts:
- merge multiple accounts where possible.
- minimize total loaded account data size.
- avoid creating / reallocating accounts in commit/finalize.
- move cold data out of hot-path accounts.
-
PDAs & signers:
- avoid PDA signing unless strictly necessary.
- cache derived PDAs in state when reused.
-
instructions:
- minimize instruction count, especially on commit path.
- avoid CPI in commit/finalize.
- avoid ComputeBudget reliance.
- prefer one large ix instead of many smaller ix.
- commit/finalize must be infinitely boringly simple, even if setup is complex.
- single instruction only.
- no helper instructions.
- no multi-step commit flow.
- no retry logic inside the program.
- minimize instruction count, especially on commit path.
-
logging:
- zero logs on success
- detailed logs on failure (including ix discriminator)
-
build strategy:
- feature-gate debug / validation logic
- avoid abstractions that prevent inlining in hot path
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels