stable-structures icon indicating copy to clipboard operation
stable-structures copied to clipboard

canister upgrade with limit change

Open fredski02 opened this issue 5 months ago • 0 comments

We have something that looks like below.


const MAX_VALUE_SIZE: u32 = 133;

#[derive(Serialize, Clone, Deserialize, CandidType, Debug, PartialEq, Eq)]
pub struct NeuronInfo {
   // ... code
}

impl Storable for NeuronInfo {
    fn to_bytes(&self) -> Cow<[u8]> {
        Cow::Owned(Encode!(self).unwrap())
    }
    fn from_bytes(bytes: Cow<[u8]>) -> Self {
        Decode!(&bytes, Self).unwrap()
    }
    const BOUND: Bound = Bound::Bounded {
        max_size: MAX_VALUE_SIZE,
        is_fixed_size: false,
    };
}

is it safe to change the MAX_VALUE_SIZE ( max_size ) of a bounded type to 140 and run a canister upgrade?

fredski02 avatar Aug 13 '25 15:08 fredski02