Skip to content

instructions-sysvar: handle overflow#765

Open
apfitzge wants to merge 3 commits into
anza-xyz:masterfrom
apfitzge:instruction_sysvar_overflow
Open

instructions-sysvar: handle overflow#765
apfitzge wants to merge 3 commits into
anza-xyz:masterfrom
apfitzge:instruction_sysvar_overflow

Conversation

@apfitzge

Copy link
Copy Markdown
Contributor

Problem

  • txv1's larger size introduces the possibility of overflowing the instructions sysvar format

Solution

  • handle overflow in instruction sysvar construction
  • add transaction error variant for the overflow

@apfitzge apfitzge force-pushed the instruction_sysvar_overflow branch from 6d96860 to 7b7a5c1 Compare June 12, 2026 08:52
Comment thread instructions-sysvar/src/lib.rs Outdated
#[cfg(not(target_os = "solana"))]
#[cfg_attr(feature = "dev-context-only-utils", qualifiers(pub))]
fn serialize_instructions(instructions: &[BorrowedInstruction]) -> Vec<u8> {
fn serialize_instructions(instructions: &[BorrowedInstruction]) -> Option<Vec<u8>> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result<T> plz

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 sure was on fence here. No current appropriate error in scope so I went to Option...but yeah Result is better

@apfitzge apfitzge marked this pull request as ready for review June 14, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants