Solana-safe buffer abstraction to avoid large stack allocations#21
Open
xoredtwice wants to merge 4 commits into
Open
Solana-safe buffer abstraction to avoid large stack allocations#21xoredtwice wants to merge 4 commits into
xoredtwice wants to merge 4 commits into
Conversation
🤖 Augment PR SummarySummary: Introduces an internal
🤖 Was this summary useful? React with 👍 or 👎 |
|
|
||
|
|
||
| enum SignatureBuffer { | ||
| #[cfg(feature = "solana")] |
There was a problem hiding this comment.
SignatureBuffer’s #[cfg(feature = "solana")] variant stores [u8; constants::SIGNATURE_SIZE] inline, which is a stack allocation and seems to contradict the PR description/goal of avoiding large Solana stack frames (and it replaces prior Vec usages with stack storage). Was the cfg intended to be inverted (heap-backed on solana, fixed-capacity on non-Solana)?
🤖 Was this useful? React with 👍 or 👎
|
Best way to get |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This MR introduces a small buffer abstraction to avoid large fixed-size stack allocations that can cause runtime failures in Solana BPF programs due to strict stack frame limits (~4KB).
A new internal
SignatureBufferabstraction unifies two execution paths:This removes manual offset arithmetic, keeps cryptographic behavior unchanged, and makes platform constraints explicit without duplicating logic.
No WOTS+ logic or parameters were modified.
Summary of changes
SignatureBufferabstraction with a minimal, uniform API.Testing
Related issue
Closes / Related to: #11