Maximal data size for update call

I know we often say that the maximal data size for an update call is around 2MB but, what’s the exact size? or it’s a factor of various things and it can only be approximated?

I mean without chunking or anything, really “just” an update call

#[update]
fn something(data: Something) {
  // What's the maximal size of "data"?
}
1 Like

Tested it out, and the answer (Jan 31, 2023) is precisely 3_669_834 bytes, or ~3.5mb on local.

On mainnet, the limit is lower. The largest blob you can effectively send is 2_096_970 bytes.

Demonstrated here: GitHub - krpeacock/max_update_size: testing the maximum update size

4 Likes

That was the answer I was looking for, thanks a lot @kpeacock

Is it possible to make it the same locally?

Noooo!!! At least leave the system subnet type alone…we need a way to build with the hose open for testing libraries…they get big and never get pushed to mainnet.

If it’s configurable then you could increase it for testing but I think a sensible default would be to behave the same as the main network.

2 Likes