Increase the wasm code size in Terra blockchain

Hello, everyone.
This is Guorong, a passionate blockchain developer, especially on Terra blockchain. :grinning:

Currently, I am working on one interesting Defi project, and it ran into the issue of default max wasm code size.
In detail, the current max wasm code size of Terra blockchain is 600kb.
Terra max contract code size
Since the project needs more features to be implemented, it is exceeding the current max wasm code size.

I think it is needed to update the max wasm code size, like 600kb → 1.2mb.
Then, it would allow the Terra developers to implement many more features to the single Terra smart contract, which results in more interesting projects for Terra blockchain.
Also, it would be beneficial to follow the trend of cosmwasm, which is the tool for the Terra smart contract.
Cosmwasm max contract code size

Hope to hear the opinions on this idea of governance param change.


Not opposed to this idea. Just wondering what the consequences are for validators?


This is technically possible, no roadblocks exist that we are aware of.


If the head of Validator Relations says its not a big deal for validators, I’m good with this proposal.


Thanks for the replies.
Can you give me more info how to contact the head of Validation Relations?
I think the current topic is so-so topic for validators.
Thanks in advance.

@Jared is the man you seek : )

1 Like

Thanks so much, @Zero.AuraStake .

we will push a proposal for this very soon.

1 Like


I will be voting NO on this one.

has there been any performance testing done on this?
what happens to cache sizes, and TPS, and overall reliability of the network.


Can’t the smart contract be broken into smaller ones that interact with each other?

1 Like

usually yes.
there are two schools of thought.

  • small contracts that only do >1< thing (easier to find bugs, more reusability)
  • large contracts that do everything (simpler to write, and don’t have to do message passing as much)
1 Like

I would like to know if any testing has been done to this?

1 Like

@GuoRong_Du notice that this was posted to governance today for voting.

As a more more fundamental perspective, I can’t comment on the technical benefits of this size adjustment. Due to the lack of forum discussion and testing, I am a bit hesitant.

Is there any resources you can point me towards to be a bit more informed?

1 Like

We have run further test on Bombay Testnet, and have to recommend against this change for now.

Further testing is encouraged on Bombay Testnet by the community. The contract size is 1.2mb there.

Right now, changing the contract size It increase node operator’s cost. also the contracts can be written without this update by splitting into small ones.


Is there chance that this vote can be repeated? Maybe increasing the code size not by a factor of 2, but just 1.5?

We are also working on a DeFi application, and hit this limit. The contract cannot be easily or sensibly separated into multiple contracts, all its features are using the same data/datastructures/helper functions. Even if I break it up into N pieces, each contracts will have a size of more than ‘original size’ / N because of the above. It also makes testing/deploying/maintaining a nightmare. Gas cost will also increase thanks to the inter contract messages that we will need to send.

Working on terra is hard enough because all of those limitations: code size limit, gas limit of a single transaction(we also hit this one), CosmWasm ‘design decision’ of not allowing mutable calls to other smart contracts (something they backpedalled recently with ReplyOn mechanism which is still hard to use)

I feel if only the node operator’s voice is heard here, sooner or later devs will abandon this platform. ( I would not suggest anyone starting a reasonably complex DeFI project on terra at this stage)

1 Like

Would it make sense to non-linearly increase the gas cost for deploying contracts above the size of 600k? That would discourage most people for deploying big contracts, but would still allow it for some users by paying a higher gas cost.

1 Like