Skip to content

program: Update pinocchio dependency to 0.11#50

Merged
febo merged 6 commits into
mainfrom
febo/bump-pinocchio-0.11
May 12, 2026
Merged

program: Update pinocchio dependency to 0.11#50
febo merged 6 commits into
mainfrom
febo/bump-pinocchio-0.11

Conversation

@febo
Copy link
Copy Markdown
Contributor

@febo febo commented May 9, 2026

Problem

The program uses an old version of pinocchio.

Solution

Update the program to use the latest pinocchio version (0.11). It was necessary to update the toolchain version.

@febo febo force-pushed the febo/bump-pinocchio-0.11 branch from 170e40b to 29ccf3c Compare May 11, 2026 10:36
@febo febo marked this pull request as draft May 11, 2026 14:03
@febo febo force-pushed the febo/bump-pinocchio-0.11 branch from 29ccf3c to 9b5d0ec Compare May 12, 2026 09:17
@febo febo marked this pull request as ready for review May 12, 2026 09:20
@febo febo requested a review from joncinque May 12, 2026 09:20
Copy link
Copy Markdown
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great overall! Just tiny things

Comment on lines +72 to +75
let mut rent = Rent::default();
rent.lamports_per_byte_year = rent
.lamports_per_byte_year
.saturating_mul(rent.exemption_threshold as u64);
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.

What is this change for?

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.

The latest pinocchio version computes the rent using lamports_per_byte ( lamports_per_byte_year in the old naming) only, so we need to make sure the value is updated as described in SIMD-0194.

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.

ah gotcha, thanks! Can you add a comment saying to remove it once we upgrade to a version that only uses lamports_per_byte?

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.

Done in 9db40aa

Comment thread program/src/processor/set_data.rs Outdated
Comment on lines 82 to 83
// The realloc validates that the new size does not exceed the
// maximum size of an account.
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.

resize_unchecked only validates that the increase is within MAX_PERMITTED_DATA_INCREASE, not that it exceeds the max size of an account.

At the very least, we should update this comment.

I think the runtime will properly fail if we go over the max, so I'm not too worried.

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.

Good point! The runtime will enforce that the account size is within the limits. I updated the comment in f6cb198

Comment thread program/src/state/mod.rs
Comment on lines +205 to +206
impl Zeroable for Address {
const ZERO: Self = Address::new_from_array([0u8; ADDRESS_BYTES]);
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.

Not for this PR, but we could probably remove all of the zeroable stuff and use solana-zero-copy instead in the future!

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.

Good point, definitely need to do that!

@febo febo requested a review from joncinque May 12, 2026 19:38
Copy link
Copy Markdown
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great!

@febo febo merged commit 519673d into main May 12, 2026
9 checks passed
@febo febo deleted the febo/bump-pinocchio-0.11 branch May 12, 2026 20:09
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