feat: Port x/wasm module #92
Closed
aleem1314 wants to merge 3 commits from
aleem/25-wasmd into main
pull from: aleem/25-wasmd
merge into: :main
:main
:zach/prefix
:roy/rm-hardcoded-records
:roy/graphql-to-ipld
:roy/qol-improvements
:murali/gql
:murali/update-fork
:murali/record-attributes
:aleem/fix-lint-errors
:murali/CIDFromJSONBytes
:update-validator-doc-v0.8.0
:feature_test_record_types
:aleem/25-wasmd
:release-v0.8.0
:nameservice_tests_github
:auction_tests
:all_test_stuff
:fix_cid_generation
:run_tests_github_action
:0-7-0-upgrade-guide
:murali/sdk-integration-tests
:murali/quick-fix
:dboreham/sdk-integration-test
:console_release
:release-v0.3.1-dev
:release-v0.6.0
:anil/lint
:murali/to_ipld_prime
:docs
:release-v0.2.0-dev
:ian/smt
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
C:CLI
C:Crypto
C:Encoding
C:Proto
C:Types
Status: Stale
Type: ADR
Type: Build
Type: CI
Type: Docs
Type: Tests
bug
dependencies
docker
documentation
duplicate
enhancement
go
good first issue
help wanted
high priority
in progress
invalid
javascript
low priority
medium priority
question
urgent
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Something isn't working
Pull requests that update a dependency file
Pull requests that update Docker code
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Pull requests that update Go code
Good for newcomers
Extra attention is needed
currently working on
This doesn't seem right
Pull requests that update Javascript code
Further information is requested
Top priority issue
This will not be worked on
An issue or PR manually copied from GitHub.
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/laconicd-deprecated#92
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Ref: #25
Description
For contributor use:
docs/) or specification (x/<module>/spec/)godoccomments.Unreleasedsection inCHANGELOG.mdFiles changedin the Github PR explorerFor admin use:
WIP,R4R,docs, etc)@@ -0,0 +813,4 @@proposalTitle, err := cmd.Flags().GetString(cli.FlagTitle)if err != nil {return clientCtx, proposalTitle, "", nil, err}Variable
$Xis likely modified and later used on error. In some cases this could result in panics due to a nil dereferenceVariable
proposalTitleis likely modified and later used on error. In some cases this could result in panics due to a nil dereferenceShow more details
@@ -0,0 +818,4 @@proposalDescr, err := cmd.Flags().GetString(cli.FlagDescription)if err != nil {return client.Context{}, proposalTitle, proposalDescr, nil, err}Variable
$Xis likely modified and later used on error. In some cases this could result in panics due to a nil dereferenceVariable
proposalDescris likely modified and later used on error. In some cases this could result in panics due to a nil dereferenceShow more details
@@ -0,0 +828,4 @@deposit, err := sdk.ParseCoinsNormalized(depositArg)if err != nil {return client.Context{}, proposalTitle, proposalDescr, deposit, err}Variable
$Xis likely modified and later used on error. In some cases this could result in panics due to a nil dereferenceVariable
depositis likely modified and later used on error. In some cases this could result in panics due to a nil dereferenceShow more details
@@ -0,0 +120,4 @@return err}endpoint.ClientID, err = ibctesting.ParseClientIDFromEvents(res.GetEvents())Should
$Xbe modified when an error could be returned?Should
endpointbe modified when an error could be returned?Show more details
@@ -0,0 +167,4 @@return err}endpoint.ConnectionID, err = ibctesting.ParseConnectionIDFromEvents(res.GetEvents())Should
$Xbe modified when an error could be returned?Should
endpointbe modified when an error could be returned?Show more details
@@ -0,0 +194,4 @@}if endpoint.ConnectionID == "" {endpoint.ConnectionID, err = ibctesting.ParseConnectionIDFromEvents(res.GetEvents())Should
$Xbe modified when an error could be returned?Should
endpointbe modified when an error could be returned?Show more details
@@ -0,0 +278,4 @@return err}endpoint.ChannelID, err = ibctesting.ParseChannelIDFromEvents(res.GetEvents())Should
$Xbe modified when an error could be returned?Should
endpointbe modified when an error could be returned?Show more details
@@ -0,0 +310,4 @@}if endpoint.ChannelID == "" {endpoint.ChannelID, err = ibctesting.ParseChannelIDFromEvents(res.GetEvents())Should
$Xbe modified when an error could be returned?Should
endpointbe modified when an error could be returned?Show more details
@@ -0,0 +157,4 @@checksum, err = k.wasmVM.Create(wasmCode)if err != nil {return 0, checksum, sdkerrors.Wrap(types.ErrCreateFailed, err.Error())}Variable
$Xis likely modified and later used on error. In some cases this could result in panics due to a nil dereferenceVariable
checksumis likely modified and later used on error. In some cases this could result in panics due to a nil dereferenceShow more details
@@ -0,0 +71,4 @@func (coord *Coordinator) UpdateTime() {for _, chain := range coord.Chains {coord.UpdateTimeForChain(chain)}Iteration over map
Iteration over map may be a possible source of non-determinism
Show more details
@@ -0,0 +7,4 @@"encoding/hex""fmt""math""reflect"Sensitive package import
Certain system packages contain functions which may be a possible source of non-determinism
Show more details
@@ -0,0 +2,4 @@import ("encoding/json""reflect"Sensitive package import
Certain system packages contain functions which may be a possible source of non-determinism
Show more details
@@ -0,0 +73,4 @@if err != nil {return nil, err}if rsp == nil || reflect.ValueOf(rsp).IsNil() {Impossible interface nil check
This value can never be nil, since it is a wrapped interface value.
Show more details
@@ -0,0 +2,4 @@import ("fmt""reflect"Sensitive package import
Certain system packages contain functions which may be a possible source of non-determinism
Show more details
Thanks @aleem1314! I am wondering if we can get away with using WASM tooling as dependencies rather than internalizing a stateful module for them.
Background here is relevant here too. WASM execution environment is another piece necessary to fulfill the goal of "On-chain watcher fraud proof evaluation", it is this environment that we will need to provide access to the Postgres IPLD blockstore through the package discussed there.
Tagging @AFDudley here to discuss too.
Based on my current understanding the WASM execution environment we will use in laconicd will not need to write state into the Tendermint/Cosmos state commitment (IAVL). Service providers will usually run watcher WASM "off-chain", in watcher groups, and only when someone submits a fraud proof to Laconic does the laconicd state machine execute WASM to evaluate the fraud proof by re-running the challenged watcher state transitions to see if the result matches the result provided. But, are the state changes affected during this evaluation committed back to Tendermint? Or are they executed in a sort of speculative manner and the only thing committed is a signed attestation to the result of the evaluation?
I think the result needs to be written to the chain, but we will need to use IPLD and probably make some other changes so that it's efficient to store.
The CosmWasmVM
InstantiateandExecuteref methods requires access to theKVStore. If we keep wasm not as a stateful module, which module store we are going to use in thewasm?This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days-before-close if no further activity occurs.
Pull request closed