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: merge wasmd v0.27.0 #570

Merged
merged 144 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
8e5f86d
Important: add iterator feature support
ethanfrey Sep 22, 2021
51db87b
Fix inconsistent return of contractAddress from keeper/init()
assafmo Sep 22, 2021
5eaa33d
Handle contract info query
alpe Sep 27, 2021
7596bc4
Implement tx counter for transaction info
alpe Sep 27, 2021
eba1387
Treat all contracts as pinned for gas costs in reply
ethanfrey Oct 7, 2021
40a4f52
Adjust gas prices in tests
ethanfrey Oct 7, 2021
566713c
Query all pinned code ids
alpe Oct 7, 2021
a488fab
Upgrade wasmvm-v1.0.0-soon2
alpe Oct 7, 2021
f985d50
Benchmarks for gas pricing
ethanfrey Oct 8, 2021
c1d2cb5
Update gas costs
alpe Oct 8, 2021
4e90a9b
fix: fix build error
shiki-tak Jun 8, 2022
7ff106e
remove unused flags from cmd prompt
fkneeland-figure Oct 14, 2021
43d8345
Add golangci lint check on pull requests
fkneeland-figure Oct 25, 2021
5e4eb96
Fix message representation for signing
alpe Oct 25, 2021
d247e9c
Add linter name and minor golint related updates
alpe Oct 25, 2021
763762e
Fixed wrong error message when lastCodeID value is incorrect
fkneeland-figure Oct 26, 2021
c62d0d9
Disable false positive
alpe Oct 26, 2021
c2b8b3c
Open read access to sequences
alpe Nov 5, 2021
aa6e12a
Limit simulation gas
alpe Nov 17, 2021
95f7d37
fix: build error
shiki-tak Jun 9, 2022
ac0957c
Return NoSuchContract system error instead of sdk error in ContractIn…
maurolacy Dec 16, 2021
0aa7bff
Implement PinCode and UnpinCode proposal client handlers (#707)
orkunkl Dec 23, 2021
dbf864e
Upgrade wasmvm to v1.0.0-beta5
alpe Jan 4, 2022
68a1a39
Upgrade to cosmos-sdk v0.45.0
alpe Jan 20, 2022
06c83fe
Proper systemerror follow-up
maurolacy Jan 20, 2022
86d0a86
Failing test showing it was not currently pinned
ethanfrey Jan 20, 2022
c2c461e
And properly pin it on governance vote
ethanfrey Jan 20, 2022
fa95a2f
Require --no-admin flag if no admin set
ethanfrey Jan 20, 2022
e1d1e12
Fix tests, handle genesis init as well
ethanfrey Jan 20, 2022
0fb3d3e
Fixed error message capitalization
ethanfrey Jan 21, 2022
d1e6f74
Add new proto types for the sudo an execute proposals
ethanfrey Jan 21, 2022
dde48d8
Compile proto files
shiki-tak Jun 14, 2022
a539857
Registered new proposal types
ethanfrey Jan 21, 2022
c612791
fix: remove unnecessary print
shiki-tak Jun 14, 2022
b3ec5ec
Wire up proposal handlers
ethanfrey Jan 21, 2022
ee96128
Wire up cli for exec and sudo proposal
ethanfrey Jan 21, 2022
ba93d96
Add rest routes for proposals;
ethanfrey Jan 24, 2022
72266ee
Add tests for Rest client
ethanfrey Jan 24, 2022
f9be9b2
Test execute and sudo proposal handlers
ethanfrey Jan 24, 2022
12faa2d
Remove RunAs from Migrate proposal
ethanfrey Jan 24, 2022
d13503b
fix tests
ethanfrey Jan 24, 2022
21163d8
Allow sending tokens along with governance wasm_execute proposal
ethanfrey Jan 24, 2022
5b639c7
Update documentation
ethanfrey Jan 24, 2022
275e1c5
Minor integration support
alpe Jan 28, 2022
0ccbd77
add missing colons in String of some proposals
loloicci Feb 10, 2022
a8c5282
Replace custom codec with sdk codec
alpe Feb 21, 2022
a5acf9f
Redact errors returned in reply
ethanfrey Feb 23, 2022
d672287
Fix lint error, failing test
ethanfrey Feb 23, 2022
abc8088
Fix submessage tests
ethanfrey Feb 23, 2022
fe5cf17
Adjust error string
ethanfrey Mar 2, 2022
3308c2d
Handle nil logger again
ethanfrey Mar 2, 2022
1e77542
Revert "Handle nil logger again"
alpe Mar 2, 2022
e485eb5
Fix test setup and assertions
alpe Mar 2, 2022
6225729
Add no admin flag for gov
alpe Mar 2, 2022
809883d
Relaxed address strength restrictions for legacy 20 byte addresses
iramiller Mar 3, 2022
ee91fa3
Make utils methods public
pinosu Mar 3, 2022
62e2ba7
Mark a whole lot of tests to skip on m1 as they core dump
ethanfrey Mar 7, 2022
b5362ba
Redact query errors
ethanfrey Mar 7, 2022
7684efc
Add deny list for some grpc queries
ethanfrey Mar 7, 2022
e24b4c4
fix: build error
shiki-tak Jun 15, 2022
e395e2f
Make type conversion helpers public
alpe Mar 9, 2022
cd78988
cleanup from PR comments
ethanfrey Mar 9, 2022
3a7a96e
fix: rename path
shiki-tak Jun 15, 2022
324b727
Improve how we redact query errors
ethanfrey Mar 9, 2022
ce654a8
Skip a few more tests on m1
ethanfrey Mar 9, 2022
d21ed2a
Ensure SystemError is consistently unredacted
ethanfrey Mar 9, 2022
cebe17d
fix: close iterators
albertchon Mar 22, 2022
7ca8673
Use callback pattern for contract state iterator
alpe Mar 25, 2022
b689f00
Add more tests for event edge cases
alpe Apr 6, 2022
35e17c4
fix: build error
shiki-tak Jun 16, 2022
596bf38
Unpack contract details from genesis
alpe Apr 12, 2022
1672d37
Revisit gov params doc and tests
alpe Apr 13, 2022
9beb9db
Add missing sudo and execute to codec
the-frey Apr 17, 2022
e874cf6
Add a basic validation test
the-frey Apr 17, 2022
5d9946d
Disable stargate queries
webmaster128 Apr 14, 2022
aca49b5
Remove dead code to make linter happy
webmaster128 Apr 21, 2022
e4a9894
Add ExecuteContractProposal test
the-frey Apr 21, 2022
6be179a
Make MaxLabelSize a var not const
ethanfrey Apr 27, 2022
606ba24
Add and test JSON object matcher
webmaster128 Apr 27, 2022
64da1eb
fix: fix import
shiki-tak Jun 16, 2022
81823ed
Make IsJSONObjectWithTopLevelKey public
webmaster128 Apr 27, 2022
930c4c0
Add WasmSnapshotter
assafmo Apr 25, 2022
1e31d3c
Make snapshot from keeper
ethanfrey Apr 27, 2022
de4689a
Rough draft of the restore method using multistore
ethanfrey Apr 27, 2022
4e2e7c4
properly register the snapshot manager
ethanfrey Apr 27, 2022
a8ce0cc
Move snapshotter to keeper and implement
ethanfrey Apr 27, 2022
69cd2b3
Add compression to snapshot wasm bytecode
ethanfrey Apr 27, 2022
713a951
Put GzipIt and Uncompress logic in a common folder
ethanfrey Apr 27, 2022
0f3fb97
Fix linting errors
ethanfrey Apr 27, 2022
6c33a30
Avoid sending duplicate wasm codes over the wire
ethanfrey Apr 27, 2022
1689a19
Properly handle when a message not for this extension arrives
ethanfrey Apr 27, 2022
34df544
Start testing snapshots
ethanfrey Apr 27, 2022
a3c98e1
Basic tend to end test for no errors
ethanfrey Apr 27, 2022
516d24d
Address @giansalex PR comments
ethanfrey Apr 27, 2022
e0ea888
Updates inspired by @giansalex branch
ethanfrey Apr 28, 2022
6cc82c5
Cannot commit in my test cases to load from proper height
ethanfrey Apr 28, 2022
8432d2b
SRemove loading history until I can fix tests here
ethanfrey Apr 28, 2022
100e4b6
Cleanup from Simon's comments
ethanfrey Apr 28, 2022
a974edd
Consolidate MaxWasmSize constraints into a single var
alpe Apr 29, 2022
febb194
fix: allow no admin in instantiation through proposal
jhernandezb May 2, 2022
5eb0a99
Add instantiate-nobody flag to cli store cmd (#827)
jhernandezb May 3, 2022
9359d65
Add MsgStoreCode and MsgInstantiateContract support to simulations
pinosu May 3, 2022
1a93cf4
Add snapshotter integration tests and minor cleanup
alpe May 3, 2022
de133ca
Minor test update
alpe May 3, 2022
01030e6
Fix linter warnings
alpe May 3, 2022
e4ed0e6
Delete duplicate testdata from simulation
pinosu May 3, 2022
0abdd6a
fix: build error
shiki-tak Jun 17, 2022
fef78a9
Fix contract path in simulations
alpe May 4, 2022
364346e
Add instantiate permission to CodeInfoResponse
jhernandezb May 5, 2022
d2c0bf8
chore: comment out snapshotter
shiki-tak Jun 17, 2022
f9573e6
Minor godoc update
alpe May 6, 2022
bd104e1
Bump wasmvm to v1.0.0-rc.0
alpe May 6, 2022
f2fc24a
Add libwasm-version query command
jhernandezb May 9, 2022
44e8e5d
add UpdateInstantiateConfig gov proposal
jhernandezb Apr 1, 2022
e8a1a61
update UpdateInstantiateConfigProposal proto definition
jhernandezb May 4, 2022
9456862
add to EnableAllProposals
jhernandezb May 5, 2022
a85ff59
add tests
jhernandezb May 5, 2022
feea968
fix: fix test error
shiki-tak Jun 17, 2022
2894e75
Add handlers
jhernandezb May 5, 2022
83cdcc3
add code-info query command
jhernandezb May 6, 2022
4e8029e
fix missing gov registration type
jhernandezb May 6, 2022
8e0ef5c
address code review comments
jhernandezb May 6, 2022
b360591
fix error message
jhernandezb May 6, 2022
f7f39aa
update proto field name
jhernandezb May 9, 2022
e003aae
Add compare logic for stricter AccessConfig
ethanfrey May 9, 2022
3e4ba9b
Enforce permission less permissive than default
ethanfrey May 9, 2022
cb271f2
Add a few more tests as requested in review
ethanfrey May 10, 2022
f4bb19c
Use LibwasmvmVersion from wasmvm root
webmaster128 May 16, 2022
78dcab0
Adapt codebase to new IBC3ChannelOpenResponse return value
webmaster128 May 16, 2022
bae4439
fix: test error
shiki-tak Jun 17, 2022
8544575
Use wasmvm import consistently
webmaster128 May 16, 2022
85751fa
Prepare release notes for 0.27
ethanfrey May 17, 2022
77cc9aa
Create query stack size limit
webmaster128 May 19, 2022
73ea0c2
fix: fix test error
shiki-tak Jun 21, 2022
f4f534a
fix: lint error
shiki-tak Jun 21, 2022
8fe027e
chore: update wasmvm version
shiki-tak Jun 21, 2022
a5775f3
Merge branch 'main' of github.com:line/lbm-sdk into issues/555
shiki-tak Jun 21, 2022
f38b645
chore: coverage up
shiki-tak Jun 27, 2022
cce1ef5
fix: change ContractAddrLen
shiki-tak Jul 7, 2022
c1d3995
fix: fix protobuf path
shiki-tak Jul 7, 2022
18ae5e2
fix: apply review
shiki-tak Jul 7, 2022
d704996
fix: fix typo & missing commit
shiki-tak Jul 7, 2022
7955f0b
chore: adjust gas
shiki-tak Jul 7, 2022
dba039e
chore: update go.mod
shiki-tak Jul 8, 2022
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
4 changes: 2 additions & 2 deletions x/wasm/keeper/proposal_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func TestMigrateProposal(t *testing.T) {
}

func TestExecuteProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change included in this commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because our CreateTestInput has four arguments, unlike the fork source.

ctx, keepers := CreateTestInput(t, false, "staking", nil, nil)
govKeeper, bankKeeper := keepers.GovKeeper, keepers.BankKeeper

exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers)
Expand Down Expand Up @@ -276,7 +276,7 @@ func TestExecuteProposal(t *testing.T) {
}

func TestSudoProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
ctx, keepers := CreateTestInput(t, false, "staking", nil, nil)
govKeeper, bankKeeper := keepers.GovKeeper, keepers.BankKeeper

exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers)
Expand Down
14 changes: 8 additions & 6 deletions x/wasm/keeper/query_plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func BankQuerier(bankKeeper types.BankViewKeeper) func(ctx sdk.Context, request
}
coins := bankKeeper.GetAllBalances(ctx, sdk.AccAddress(request.AllBalances.Address))
res := wasmvmtypes.AllBalancesResponse{
Amount: convertSdkCoinsToWasmCoins(coins),
Amount: ConvertSdkCoinsToWasmCoins(coins),
}
return json.Marshal(res)
}
Expand Down Expand Up @@ -409,7 +409,7 @@ func sdkToDelegations(ctx sdk.Context, keeper types.StakingKeeper, delegations [
result[i] = wasmvmtypes.Delegation{
Delegator: sdk.AccAddress(d.DelegatorAddress).String(),
Validator: sdk.ValAddress(d.ValidatorAddress).String(),
Amount: convertSdkCoinToWasmCoin(amount),
Amount: ConvertSdkCoinToWasmCoin(amount),
}
}
return result, nil
Expand All @@ -431,7 +431,7 @@ func sdkToFullDelegation(ctx sdk.Context, keeper types.StakingKeeper, distKeeper
bondDenom := keeper.BondDenom(ctx)
amount := sdk.NewCoin(bondDenom, val.TokensFromShares(delegation.Shares).TruncateInt())

delegationCoins := convertSdkCoinToWasmCoin(amount)
delegationCoins := ConvertSdkCoinToWasmCoin(amount)

// FIXME: this is very rough but better than nothing...
// https://github.com/line/lbm-sdk/issues/225
Expand Down Expand Up @@ -529,15 +529,17 @@ func WasmQuerier(k wasmQueryKeeper) func(ctx sdk.Context, request *wasmvmtypes.W
}
}

func convertSdkCoinsToWasmCoins(coins []sdk.Coin) wasmvmtypes.Coins {
// ConvertSdkCoinsToWasmCoins covert sdk type to wasmvm coins type
func ConvertSdkCoinsToWasmCoins(coins []sdk.Coin) wasmvmtypes.Coins {
converted := make(wasmvmtypes.Coins, len(coins))
for i, c := range coins {
converted[i] = convertSdkCoinToWasmCoin(c)
converted[i] = ConvertSdkCoinToWasmCoin(c)
}
return converted
}

func convertSdkCoinToWasmCoin(coin sdk.Coin) wasmvmtypes.Coin {
// ConvertSdkCoinToWasmCoin covert sdk type to wasmvm coin type
func ConvertSdkCoinToWasmCoin(coin sdk.Coin) wasmvmtypes.Coin {
return wasmvmtypes.Coin{
Denom: coin.Denom,
Amount: coin.Amount.String(),
Expand Down
21 changes: 11 additions & 10 deletions x/wasm/keeper/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,16 @@ var TestingStakeParams = stakingtypes.Params{
}

type TestFaucet struct {
t testing.TB
bankKeeper bankkeeper.Keeper
sender sdk.AccAddress
balance sdk.Coins
t testing.TB
bankKeeper bankkeeper.Keeper
sender sdk.AccAddress
balance sdk.Coins
minterModuleName string
}

func NewTestFaucet(t testing.TB, ctx sdk.Context, bankKeeper bankkeeper.Keeper, initialAmount ...sdk.Coin) *TestFaucet {
func NewTestFaucet(t testing.TB, ctx sdk.Context, bankKeeper bankkeeper.Keeper, minterModuleName string, initialAmount ...sdk.Coin) *TestFaucet {
require.NotEmpty(t, initialAmount)
r := &TestFaucet{t: t, bankKeeper: bankKeeper}
r := &TestFaucet{t: t, bankKeeper: bankKeeper, minterModuleName: minterModuleName}
_, _, addr := keyPubAddr()
r.sender = addr
r.Mint(ctx, addr, initialAmount...)
Expand All @@ -143,9 +144,9 @@ func NewTestFaucet(t testing.TB, ctx sdk.Context, bankKeeper bankkeeper.Keeper,
func (f *TestFaucet) Mint(parentCtx sdk.Context, addr sdk.AccAddress, amounts ...sdk.Coin) {
require.NotEmpty(f.t, amounts)
ctx := parentCtx.WithEventManager(sdk.NewEventManager()) // discard all faucet related events
err := f.bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts)
err := f.bankKeeper.MintCoins(ctx, f.minterModuleName, amounts)
require.NoError(f.t, err)
err = f.bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, amounts)
err = f.bankKeeper.SendCoinsFromModuleToAccount(ctx, f.minterModuleName, addr, amounts)
require.NoError(f.t, err)
f.balance = f.balance.Add(amounts...)
}
Expand Down Expand Up @@ -328,7 +329,7 @@ func createTestInput(
nil,
)

faucet := NewTestFaucet(t, ctx, bankKeeper, sdk.NewCoin("stake", sdk.NewInt(100_000_000_000)))
faucet := NewTestFaucet(t, ctx, bankKeeper, minttypes.ModuleName, sdk.NewCoin("stake", sdk.NewInt(100_000_000_000)))

// set some funds ot pay out validatores, based on code from:
// https://github.com/line/lbm-sdk/blob/95b22d3a685f7eb531198e0023ef06873835e632/x/distribution/keeper/keeper_test.go#L49-L56
Expand Down Expand Up @@ -702,7 +703,7 @@ func fundAccounts(t testing.TB, ctx sdk.Context, am authkeeper.AccountKeeper, ba
for _, coin := range coins {
require.NoError(t, bank.SetBalance(ctx, addr, coin))
}
NewTestFaucet(t, ctx, bank, coins...).Fund(ctx, addr, coins...)
NewTestFaucet(t, ctx, bank, minttypes.ModuleName, coins...).Fund(ctx, addr, coins...)
}

var keyCounter uint64
Expand Down