-
Notifications
You must be signed in to change notification settings - Fork 598
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
Add wasmd module #769
Add wasmd module #769
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
Codecov Report
@@ Coverage Diff @@
## main #769 +/- ##
==========================================
- Coverage 20.00% 20.00% -0.01%
==========================================
Files 189 189
Lines 24546 24549 +3
==========================================
Hits 4910 4910
- Misses 18780 18783 +3
Partials 856 856
Continue to review full report at Codecov.
|
…for more configurable tests
I just want to write a few full stack tests on the integration, but the "production" code is done and can be reviewed |
// here we override wasm config to make it permissioned by default | ||
wasmGen := wasm.GenesisState{ | ||
Params: wasmtypes.Params{ | ||
CodeUploadAccess: wasmtypes.AllowNobody, | ||
InstantiateDefaultPermission: wasmtypes.AccessTypeEverybody, | ||
MaxWasmCodeSize: DefaultMaxWasmCodeSize, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool! So when we do the upgrade to cosmwasm, do we need to override these in InitGenesis as well?
Heres what we had to do for x/txfees
in our v5 upgrade: https://github.com/osmosis-labs/osmosis/blob/main/app/upgrades/v5/upgrades.go#L60-L66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we will need a migration step, that will set the params explicitly.
I wanted to do that on another PR. I could copy your migration setup, but would be happier to add a few lines to an existing one (if you could set up the framework for v6 upgrade)
// we need to make this deterministic (same every test run), as content might affect gas costs | ||
func keyPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) { | ||
key := ed25519.GenPrivKey() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So do we need to switch to GenPrivKeyFromSecret? (https://github.com/tendermint/tendermint/blob/master/crypto/ed25519/ed25519.go#L144 )
Also a bit surprised that this is an ed25519 address, versus a secp one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, copied some code I found elsewhere (in wasmd).
The original one in wasmd had a deterministic seed (generated from a counter). I tried making this random, but can use this.
Can you link me to where you generate random addresses in your codebase? I can just import that instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just update this code in a separate PR yourself. As long as it returns valid addresses, it is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Feel free to merge, we can adjust the minor point around the pointer receiver for wasm keeper in a second PR if you'd like.
Happy to make the adjustments here. My only question is how to improve the "random key/address" generation, or align it better to the osmosis standard. |
Made the fixes and it passes CI! If you start a migration PR (it would be v6 or v7?) let me know and I will add the wasm-specific migration so we can test that. |
bye bye my hard drives 😉 |
Awesome thanks! I'll get the initial migration handlers up in a PR! |
@marbar3778 haha, hopefully cosmwasm state sync will save us in the future |
@@ -842,6 +890,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino | |||
paramsKeeper.Subspace(poolincentivestypes.ModuleName) | |||
paramsKeeper.Subspace(superfluidtypes.ModuleName) | |||
paramsKeeper.Subspace(gammtypes.ModuleName) | |||
paramsKeeper.Subspace(wasm.ModuleName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ethanfrey
The pinned contracts are not loaded within the if loadLatest
block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good catch. Thank you
This is to add a v1 of wasmd integration.
In another PR we look to add the x/upgrade logic to set the global permissions on upgrade not just genesis