Solana: Stack offset exceeded on deposit_spl and withdraw_execute #61

Closed
opened 2026-03-19 06:22:44 +00:00 by Brouie · 5 comments
Brouie commented 2026-03-19 06:22:44 +00:00 (Migrated from gitlab.com)

Branch: feat/solana-integration\nStep: anchor test (Step 4 from #60)\n\nError:\n\nFunction DepositSpl::try_accounts Stack offset of 4112 exceeded max offset of 4096 by 16 bytes\nFunction WithdrawExecute::try_accounts Stack offset of 4232 exceeded max offset of 4096 by 136 bytes\n\n\nSolana SBF enforces a 4096-byte stack frame limit. Both deposit_spl and withdraw_execute exceed it. Needs refactoring — likely Box for large account structs or breaking logic into sub-functions with zero_copy.\n\nImpact: Program may exhibit undefined behavior at runtime even though it compiles.

**Branch:** feat/solana-integration\n**Step:** anchor test (Step 4 from #60)\n\n**Error:**\n```\nFunction DepositSpl::try_accounts Stack offset of 4112 exceeded max offset of 4096 by 16 bytes\nFunction WithdrawExecute::try_accounts Stack offset of 4232 exceeded max offset of 4096 by 136 bytes\n```\n\nSolana SBF enforces a 4096-byte stack frame limit. Both deposit_spl and withdraw_execute exceed it. Needs refactoring — likely Box<Account> for large account structs or breaking logic into sub-functions with zero_copy.\n\n**Impact:** Program may exhibit undefined behavior at runtime even though it compiles.
Brouie commented 2026-03-19 06:54:08 +00:00 (Migrated from gitlab.com)

mentioned in commit aee469d249

mentioned in commit aee469d2492ba0469409e10ab8dca45898d1bc42
Brouie commented 2026-03-19 06:54:46 +00:00 (Migrated from gitlab.com)

mentioned in merge request !147

mentioned in merge request !147
PlasticDigits commented 2026-03-19 10:55:04 +00:00 (Migrated from gitlab.com)

mentioned in commit 80b32b17ec

mentioned in commit 80b32b17ec0b05a92cb3fed2fb58c6ef5a74263c
PlasticDigits commented 2026-03-19 11:52:58 +00:00 (Migrated from gitlab.com)

@Brouie Verify fix.

@Brouie Verify fix.
Brouie commented 2026-03-23 01:20:14 +00:00 (Migrated from gitlab.com)

Verified on new QA server. Anchor build clean — no stack overflow warnings. 32/33 tests pass. #66 (deposit_record seed) is the only remaining failure.

Verified on new QA server. Anchor build clean — no stack overflow warnings. 32/33 tests pass. #66 (deposit_record seed) is the only remaining failure.
Brouie (Migrated from gitlab.com) closed this issue 2026-03-23 01:20:16 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-bridge-monorepo#61
No description provided.