Skip to content

feat(solana): validate chunk_count in assemble instructions#860

Open
mariuszzak wants to merge 4 commits intomainfrom
mariuszzak/validate-chunk_count
Open

feat(solana): validate chunk_count in assemble instructions#860
mariuszzak wants to merge 4 commits intomainfrom
mariuszzak/validate-chunk_count

Conversation

@mariuszzak
Copy link
Collaborator

Description

Add extra validations to avoid panics on [..chunk_count]


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Wrote unit and integration tests.
  • Added relevant natspec and godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@mariuszzak mariuszzak self-assigned this Dec 11, 2025
@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.91%. Comparing base (a4a8191) to head (fb48bc9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #860   +/-   ##
=======================================
  Coverage   99.91%   99.91%           
=======================================
  Files          27       27           
  Lines        1123     1123           
=======================================
  Hits         1122     1122           
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mariuszzak mariuszzak marked this pull request as ready for review December 11, 2025 11:08
@mariuszzak mariuszzak requested a review from srdtrk as a code owner December 11, 2025 11:08
let chunk_count = chunk_count as usize;

require!(
chunk_count > 0 && chunk_count <= ctx.remaining_accounts.len(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

chunk count should never be less than remaining accounts, it's ok if it's equal - means we have no preverifies

Copy link
Collaborator

@vaporif vaporif left a comment

Choose a reason for hiding this comment

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

comment

Base automatically changed from feat/solana to main December 19, 2025 18:20
@mariuszzak mariuszzak force-pushed the mariuszzak/validate-chunk_count branch from 87a2371 to 4de6e77 Compare February 24, 2026 09:13
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