Skip to content

Commit

Permalink
Merge pull request #822 from CosmWasm/move-const-label-to-var
Browse files Browse the repository at this point in the history
Make MaxLabelSize a var not const
  • Loading branch information
ethanfrey authored Apr 27, 2022
2 parents 8d3d90c + 3a9a851 commit 8ca55b7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.26.0...HEAD)

**Implemented Enhancements**

- Make MaxLabelSize a var not const [\#822](https://github.com/CosmWasm/wasmd/pull/822)

## [v0.26.0](https://github.com/CosmWasm/wasmd/tree/v0.26.0) (2022-04-21)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.25.0...v0.26.0)
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,9 @@ docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \

We provide a number of variables in `app/app.go` that are intended to be set via `-ldflags -X ...`
compile-time flags. This enables us to avoid copying a new binary directory over for each small change
to the configuration.
to the configuration.

Available flags:


* `-X github.com/CosmWasm/wasmd/app.NodeDir=.corald` - set the config/data directory for the node (default `~/.wasmd`)
* `-X github.com/CosmWasm/wasmd/app.Bech32Prefix=coral` - set the bech32 prefix for all accounts (default `wasm`)
Expand All @@ -195,6 +194,16 @@ Examples:

* [`wasmd`](./Makefile#L50-L55) is a generic, permissionless version using the `cosmos` bech32 prefix

## Compile Time Parameters

Besides those above variables (meant for custom wasmd compilation), there are a few more variables which
we allow blockchains to customize, but at compile time. If you build your own chain and import `x/wasm`,
you can adjust a few items via module parameters, but a few others did not fit in that, as they need to be
used by stateless `ValidateBasic()`. Thus, we made them public `var` and these can be overridden in the `app.go`
file of your custom chain.

* `wasmtypes.MaxLabelSize = 64` to set the maximum label size on instantiation (default 128)

## Genesis Configuration
We strongly suggest **to limit the max block gas in the genesis** and not use the default value (`-1` for infinite).
```json
Expand Down
1 change: 0 additions & 1 deletion x/wasm/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const (
QuerierRoute = types.QuerierRoute
RouterKey = types.RouterKey
MaxWasmSize = types.MaxWasmSize
MaxLabelSize = types.MaxLabelSize
WasmModuleEventType = types.WasmModuleEventType
AttributeKeyContractAddr = types.AttributeKeyContractAddr
ProposalTypeStoreCode = types.ProposalTypeStoreCode
Expand Down
2 changes: 2 additions & 0 deletions x/wasm/types/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import (

const (
MaxWasmSize = 500 * 1024
)

var (
// MaxLabelSize is the longest label that can be used when Instantiating a contract
MaxLabelSize = 128
)
Expand Down

0 comments on commit 8ca55b7

Please sign in to comment.