Skip to content

Commit

Permalink
Merge branch 'main' into feat/remove-ibc-wasm-module
Browse files Browse the repository at this point in the history
  • Loading branch information
Peartes committed Feb 7, 2025
2 parents b052d94 + d4db0b0 commit 96b21e6
Show file tree
Hide file tree
Showing 20 changed files with 784 additions and 303 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.22"
ARG GO_VERSION="1.23"
ARG ALPINE_VERSION="3.20"

# --------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type HandlerOptions struct {
ante.HandlerOptions

IBCKeeper *keeper.Keeper
WasmConfig *wasmTypes.WasmConfig
NodeConfig *wasmTypes.NodeConfig
TXCounterStoreService corestoretypes.KVStoreService
GlobalFeeSubspace paramtypes.Subspace
StakingKeeper *stakingkeeper.Keeper
Expand All @@ -51,7 +51,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.SignModeHandler == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}
if options.WasmConfig == nil {
if options.NodeConfig == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
}
if options.GlobalFeeSubspace.Name() == "" {
Expand All @@ -66,7 +66,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
wasmkeeper.NewLimitSimulationGasDecorator(options.NodeConfig.SimulationGasLimit), // after setup context to enforce limits early
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreService),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
// this changes the minGasFees,
Expand Down
15 changes: 8 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ func NewWasmApp(
)

wasmDir := filepath.Join(homePath, "wasm")
wasmConfig, err := wasm.ReadWasmConfig(appOpts)
nodeConfig, err := wasm.ReadNodeConfig(appOpts)
if err != nil {
panic(fmt.Sprintf("error while reading wasm config: %s", err))
}
Expand All @@ -718,8 +718,8 @@ func NewWasmApp(
doubleWasmDir,
availableCapabilities,
WasmContractMemoryLimit, // default of 32
wasmConfig.ContractDebugMode,
wasmConfig.MemoryCacheSize,
nodeConfig.ContractDebugMode,
nodeConfig.MemoryCacheSize,
)
if err != nil {
panic(err)
Expand All @@ -742,7 +742,8 @@ func NewWasmApp(
app.MsgServiceRouter(),
app.GRPCQueryRouter(),
wasmDir,
wasmConfig,
nodeConfig,
wasmtypes.VMConfig{},
availableCapabilities,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
wasmOpts...,
Expand Down Expand Up @@ -1019,7 +1020,7 @@ func NewWasmApp(
app.SetPreBlocker(app.PreBlocker)
app.SetBeginBlocker(app.BeginBlocker)
app.SetEndBlocker(app.EndBlocker)
app.setAnteHandler(txConfig, wasmConfig, keys[wasmtypes.StoreKey])
app.setAnteHandler(txConfig, nodeConfig, keys[wasmtypes.StoreKey])

// must be before Loading version
// requires the snapshot store to be created and registered as a BaseAppOption
Expand Down Expand Up @@ -1079,7 +1080,7 @@ func NewWasmApp(
return app
}

func (app *WasmApp) setAnteHandler(txConfig client.TxConfig, wasmConfig wasmtypes.WasmConfig, txCounterStoreKey *storetypes.KVStoreKey) {
func (app *WasmApp) setAnteHandler(txConfig client.TxConfig, nodeConfig wasmtypes.NodeConfig, txCounterStoreKey *storetypes.KVStoreKey) {
anteHandler, err := NewAnteHandler(
HandlerOptions{
HandlerOptions: ante.HandlerOptions{
Expand All @@ -1092,7 +1093,7 @@ func (app *WasmApp) setAnteHandler(txConfig client.TxConfig, wasmConfig wasmtype

AbstractAccountKeeper: app.AbstractAccountKeeper,
IBCKeeper: app.IBCKeeper,
WasmConfig: &wasmConfig,
NodeConfig: &nodeConfig,
TXCounterStoreService: runtime.NewKVStoreService(txCounterStoreKey),
GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName),
StakingKeeper: app.StakingKeeper,
Expand Down
2 changes: 1 addition & 1 deletion app/params/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ It contains the default weights used for each transaction used on the module's
simulation. These weights define the chance for a transaction to be simulated at
any gived operation.
You can repace the default values for the weights by providing a params.json
You can replace the default values for the weights by providing a params.json
file with the weights defined for each of the transaction operations:
{
Expand Down
229 changes: 228 additions & 1 deletion client/docs/static/openapi.json

Large diffs are not rendered by default.

211 changes: 210 additions & 1 deletion client/docs/static/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -18028,9 +18028,109 @@
]
}
},
"/cosmwasm/wasm/v1/code-info/{code_id}": {
"get": {
"summary": "CodeInfo gets the metadata for a single wasm code",
"operationId": "CodeInfo",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"type": "object",
"properties": {
"code_id": {
"type": "string",
"format": "uint64"
},
"creator": {
"type": "string"
},
"checksum": {
"type": "string",
"format": "byte"
},
"instantiate_permission": {
"type": "object",
"properties": {
"permission": {
"type": "string",
"enum": [
"ACCESS_TYPE_UNSPECIFIED",
"ACCESS_TYPE_NOBODY",
"ACCESS_TYPE_EVERYBODY",
"ACCESS_TYPE_ANY_OF_ADDRESSES"
],
"default": "ACCESS_TYPE_UNSPECIFIED",
"description": "- ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified placeholder for empty value\n - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden\n - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted\n - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses",
"title": "AccessType permission types"
},
"addresses": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "AccessConfig access control type."
}
},
"title": "QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type_url": {
"type": "string",
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
},
"value": {
"type": "string",
"format": "byte",
"description": "Must be a valid serialized protocol buffer of the above specified type."
}
},
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := &pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := &pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": <string>,\n \"lastName\": <string>\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
}
}
}
}
}
},
"parameters": [
{
"name": "code_id",
"in": "path",
"required": true,
"type": "string",
"format": "uint64"
}
],
"tags": [
"CosmWasm"
]
}
},
"/cosmwasm/wasm/v1/code/{code_id}": {
"get": {
"summary": "Code gets the binary code and metadata for a singe wasm code",
"summary": "Code gets the binary code and metadata for a single wasm code",
"operationId": "Code",
"responses": {
"200": {
Expand Down Expand Up @@ -19282,6 +19382,65 @@
]
}
},
"/cosmwasm/wasm/v1/wasm-limits-config": {
"get": {
"summary": "WasmLimitsConfig gets the configured limits for static validation of Wasm\nfiles, encoded in JSON.",
"operationId": "WasmLimitsConfig",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"type": "object",
"properties": {
"config": {
"type": "string"
}
},
"description": "QueryWasmLimitsConfigResponse is the response type for the\nQuery/WasmLimitsConfig RPC method. It contains the JSON encoded limits for\nstatic validation of Wasm files."
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type_url": {
"type": "string",
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
},
"value": {
"type": "string",
"format": "byte",
"description": "Must be a valid serialized protocol buffer of the above specified type."
}
},
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := &pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := &pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": <string>,\n \"lastName\": <string>\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
}
}
}
}
}
},
"tags": [
"CosmWasm"
]
}
},
"/ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/fee_enabled": {
"get": {
"summary": "FeeEnabledChannel returns true if the provided port and channel identifiers belong to a fee enabled channel",
Expand Down Expand Up @@ -44229,6 +44388,47 @@
},
"description": "QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC\nmethod."
},
"cosmwasm.wasm.v1.QueryCodeInfoResponse": {
"type": "object",
"properties": {
"code_id": {
"type": "string",
"format": "uint64"
},
"creator": {
"type": "string"
},
"checksum": {
"type": "string",
"format": "byte"
},
"instantiate_permission": {
"type": "object",
"properties": {
"permission": {
"type": "string",
"enum": [
"ACCESS_TYPE_UNSPECIFIED",
"ACCESS_TYPE_NOBODY",
"ACCESS_TYPE_EVERYBODY",
"ACCESS_TYPE_ANY_OF_ADDRESSES"
],
"default": "ACCESS_TYPE_UNSPECIFIED",
"description": "- ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified placeholder for empty value\n - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden\n - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted\n - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses",
"title": "AccessType permission types"
},
"addresses": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "AccessConfig access control type."
}
},
"title": "QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method"
},
"cosmwasm.wasm.v1.QueryCodeResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -44638,6 +44838,15 @@
},
"title": "QuerySmartContractStateResponse is the response type for the\nQuery/SmartContractState RPC method"
},
"cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse": {
"type": "object",
"properties": {
"config": {
"type": "string"
}
},
"description": "QueryWasmLimitsConfigResponse is the response type for the\nQuery/WasmLimitsConfig RPC method. It contains the JSON encoded limits for\nstatic validation of Wasm files."
},
"ibc.applications.fee.v1.Fee": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 96b21e6

Please sign in to comment.