Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
address changes
Browse files Browse the repository at this point in the history
affanv14 committed Jul 10, 2024
1 parent 819b82d commit 3788090
Showing 7 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions protocol/Dockerfile
Original file line number Diff line number Diff line change
@@ -27,6 +27,8 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
COPY . .

# See https://github.com/CosmWasm/wasmvm/releases
# Download the wasmvm library for the target architecture (aarch64 or x86_64)
# x86_64 is needed for CI, local macs support aarch64
RUN if [ "$(uname -m)" = "aarch64" ]; then \
wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm_muslc.aarch64.a; \
elif [ "$(uname -m)" = "x86_64" ]; then \
4 changes: 3 additions & 1 deletion protocol/app/module_accounts.go
Original file line number Diff line number Diff line change
@@ -35,7 +35,9 @@ var (
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
icatypes.ModuleName: nil,
// TODO(cosmwasm feature branch)
// https://github.com/CosmWasm/wasmvm/blob/1c3fdc2a4402e527617ec72fe53f114b24899a01/types/msg.go#L116-L121
// required to burn given coins from the contract's account.
// Important if a contract controls significant token supply that must be retired.
wasmtypes.ModuleName: {authtypes.Burner},
// -------- dYdX custom module accounts --------
// bridge module account mints tokens for bridged funds.
4 changes: 1 addition & 3 deletions protocol/app/module_accounts_test.go
Original file line number Diff line number Diff line change
@@ -74,9 +74,7 @@ func TestMaccPerms(t *testing.T) {
"rewards_vester": nil,
"community_treasury": nil,
"community_vester": nil,
// required for burn msg in wasmvm
// https://github.com/CosmWasm/wasmvm/blob/1c3fdc2a4402e527617ec72fe53f114b24899a01/types/msg.go#L116-L121
"wasm": {"burner"},
"wasm": {"burner"},
}
require.Equal(t, expectedMaccPerms, maccPerms, "default macc perms list does not match expected")
}
1 change: 1 addition & 0 deletions protocol/app/msgs/normal_msgs.go
Original file line number Diff line number Diff line change
@@ -214,6 +214,7 @@ var (
"/ibc.applications.interchain_accounts.v1.InterchainAccount": nil,

// wasm
// TODO(OTE-461): Audit and remove unnecessary messages
"/cosmwasm.wasm.v1.AcceptedMessageKeysFilter": nil,
"/cosmwasm.wasm.v1.AcceptedMessagesFilter": nil,
"/cosmwasm.wasm.v1.AllowAllMessagesFilter": nil,
1 change: 1 addition & 0 deletions protocol/app/upgrades/v.cosmwasm.0/constants.go
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ const (
UpgradeName = "v6.cosmwasm.0"
)

// TODO(OTE-535): remove duplicated code from v6 upgrade
var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
StoreUpgrades: store.StoreUpgrades{
2 changes: 2 additions & 0 deletions protocol/app/upgrades/v.cosmwasm.0/upgrade.go
Original file line number Diff line number Diff line change
@@ -87,6 +87,7 @@ func InitializeModuleAccs(ctx sdk.Context, ak authkeeper.AccountKeeper) {
}
}

// TODO(OTE-535): remove duplicated code from v6 upgrade
func removeStatefulFOKOrders(ctx sdk.Context, k clobtypes.ClobKeeper) {
allStatefulOrders := k.GetAllStatefulOrders(ctx)
for _, order := range allStatefulOrders {
@@ -112,6 +113,7 @@ func removeStatefulFOKOrders(ctx sdk.Context, k clobtypes.ClobKeeper) {
}
}

// TODO(OTE-535): remove duplicated code from v6 upgrade
func initRevShareModuleState(
ctx sdk.Context,
revShareKeeper revsharetypes.RevShareKeeper,
2 changes: 0 additions & 2 deletions protocol/app/upgrades/v5.0.0/constants.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import (
store "cosmossdk.io/store/types"
"github.com/dydxprotocol/v4-chain/protocol/app/upgrades"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"
)

@@ -19,7 +18,6 @@ var Upgrade = upgrades.Upgrade{
StoreUpgrades: store.StoreUpgrades{
Added: []string{
vaulttypes.StoreKey,
wasmtypes.StoreKey,
},
},
}

0 comments on commit 3788090

Please sign in to comment.