finschia / wasmd Goto Github PK
View Code? Open in Web Editor NEWThis project forked from cosmwasm/wasmd
Basic cosmos-sdk app with web assembly smart contracts
License: Other
This project forked from cosmwasm/wasmd
Basic cosmos-sdk app with web assembly smart contracts
License: Other
In the dynamic_link branch separated process, the following function of wasmplus cannot be used in the #22 separated method due to circular reference problems.
Separation must be done by another method
wasmd/x/wasmplus/keeper/keeper.go
Lines 93 to 96 in 60fec8a
I couldn't get events of SetWithdrawAddress
and WithdrawDelegatorReward
in reply
. There are events of SetWithdrawAddress
in a transaction result, but contracts can't get it in reply.
https://github.com/ulbqb/finschia-wasmd-issue114/blob/9743a5ce4014226e66ef949db85c0b74d8476847/contracts/delegator/src/contract.rs#L116
The number of events is 0.
The method #36 cannot be executed in x/wasm alone, because it uses the x/wasmplus functionality within x/wasm.
Then, instead of pluskeeper
, which was added in #36, add an interface of wasmvm.GoAPI
to the structure of keeper
.
This allows the implementation of this interface to freely change the contents of the API.
In dynamic_link branch, https://github.com/line/lbm-sdk/blob/dynamic_link/.github/workflows/bench.yml benchmarks cosmwasm API for each PRs. I suggest adding other benchmarks to the workflow following this.
There are some problems in my naive trying (https://github.com/line/lbm-sdk/runs/8133107470?check_suite_focus=true)
Currently unspecified.
https://github.com/Finschia/wasmd/blob/main/proto/buf.yaml#L9-L11
It is better to specify.
https://github.com/CosmWasm/wasmd/blob/main/proto/buf.yaml#L4-L8
This issue is related to #121
I have conducted operational verification using the current commit hash with the versions from Finschia/cosmwasm#342 and Finschia/wasmvm#139.
TestZeroHeightGenesis
(appplus/export_test.go)TestOnRecvPacket
(x/wasm/ibc_test.go) - prefix errorTestParseVerificationFlags
(x/wasm/client/cli/tx_test.go) - prefix errorTestGenesisInit
(x/wasm/keeper/genesis_test.go)TestImportContractWithCodeHistoryPreserved
(x/wasm/keeper/genesis_test.go)TestInstantiate
(x/wasm/keeper/keeper_test.go) - address errorTestExecute
(x/wasm/keeper/keeper_test.go) - address errorTestSudo
(x/wasm/keeper/keeper_test.go) - address errorTestQueryAllContractState
(x/wasm/keeper/keeper_test.go)TestQueryRawContractState
(x/wasm/keeper/querier_test.go)TestQueryCode
(x/wasm/keeper/querier_test.go)TestQueryCodeList
(x/wasm/keeper/querier_test.go)TestQueryPinnedCodes
(x/wasm/keeper/querier_test.go)TestQueryCodeInfo
(x/wasm/keeper/querier_test.go) - prefix errorTestQueryCodeInfoList
(x/wasm/keeper/querier_test.go) - prefix errorTestDispatchSubMsgErrorHandling
(x/wasm/keeper/submsg_test.go)TestModuleMigrations
(x/wasm/keeper/migrations_integration_test.go)TestCodeValidateBasic
(x/wasm/types/genesis_test.go)TestHandleStoreAndInstantiate
(x/wasmplus/module_test.go ONLY Finschia) - address errorTestErrorsCreateAndInstantiate
(x/wasmplus/module_test.go ONLY Finschia)TestHandleNonPlusWasmCreate
(x/wasmplus/module_test.go ONLY Finschia)TestGenesisExportImport
(x/wasmplus/keeoer/genesis_test.go ONLY Finschia)inactive_contract_address
of message genesis and gans_multiplier
of message Params are all custom changes. So we need to remove in cosmwas, proto and add to custom genensis and params in lbm proto.
replace github.com/line
with github.com/Finschia
bump up to cosmwasm/wasmd v0.31
Here is a possibility that the finschia-sdk module can be invoked within a Custom CosmosMsg via SubMsg. Given this, it seems necessary to apply a filter to prevent the use of the finschia-sdk module.
The task is to check if there is a need to apply a filter and, if necessary, proceed with its implementation.
https://github.com/Finschia/wasmvm/blob/5675e0d83bba669ee367f4cf004f23aeb7c81a3a/types/msg.go#L101
The comparison of events is difficult to understand, so we would like to make it easier to understand by using the utility function or other means.
change to use Unmarshal data response
wasmd/x/wasm/keeper/msg_server_integration_test.go
Lines 208 to 209 in bb3a88f
For attributes and events that are specific to a contract, we would like to add comments to make them easier to understand.
This issue related to #43
Check the x/wasmplus authority for active/inactive specifications.
MsgStoreCodeAndInstantiateContract amino signature verify fails because wrong amino codec is being used in MsgStoreCodeAndInstantiateContract::GetSignBytes()
. Now wasm's amino codec is being used not wasmplus's amino codec.
https://github.com/line/wasmd/blob/main/x/wasmplus/types/tx.go#L54
And I got one more error.
https://github.com/line/wasmd/blob/main/x/wasmplus/types/codec.go#L19
when registering amino msg in codec, amino message type name is wrong.
currently "wasm/StoreCodeAndInstantiateContract"
, this should be "wasm/MsgStoreCodeAndInstantiateContract"
like other messages.
Now we use MustAccAddressFromBech32
for converting bech32 string to account address in
wasmd/x/wasmplus/keeper/api.go
Line 22 in 2e0fe8b
and
wasmd/x/wasmplus/keeper/api.go
Line 32 in 2e0fe8b
.
It panics if the bech32 string is an invalid address.
We should use AccAddressFromBech32
and do error handling for them.
This function came from #26.
It's a bit weird that the callstack comes first, so move it to the tail.
wasmd/x/wasmplus/keeper/events.go
Lines 42 to 50 in d6ea9ec
Line 33 in d08bbbd
This code wraps the result which is already wrapped. It is a bug.
Research about standard interface detection.
EVM's function selector
.We need to know whether a specific smart contract supports a specific protocol, so that the smart contract can be excute and searched without errors in other smart contracts. For this purpose, in the case of EVM, the function of a function selector
is provided. Let's see if there is a function that can replace EVM's function selector
function that can distinguish a specific function from the wasm binary even in wasm of lbm-sdk.
If that feature doesn't exist, find out how to replace it.
Inheritance is not supported like EVM throught rustlang, the smart contract development language of cosmwasm. Then, we also suggest how to make a protocol such as ERC-165 a library so that other smart contract developers can use it.
At present #22, only partial separation has been made for dynamic link branch of wasmd, so consider how to do this.
The following methods were used for implementation.
In #36, moved dynamic_link branch functionality to wasmplus.
It is implemented in the following way.
x/wasmplus/keeper.go
in x/wasm/keeper.go.
x/wasm
, functions and variables to be exposed to the outside world are defined as other variables in exported_*.go, in order to reduce differences from the original.x/wasmplus/api.go
via the interface in x/wasm/keeper.go
.The current version of wasmd depends on the bankplus
feature, which is an original functionality of the finschia-sdk.
Since the finschia-sdk is currently undergoing a version bump, we will use mocks to handle this dependency in the meantime.
This PR related to Finschia/finschia-sdk#1195, Finschia/finschia-sdk#1212
The parts that use bankplus are located in the following files:
The NewBaseKeeper
interface will be modified as follows:
Before:
func NewBaseKeeper(
cdc codec.Codec, storeKey sdk.StoreKey, ak types.AccountKeeper, paramSpace paramtypes.Subspace,
blockedAddr map[string]bool, deactMultiSend bool,
) BaseKeeper
After:
func NewBaseKeeper(
cdc codec.Codec, storeService store.KVStoreService, ak types.AccountKeeper,
blockedAddr map[string]bool, deactMultiSend bool, authority string, logger log.Logger,
) BaseKeeper
The Ostracon
's light client name is changed for ibc in last line/igc-go
(Finschia/ibc-go#6).
So wasmd also need to bump up.
The used light-client name is changed
99-ostracon
-> 07-tendermint
The key used for sorting is a byte array of Contract Address.
wasmd/x/wasmplus/types/keys.go
Line 25 in 40fa7c7
line -> finschia
Since cosmwasmAPIGeneratorImpl
was added in #41, and it is not good that cosmwasmAPIImpl
and cosmwasmAPIGeneratorImpl
coexist, I think it would be better to abolish cosmwasmAPIImpl
and define it as a higher-order function and use that.ใ
wasmd/x/wasmplus/keeper/api.go
Lines 13 to 16 in d6ea9ec
wasmd/x/wasm/keeper/query_plugins.go
Line 109 in c83ad2f
This function is duplicated with Stargate querier.
Key of sort is:
Line 56 in 40fa7c7
lbm-sdk#854 is that remove useless stub BeginBlock/EndBlock methods
When I run wasmd start
, wasmvm module not exist
error is occurred.
$ ./build/wasmd start
Error: wasmvm module not exist
Usage:
wasmd start [flags]
commit hash: 577e450 (main branch)
Make it easy to understand Inactive
wasmd/x/wasmplus/keeper/api.go
Lines 25 to 27 in d6ea9ec
wasmd/x/wasm/keeper/keeper_test.go
Lines 1722 to 1748 in c23a2db
Line 26 in d08bbbd
This handler case is caused by "x/wasm/handler"'s "ErrorMsg". This condition is true when the message contains "MsgStoreCodeAndInstantiateContract" even if the message kind is not "MsgStoreCodeAndInstantiateContract".
Change it the condition is true iff the message kind is "MsgStoreCodeAndInstantiateContract".
There are no test handling messages other than "StoreCodeAndINstantiateContract" in wasmplus.
related #33
Refer: Finschia/finschia#228
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.