Concordium / concordium-client

A command line client to interact with the concordium-node
Apache License 2.0
8 stars 6 forks source link

Client doesn't check if SC module is too large #145

Closed Bargsteen closed 1 month ago

Bargsteen commented 2 years ago

Description Concordium client does not check whether a module is above the size limit when deploying.

Steps to Reproduce

  1. Deploy a v0 module with size > 64Kib or a v1 module with size > 512Kib

Expected Result Module is too big. The max size is [64, 512] Kib for [v0, v1] smart contract modules.

(The client will know the actual version, so it should write the correct size for it.)

Actual Result concordium-client: user error (gRPC error: Deserialization error)

Versions

┆Issue is synchronized with this Jira Task by Unito

rasmus-kirk commented 1 month ago

It seems I am unable to reproduce the issue. Supplying the following test modules, I get:

cis1_multi-debug.wasm.v0.txt cis2_multi-debug.wasm.v1.txt

(txt, because otherwise GH won't let me attach them)

V0:

$ stack run -- module deploy cis1_multi-debug.wasm.v0
Error: Supplied file 'cis1_multi-debug.wasm.v0' cannot be parsed as a smart contract module to be deployed:
       Failed reading: Maximum module size exceeded.
       Empty call stack
       .

V1:

$ stack run -- module deploy cis2_multi-debug.wasm.v1 
Error: Supplied file 'cis2_multi-debug.wasm.v1' cannot be parsed as a smart contract module to be deployed:
       Failed reading: Maximum module size exceeded.
       Empty call stack
       .

I thought it might have been fixed in the meantime, since the issue is old, so I traced the error message back to the this commit. The commit is older than this issue, but the issue is created by Jira, and as such, may be older than what GH let's on. I will therefore close this unless this can be reproduced.

Bargsteen commented 1 month ago

Yea, I think this was fixed indirectly in the parsing of modules inside base at some point.