Serialization fails when updating state with a very long string

Hi Support,

I’ve a receive function that updates a part of the state with a string. When calling the function with a very long string (2696 chars), I get below error. Is there a limit to the string length in smart contract that is why the serialisation fails?

Error: Updating contract instance failed: Serialization failed.


Parameter (message) size is limited to 1kB (1024 bytes) at the moment.

This is going to be relaxed in the next release, but in the current protocol that is the limit.

Thanks @abizjak when is the next planned protocol release?

We are not committed to a specific date yet externally, but early December is the expectation on mainnet, and a couple of weeks before on testnet.

1 Like

Ok thank you for this.

Regarding the test net release, any day soon?

The node release is today.

The protocol update that enables this will be in effect (if things go as planned) on Tuesday the 22nd.

We have to wait a bit so that enough node runners upgrade their nodes.

1 Like

@abizjak so it will take effect today (the 22nd)? Apart from upgrading our testnode, should we do anything else – e.g., rebuild, re-deploy smart contract and/or get latest rust-sdk for our client code?

Yes, it was effected today at 12:05. Protocol Update on Testnet – Maintenance details - Concordium Testnet Status

You do not need to rebuild the contracts.

You do however need to update the rust-sdk to support the protocol 5.

Cool! Thank you @abizjak

Hi @abizjak - was testing this and just to be sure, is there new limit higher than 1024 bytes?

Yes, the new limit is 65535B.

You have to make sure to use the new Rust SDK if you are using that, since we do some pre-checks there.

Thanks. Will the limit be raised later to limitless depending on cost/gas?

That kind of a change would be a rather complex one so we are not planning on it soon.