Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement CallCallablePoint Function to wasm Keeper #948

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/wasm) [\#649](https://github.com/line/lbm-sdk/pull/649) fix: wasm module's FIXME in the snapshotter.go file
* (x/ibc) [\#651](https://github.com/line/lbm-sdk/pull/651) feat: update x/ibc to support github.com/cosmos/ibc-go@v3.0.0
* (config) [\#665](https://github.com/line/lbm-sdk/pull/665) remove bech32-cache-size
* (x/wasm) [\#948](https://github.com/line/lbm-sdk/pull/948) feat: Implement CallCallablePoint Function to wasm Keeper
da1suk8 marked this conversation as resolved.
Show resolved Hide resolved

### Improvements
* (refactor) [\#493](https://github.com/line/lbm-sdk/pull/493) restructure x/consortium
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ require (
replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

github.com/line/wasmvm => github.com/loloicci/wasmvm v0.14.0-0.8.0.0.20230330190936-c92e9e5bb27e
google.golang.org/grpc => google.golang.org/grpc v1.33.2
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
github.com/line/ostracon v1.0.7-0.20220729051742-2231684789c6 h1:WKz4yaIW+TJgJv5uhmrHYC3UnohDHlXDT6GccvgV0AA=
github.com/line/ostracon v1.0.7-0.20220729051742-2231684789c6/go.mod h1:8gnHCqwRjbJfhVtQkl7KIfcubtpsIEmiN0u91B4EYWY=
github.com/line/wasmvm v1.0.0-0.10.0.0.20221226034317-6d2861f53d3a h1:2wgOMBVR5PObP597P9n/ZkSOUVy3MDjgJH6hR3eqBJE=
github.com/line/wasmvm v1.0.0-0.10.0.0.20221226034317-6d2861f53d3a/go.mod h1:Lq3FVvi/rb+OOlTxqtcqcao2GGESQ4hUpuXMcjdJbco=
github.com/loloicci/wasmvm v0.14.0-0.8.0.0.20230330190936-c92e9e5bb27e h1:yjU+aIMEIU9SNU9UeDH5oblT8cSWAvmXy1OJ/WEqElg=
github.com/loloicci/wasmvm v0.14.0-0.8.0.0.20230330190936-c92e9e5bb27e/go.mod h1:Lq3FVvi/rb+OOlTxqtcqcao2GGESQ4hUpuXMcjdJbco=
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/dynamic_link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func TestDynamicCallWithWriteFailsByQuery(t *testing.T) {
}
queryReq := abci.RequestQuery{Data: []byte(`{"mul":{"value":2}}`)}
_, qErr := q(data.ctx, queryPath, queryReq)
assert.ErrorContains(t, qErr, "Must not call a writing storage function in this context.")
assert.ErrorContains(t, qErr, "It is not possible to inherit from read-only permission to read-write permission")
}

// This tests callee_panic in dynamic call fails
Expand Down
5 changes: 5 additions & 0 deletions x/wasm/keeper/contract_keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type decoratedKeeper interface {
pinCode(ctx sdk.Context, codeID uint64) error
unpinCode(ctx sdk.Context, codeID uint64) error
execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, msg []byte, coins sdk.Coins) ([]byte, error)
executeCallablePoint(ctx sdk.Context, contractAddress sdk.AccAddress, argsEv []byte, callablePointName string) ([]byte, error)
Sudo(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte) ([]byte, error)
setContractInfoExtension(ctx sdk.Context, contract sdk.AccAddress, extra types.ContractInfoExtension) error
setAccessConfig(ctx sdk.Context, codeID uint64, config types.AccessConfig) error
Expand Down Expand Up @@ -53,6 +54,10 @@ func (p PermissionedKeeper) Execute(ctx sdk.Context, contractAddress sdk.AccAddr
return p.nested.execute(ctx, contractAddress, caller, msg, coins)
}

func (p PermissionedKeeper) ExecuteCallablePoint(ctx sdk.Context, contractAddress sdk.AccAddress, argsEv []byte, callablePointName string) ([]byte, error) {
return p.nested.executeCallablePoint(ctx, contractAddress, argsEv, callablePointName)
}

func (p PermissionedKeeper) Migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newCodeID uint64, msg []byte) ([]byte, error) {
return p.nested.migrate(ctx, contractAddress, caller, newCodeID, msg, p.authZPolicy)
}
Expand Down
26 changes: 26 additions & 0 deletions x/wasm/keeper/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ func newWasmModuleEvent(customAttributes []wasmvmtypes.EventAttribute, contractA
return sdk.Events{sdk.NewEvent(types.WasmModuleEventType, attrs...)}, nil
}

func newWasmModuleEventForCallablePoint(customAttributes []wasmvmtypes.EventAttribute, contractAddr sdk.AccAddress) (sdk.Events, error) {
attrs, err := contractSDKEventAttributes(customAttributes, contractAddr)
if err != nil {
return nil, err
}

// each wasm invocation always returns one sdk.Event
return sdk.Events{sdk.NewEvent(types.WasmModuleEventTypeForCallablePoint, attrs...)}, nil
}

const eventTypeMinLength = 2

// newCustomEvents converts wasmvm events from a contract response to sdk type events
Expand All @@ -42,6 +52,22 @@ func newCustomEvents(evts wasmvmtypes.Events, contractAddr sdk.AccAddress) (sdk.
return events, nil
}

func newCustomEventsForCallablePoint(evts wasmvmtypes.Events, contractAddr sdk.AccAddress) (sdk.Events, error) {
events := make(sdk.Events, 0, len(evts))
for _, e := range evts {
typ := strings.TrimSpace(e.Type)
if len(typ) <= eventTypeMinLength {
return nil, sdkerrors.Wrap(types.ErrInvalidEvent, fmt.Sprintf("Event type too short: '%s'", typ))
}
attributes, err := contractSDKEventAttributes(e.Attributes, contractAddr)
if err != nil {
return nil, err
}
events = append(events, sdk.NewEvent(fmt.Sprintf("%s%s", types.CustomContractEventPrefixForCallablePoint, typ), attributes...))
}
return events, nil
}

// convert and add contract address issuing this event
func contractSDKEventAttributes(customAttributes []wasmvmtypes.EventAttribute, contractAddr sdk.AccAddress) ([]sdk.Attribute, error) {
attrs := []sdk.Attribute{sdk.NewAttribute(types.AttributeKeyContractAddr, contractAddr.String())}
Expand Down
82 changes: 82 additions & 0 deletions x/wasm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
paramtypes "github.com/line/lbm-sdk/x/params/types"
"github.com/line/lbm-sdk/x/wasm/ioutils"
"github.com/line/lbm-sdk/x/wasm/types"

"encoding/json"
)

// contractMemoryLimit is the memory limit of each contract execution (in MiB)
Expand Down Expand Up @@ -449,6 +451,60 @@ func (k Keeper) execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller
return data, nil
}

func (k Keeper) executeCallablePoint(ctx sdk.Context, contractAddress sdk.AccAddress, argsEv []byte, callablePointName string) ([]byte, error) {
defer func(begin time.Time) { k.metrics.ExecuteElapsedTimes.Observe(time.Since(begin).Seconds()) }(time.Now())
contractInfo, codeInfo, prefixStore, err := k.contractInstance(ctx, contractAddress)
if err != nil {
return nil, err
}
if k.IsInactiveContract(ctx, contractAddress) {
return nil, sdkerrors.Wrap(types.ErrInactiveContract, "can not execute")
}

executeCosts := k.instantiateContractCosts(k.gasRegister, ctx, k.IsPinnedCode(ctx, contractInfo.CodeID), len(argsEv))
ctx.GasMeter().ConsumeGas(executeCosts, "Loading CosmWasm module: execute")

env := types.NewEnv(ctx, contractAddress)

// prepare querier
querier := k.newQueryHandler(ctx, contractAddress)
gas := k.runtimeGasForContract(ctx)
wasmStore := types.NewWasmStore(prefixStore)

funcNameWithCallablePointBin, err := json.Marshal(callablePointName)
if err != nil {
panic(fmt.Sprintf("failed to marshal JSON: %s", err))
}

if err != nil {
panic(fmt.Sprintf("failed to marshal JSON: %s", err))
}

empty := []wasmvmtypes.HumanAddress{}
emptyBin, err := json.Marshal(empty)
if err != nil {
panic(fmt.Sprintf("failed to marshal JSON: %s", err))
}
data, evts, attrs, gasUsed, execErr := k.wasmVM.CallCallablePoint(funcNameWithCallablePointBin, codeInfo.CodeHash, false, emptyBin, env, argsEv, wasmStore, k.cosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization)

k.consumeRuntimeGas(ctx, gasUsed)
if execErr != nil {
return nil, sdkerrors.Wrap(types.ErrExecuteFailed, execErr.Error())
}

ctx.EventManager().EmitEvent(sdk.NewEvent(
types.EventTypeCallablePoint,
sdk.NewAttribute(types.AttributeKeyContractAddr, contractAddress.String()),
))

err = k.handleContractResponseForCallblePoint(ctx, contractAddress, attrs, evts)
if err != nil {
return nil, sdkerrors.Wrap(err, "emit all events")
}

return data, nil
}

func (k Keeper) migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newCodeID uint64, msg []byte, authZ AuthorizationPolicy) ([]byte, error) {
defer func(begin time.Time) { k.metrics.MigrateElapsedTimes.Observe(time.Since(begin).Seconds()) }(time.Now())
migrateSetupCosts := k.instantiateContractCosts(k.gasRegister, ctx, k.IsPinnedCode(ctx, newCodeID), len(msg))
Expand Down Expand Up @@ -1001,6 +1057,32 @@ func (k *Keeper) handleContractResponse(
return k.wasmVMResponseHandler.Handle(ctx, contractAddr, ibcPort, msgs, data)
}

func (k *Keeper) handleContractResponseForCallblePoint(
ctx sdk.Context,
contractAddr sdk.AccAddress,
attrs []wasmvmtypes.EventAttribute,
evts wasmvmtypes.Events,
) error {
attributeGasCost := k.gasRegister.EventCosts(attrs, evts)
ctx.GasMeter().ConsumeGas(attributeGasCost, "Custom contract event attributes")
// emit all events from this contract itself
if len(attrs) != 0 {
wasmEvents, err := newWasmModuleEventForCallablePoint(attrs, contractAddr)
if err != nil {
return err
}
ctx.EventManager().EmitEvents(wasmEvents)
}
if len(evts) > 0 {
customEvents, err := newCustomEventsForCallablePoint(evts, contractAddr)
if err != nil {
return err
}
ctx.EventManager().EmitEvents(customEvents)
}
return nil
}

func (k Keeper) runtimeGasForContract(ctx sdk.Context) uint64 {
meter := ctx.GasMeter()
if meter.IsOutOfGas() {
Expand Down
102 changes: 102 additions & 0 deletions x/wasm/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ func init() {
if err != nil {
panic(err)
}
e, err := ioutil.ReadFile("./testdata/events.wasm")
if err != nil {
panic(err)
}
hackatomWasm = b
eventsWasm = e
}

var hackatomWasm []byte
var eventsWasm []byte

const SupportedFeatures = "iterator,staking,stargate"

Expand Down Expand Up @@ -645,6 +651,102 @@ func TestExecute(t *testing.T) {
t.Logf("Duration: %v (%d gas)\n", diff, gasAfter-gasBefore)
}

func TestExecuteCallablePoint(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil)
accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.ContractKeeper, keepers.BankKeeper

deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...)

contractID, err := keeper.Create(ctx, creator, eventsWasm, nil)
require.NoError(t, err)

_, _, bob := keyPubAddr()
initMsgBz := []byte(`{}`)

addr, _, err := keepers.ContractKeeper.Instantiate(ctx, contractID, creator, nil, initMsgBz, "demo contract 3", deposit)
require.NoError(t, err)
require.Equal(t, "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8", addr.String())

// ensure bob doesn't exist
bobAcct := accKeeper.GetAccount(ctx, bob)
require.Nil(t, bobAcct)

// ensure funder has reduced balance
creatorAcct := accKeeper.GetAccount(ctx, creator)
require.NotNil(t, creatorAcct)
// we started at 2*deposit, should have spent one above
assert.Equal(t, deposit, bankKeeper.GetAllBalances(ctx, creatorAcct.GetAddress()))

// ensure contract has updated balance
contractAcct := accKeeper.GetAccount(ctx, addr)
require.NotNil(t, contractAcct)
assert.Equal(t, deposit, bankKeeper.GetAllBalances(ctx, contractAcct.GetAddress()))

// verifier can execute, and get proper gas amount
start := time.Now()
gasBefore := ctx.GasMeter().GasConsumed()
em := sdk.NewEventManager()
// when
var callableFuncName string
callableFuncName = "add_events_dyn"
eventsIn := wasmvmtypes.Events{
wasmvmtypes.Event{
Type: "ty1",
Attributes: wasmvmtypes.EventAttributes{
wasmvmtypes.EventAttribute{
Key: "alice",
Value: "101010",
},
wasmvmtypes.EventAttribute{
Key: "bob",
Value: "42",
},
},
},
wasmvmtypes.Event{
Type: "ty2",
Attributes: wasmvmtypes.EventAttributes{
wasmvmtypes.EventAttribute{
Key: "ALICE",
Value: "42",
},
wasmvmtypes.EventAttribute{
Key: "BOB",
Value: "101010",
},
},
},
}
eventsInBin, err := eventsIn.MarshalJSON()
argsEv := [][]byte{eventsInBin}
argsEvBin, err := json.Marshal(argsEv)
require.NoError(t, err)

res, err := keepers.ContractKeeper.ExecuteCallablePoint(ctx.WithEventManager(em), addr, argsEvBin, callableFuncName)
diff := time.Now().Sub(start)
require.NoError(t, err)
require.NotNil(t, res)

// confirm emit events
require.Equal(t, "callable_point", em.Events()[0].Type)
require.Equal(t, "wasm-callable_point-ty1", em.Events()[1].Type)
require.Equal(t, "wasm-callable_point-ty2", em.Events()[2].Type)

// make sure gas is properly deducted from ctx
gasAfter := ctx.GasMeter().GasConsumed()
if types.EnableGasVerification {
require.Equal(t, uint64(0xfd87), gasAfter-gasBefore)
}

// ensure that no coins have been sent
contractAcct = accKeeper.GetAccount(ctx, addr)
require.NotNil(t, contractAcct)
assert.Equal(t, deposit, bankKeeper.GetAllBalances(ctx, contractAcct.GetAddress()))

t.Logf("Duration: %v (%d gas)\n", diff, gasAfter-gasBefore)
}

func TestExecuteWithDeposit(t *testing.T) {
var (
bob = bytes.Repeat([]byte{1}, types.SDKAddrLen)
Expand Down
Binary file added x/wasm/keeper/testdata/events.wasm
Binary file not shown.
8 changes: 8 additions & 0 deletions x/wasm/keeper/wasmtesting/mock_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type MockWasmer struct {
AnalyzeCodeFn func(codeID wasmvm.Checksum) (*wasmvmtypes.AnalysisReport, error)
InstantiateFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error)
ExecuteFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error)
CallCallablePointFn func(name []byte, checksum wasmvm.Checksum, isReadonly bool, callstack []byte, env wasmvmtypes.Env, args []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) ([]byte, wasmvmtypes.Events, wasmvmtypes.EventAttributes, uint64, error)
QueryFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, queryMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) ([]byte, uint64, error)
MigrateFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, migrateMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error)
SudoFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, sudoMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error)
Expand Down Expand Up @@ -109,6 +110,13 @@ func (m *MockWasmer) Execute(codeID wasmvm.Checksum, env wasmvmtypes.Env, info w
return m.ExecuteFn(codeID, env, info, executeMsg, store, goapi, querier, gasMeter, gasLimit, deserCost)
}

func (m *MockWasmer) CallCallablePoint(name []byte, checksum wasmvm.Checksum, isReadonly bool, callstack []byte, env wasmvmtypes.Env, argsEv []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) ([]byte, wasmvmtypes.Events, wasmvmtypes.EventAttributes, uint64, error) {
if m.CallCallablePointFn == nil {
panic("not supposed to be called!")
}
return m.CallCallablePointFn(name, checksum, isReadonly, callstack, env, argsEv, store, goapi, querier, gasMeter, gasLimit, deserCost)
}

func (m *MockWasmer) Query(codeID wasmvm.Checksum, env wasmvmtypes.Env, queryMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) ([]byte, uint64, error) {
if m.QueryFn == nil {
panic("not supposed to be called!")
Expand Down
Binary file modified x/wasm/testdata/call_number.wasm
Binary file not shown.
Binary file modified x/wasm/testdata/dynamic_callee_contract.wasm
Binary file not shown.
Binary file modified x/wasm/testdata/dynamic_caller_contract.wasm
Binary file not shown.
Binary file modified x/wasm/testdata/number.wasm
Binary file not shown.
7 changes: 5 additions & 2 deletions x/wasm/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ package types

const (
// WasmModuleEventType is stored with any contract TX that returns non empty EventAttributes
WasmModuleEventType = "wasm"
WasmModuleEventType = "wasm"
WasmModuleEventTypeForCallablePoint = "wasm-callable_point"
// CustomContractEventPrefix contracts can create custom events. To not mix them with other system events they got the `wasm-` prefix.
CustomContractEventPrefix = "wasm-"
CustomContractEventPrefix = "wasm-"
CustomContractEventPrefixForCallablePoint = "wasm-callable_point-"

EventTypeStoreCode = "store_code"
EventTypeInstantiate = "instantiate"
EventTypeExecute = "execute"
EventTypeCallablePoint = "callable_point"
EventTypeMigrate = "migrate"
EventTypeUpdateAdmin = "update_admin"
EventTypeClearAdmin = "clear_admin"
Expand Down
2 changes: 2 additions & 0 deletions x/wasm/types/exported_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type ContractOpsKeeper interface {
// Execute executes the contract instance
Execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, msg []byte, coins sdk.Coins) ([]byte, error)

ExecuteCallablePoint(ctx sdk.Context, contractAddress sdk.AccAddress, argsEv []byte, funcNameWithCallablePoint string) ([]byte, error)

// Migrate allows to upgrade a contract to a new code with data migration.
Migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newCodeID uint64, msg []byte) ([]byte, error)

Expand Down
16 changes: 16 additions & 0 deletions x/wasm/types/wasmer_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ type WasmerEngine interface {
deserCost wasmvmtypes.UFraction,
) (*wasmvmtypes.Response, uint64, error)

// Execute the collable_point function of the callee contract.
CallCallablePoint(
name []byte,
code wasmvm.Checksum,
isReadonly bool,
caller []byte,
env wasmvmtypes.Env,
argsEv []byte,
store wasmvm.KVStore,
goapi wasmvm.GoAPI,
querier wasmvm.Querier,
gasMeter wasmvm.GasMeter,
gasLimit uint64,
deserCost wasmvmtypes.UFraction,
) ([]byte, wasmvmtypes.Events, wasmvmtypes.EventAttributes, uint64, error)

// Query allows a client to execute a contract-specific query. If the result is not empty, it should be
// valid json-encoded data to return to the client.
// The meaning of path and data can be determined by the code. Path is the suffix of the abci.QueryRequest.Path
Expand Down