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

Multiple fee denoms #99

Merged
merged 13 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
2 changes: 1 addition & 1 deletion .github/images/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN set -eux; apk add --no-cache ca-certificates build-base;

RUN apk add git

ARG WASMVM_VERSION="v1.3.0"
ARG WASMVM_VERSION="v1.5.0"
ARG WASMVM_LIB="libwasmvm_muslc.x86_64.a"
ARG WASMVM_BASE_URL="https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION"
ARG WASMVM_URL="$WASMVM_BASE_URL/$WASMVM_LIB"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
ERC_REGISTRY_ALIAS: "nolus"
ERC_REPOSITORY: "builder"
# make sure to update build-binary container tag as well
IMAGE_TAG: "1.0"
IMAGE_TAG: "1.1"
DOCKERFILE: ".github/images/builder.Dockerfile"

jobs:
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
runs-on: ubuntu-latest
container:
# image name needs to be hardcoded: https://github.com/orgs/community/discussions/26324
image: "public.ecr.aws/nolus/builder:1.0"
image: "public.ecr.aws/nolus/builder:1.1"

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,7 @@ proto-check-breaking:
proto-update-deps:
@echo "Updating Protobuf dependencies"
docker run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf mod update

mocks:
@echo "Regenerate mocks..."
@go generate ./...
11 changes: 6 additions & 5 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import (
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
"github.com/cosmos/ibc-go/v7/modules/core/keeper"

gaiaerrors "github.com/cosmos/gaia/v11/types/errors"

taxkeeper "github.com/Nolus-Protocol/nolus-core/x/tax/keeper"
taxtypes "github.com/Nolus-Protocol/nolus-core/x/tax/types"
)
Expand All @@ -27,19 +28,19 @@ type HandlerOptions struct {

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder")
return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "account keeper is required for ante builder")
}

if options.BankKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder")
return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "bank keeper is required for ante builder")
}

if options.WasmConfig == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "wasm config is required for ante builder")
}

if options.SignModeHandler == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "sign mode handler is required for ante builder")
}

sigGasConsumer := options.SigGasConsumer
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func New(
AccountKeeper: app.AccountKeeper,
SignModeHandler: encodingConfig.TxConfig.SignModeHandler(),
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
TxFeeChecker: nil, // when nil is provided NewDeductFeeDecorator uses default checkTxFeeWithValidatorMinGasPrices
TxFeeChecker: app.TaxKeeper.CustomTxFeeChecker, // when nil is provided NewDeductFeeDecorator uses default checkTxFeeWithValidatorMinGasPrices
},
BankKeeper: app.BankKeeper,
TaxKeeper: *app.TaxKeeper,
Expand Down
7 changes: 4 additions & 3 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
Expand Down Expand Up @@ -406,7 +407,7 @@
contractmanager.NewSudoLimitWrapper(appKeepers.ContractManagerKeeper, &appKeepers.WasmKeeper),
appKeepers.FeeRefunderKeeper,
appKeepers.BankKeeper,
NewFeeBurnerExpectedKeeper(),
func(ctx sdk.Context) string { return appKeepers.TaxKeeper.ContractAddress(ctx) },
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
appKeepers.InterchainTxsModule = interchaintxs.NewAppModule(appCodec, *appKeepers.InterchainTxsKeeper, appKeepers.AccountKeeper, appKeepers.BankKeeper)
Expand All @@ -429,9 +430,8 @@
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
appKeepers.StakingKeeper,
// appKeepers.DistrKeeper,
distrkeeper.NewQuerier(*appKeepers.DistrKeeper),
nil, // todo: ics 29 not enabled
appKeepers.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 feerefunder
appKeepers.IBCKeeper.ChannelKeeper,
&appKeepers.IBCKeeper.PortKeeper,
appKeepers.ScopedWasmKeeper,
Expand Down Expand Up @@ -484,6 +484,7 @@
appCodec,
appKeepers.keys[taxmoduletypes.StoreKey],
appKeepers.keys[taxmoduletypes.MemStoreKey],
appKeepers.WasmKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
appKeepers.TaxKeeper = &taxKeeper
Expand Down Expand Up @@ -548,7 +549,7 @@
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibcexported.ModuleName)
paramsKeeper.Subspace(wasm.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable())

Check failure on line 552 in app/keepers/keepers.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

SA1019: govv1.ParamKeyTable is deprecated: ParamKeyTable - Key declaration for parameters (staticcheck)
paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
paramsKeeper.Subspace(feetypes.ModuleName)
paramsKeeper.Subspace(interchaintxstypes.ModuleName)
Expand Down
20 changes: 0 additions & 20 deletions app/keepers/mock_keepers.go

This file was deleted.

2 changes: 2 additions & 0 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
ibc "github.com/cosmos/ibc-go/v7/modules/core"
ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"

"github.com/Nolus-Protocol/nolus-core/x/mint"
minttypes "github.com/Nolus-Protocol/nolus-core/x/mint/types"
Expand Down Expand Up @@ -119,6 +120,7 @@ var ModuleBasics = module.NewBasicManager(
contractmanager.AppModuleBasic{},
authzmodule.AppModuleBasic{},
consensus.AppModuleBasic{},
ibctm.AppModuleBasic{},
)

func appModules(
Expand Down
1 change: 0 additions & 1 deletion app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ func appParamsConfigurationSim(t *testing.T, config *simtypes.Config) {
if err != nil {
t.Fatal("Writing of simulation parameters failed")
}

}

func TestAppStateDeterminism(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func CreateTestApp(isCheckTx bool, tempDir string) (*App, sdk.Context) {

testapp := app
ctx := testapp.BaseApp.NewContext(isCheckTx, tmproto.Header{})
testapp.TaxKeeper.SetParams(ctx, taxtypes.DefaultParams())
testapp.MintKeeper.SetParams(ctx, minttypes.DefaultParams())
_ = testapp.TaxKeeper.SetParams(ctx, taxtypes.DefaultParams())
_ = testapp.MintKeeper.SetParams(ctx, minttypes.DefaultParams())

err := testapp.AccountKeeper.SetParams(ctx, authtypes.DefaultParams())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/nolusd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ func initAppConfig() (string, interface{}) {
// own app.toml to override, or use this default value.
//
// In simapp, we set the min gas prices to 0.
srvCfg.MinGasPrices = "0stake"
srvCfg.MinGasPrices = "0.0025unls"

customAppConfig := CustomAppConfig{
Config: *srvCfg,
Expand Down
69 changes: 37 additions & 32 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,43 @@ module github.com/Nolus-Protocol/nolus-core
go 1.21

require (
github.com/CosmWasm/wasmd v0.41.0
github.com/CosmWasm/wasmvm v1.3.0
github.com/CosmWasm/wasmd v0.45.0
github.com/CosmWasm/wasmvm v1.5.0
github.com/armon/go-metrics v0.4.1
github.com/cometbft/cometbft v0.37.2
github.com/cometbft/cometbft-db v0.8.0
github.com/cosmos/cosmos-sdk v0.47.5
github.com/cosmos/cosmos-sdk v0.47.6
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-go/v7 v7.2.0
github.com/cosmos/ibc-go/v7 v7.3.1
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/neutron-org/neutron v1.0.5-0.20231017094203-8e460a769ea0
github.com/neutron-org/neutron v1.0.5-0.20231125170253-5c4b844e3272
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.7.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
google.golang.org/grpc v1.58.2
google.golang.org/grpc v1.59.0
gopkg.in/yaml.v2 v2.4.0
)

require (
cosmossdk.io/api v0.3.1
cosmossdk.io/errors v1.0.0
cosmossdk.io/math v1.1.2
cosmossdk.io/math v1.2.0
cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d
github.com/cosmos/cosmos-proto v1.0.0-beta.2
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98
github.com/cosmos/gaia/v11 v11.0.0-00010101000000-000000000000
github.com/golang/mock v1.6.0
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17
gotest.tools/v3 v3.5.0
)

require (
cloud.google.com/go v0.110.4 // indirect
cloud.google.com/go/compute v1.21.0 // indirect
cloud.google.com/go v0.110.9 // indirect
cloud.google.com/go/compute v1.23.2 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.1 // indirect
cloud.google.com/go/iam v1.1.4 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/core v0.5.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
Expand All @@ -63,11 +66,10 @@ require (
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/admin-module v0.0.0-20220204080909-475a98e03f31 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/gaia/v11 v11.0.0-00010101000000-000000000000 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v0.20.0 // indirect
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.0-20230803181732-7c8f814d3b79 // indirect
github.com/cosmos/iavl v0.20.1 // indirect
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.1 // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/interchain-security/v3 v3.1.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect
Expand All @@ -92,18 +94,17 @@ require (
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang/glog v1.1.1 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
Expand Down Expand Up @@ -157,7 +158,7 @@ require (
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/skip-mev/block-sdk v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.16.0 // indirect
Expand All @@ -170,19 +171,20 @@ require (
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.12.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.126.0 // indirect
google.golang.org/api v0.128.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down Expand Up @@ -216,6 +218,9 @@ replace (
// For more info https://github.com/CosmWasm/wasmd/blob/d63bea442bedf5b3055f3821472c7e6cafc3d813/go.mod#L131
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

// TODO: REMOVE THIS, its used for testing
// github.com/neutron-org/neutron => /home/denislavivanov/go/github/neutron

// https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md#replaces
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
Loading
Loading