program: Update pinocchio dependency to 0.11#50
Conversation
170e40b to
29ccf3c
Compare
29ccf3c to
9b5d0ec
Compare
joncinque
left a comment
There was a problem hiding this comment.
Looks great overall! Just tiny things
| let mut rent = Rent::default(); | ||
| rent.lamports_per_byte_year = rent | ||
| .lamports_per_byte_year | ||
| .saturating_mul(rent.exemption_threshold as u64); |
There was a problem hiding this comment.
What is this change for?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
ah gotcha, thanks! Can you add a comment saying to remove it once we upgrade to a version that only uses lamports_per_byte?
| // The realloc validates that the new size does not exceed the | ||
| // maximum size of an account. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Good point! The runtime will enforce that the account size is within the limits. I updated the comment in f6cb198
| impl Zeroable for Address { | ||
| const ZERO: Self = Address::new_from_array([0u8; ADDRESS_BYTES]); |
There was a problem hiding this comment.
Not for this PR, but we could probably remove all of the zeroable stuff and use solana-zero-copy instead in the future!
There was a problem hiding this comment.
Good point, definitely need to do that!
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.