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

v4: Globalfee #142

Closed
wants to merge 118 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
df6e5f4
Merge remote-tracking branch 'origin/release/v1.0.x' into release/v2.0.x
faddat Mar 18, 2023
7118b71
add test suite
hoangdv2429 Mar 30, 2023
e6e0dbb
modify to use ConfirmUpgradeSucceededs
hoangdv2429 Mar 30, 2023
b75cd32
modify dummy upgarde to ConfirmUpgradeSucceededs
hoangdv2429 Mar 30, 2023
411aac1
remove unused import
hoangdv2429 Mar 30, 2023
380f275
lint
hoangdv2429 Mar 30, 2023
dca5631
fix error cmd and app
phamminh0811 Apr 1, 2023
d029115
change sdk version to 0.47.0 to avoid conflict
phamminh0811 Apr 1, 2023
4b829c0
add store key to sim test
phamminh0811 Apr 1, 2023
10e62e7
fix lint
phamminh0811 Apr 1, 2023
7239724
remove redundant module in gomod
phamminh0811 Apr 1, 2023
ead1cad
use sdk v0.47.0
phamminh0811 Apr 1, 2023
200c659
remove redundant by GenesisStateWithValSet function
phamminh0811 Apr 3, 2023
ac640a8
skip sim test
phamminh0811 Apr 3, 2023
a956435
Add make sim test on makefile
phamminh0811 Apr 3, 2023
a1b620d
use custom DefaultConsensusParams
phamminh0811 Apr 3, 2023
f119688
remove redundant initgenesis call
catShaark Apr 4, 2023
3572990
update: increase default min-gas-price
Sen-Com Apr 4, 2023
74004da
Merge branch 'release/v2.0.x' of https://github.com/White-Whale-Defi-…
faddat Apr 7, 2023
1f80a33
Merge pull request #133 from notional-labs/minh/sdk-47
faddat Apr 7, 2023
87f2db8
Merge pull request #134 from notional-labs/removeRedundant
faddat Apr 7, 2023
3b7001f
build(deps): bump github.com/spf13/cobra from 1.6.1 to 1.7.0
dependabot[bot] Apr 7, 2023
283be8c
build(deps): bump github.com/cosmos/cosmos-sdk from 0.46.11 to 0.47.1
dependabot[bot] Apr 7, 2023
7ff2ba8
Merge pull request #127 from White-Whale-Defi-Platform/dependabot/go_…
faddat Apr 7, 2023
be01d28
Merge pull request #136 from White-Whale-Defi-Platform/dependabot/go_…
faddat Apr 7, 2023
a3d9f4b
Merge pull request #131 from White-Whale-Defi-Platform/ducnt/upgrade_…
faddat Apr 7, 2023
9025e1f
use main branch of alliance instead of fork
faddat Apr 7, 2023
21e7db7
use a patched alliance module
faddat Apr 7, 2023
4f30cf2
Merge pull request #137 from White-Whale-Defi-Platform/use-main-alliance
faddat Apr 8, 2023
bf9d14e
use the main branch of the packet-forward-middleware repo, so we don't
faddat Apr 11, 2023
b83de39
tidy
faddat Apr 11, 2023
0f7bdf7
add async-icq, ref: https://raw.githubusercontent.com/strangelove-ven…
faddat Apr 11, 2023
18f5bd5
use `osmosis` proto domain for token factory
faddat Apr 11, 2023
85f2ca7
add stargate queries
faddat Apr 11, 2023
7f58e80
add more notes
faddat Apr 11, 2023
a1b7827
add the globalfee module
faddat Apr 11, 2023
3c2e6a3
fix app params
faddat Apr 11, 2023
1388d67
don't use old style gov params
faddat Apr 11, 2023
83b406c
update how we call the app for tests
faddat Apr 11, 2023
9c5be7b
use cosmos/gogoproto
faddat Apr 11, 2023
05f3192
not pretty
faddat Apr 11, 2023
cdf2922
fix tests, except setting the minimum gas price parameter
faddat Apr 11, 2023
2eacaf6
clean up readme for the global fee module
faddat Apr 11, 2023
a0d91df
use thelper in golangci-lint
faddat Apr 11, 2023
d9b2b1e
add comment to NewTestSupport
faddat Apr 11, 2023
3a3a25d
Merge pull request #135 from White-Whale-Defi-Platform/update-increas…
faddat Apr 12, 2023
909a273
Fix Github action "Push Docker Images"
CharlesJUDITH Apr 15, 2023
0f09eec
build(deps): bump github.com/prometheus/client_golang
dependabot[bot] Apr 17, 2023
bb83030
Merge pull request #146 from White-Whale-Defi-Platform/dependabot/go_…
faddat Apr 18, 2023
62cf3c7
Merge branch 'release/v3.0.x' into globalfee
faddat Apr 18, 2023
e5604a5
Update CODEOWNERS
faddat Apr 18, 2023
c6537b1
Merge pull request #140 from White-Whale-Defi-Platform/async-icq
faddat Apr 18, 2023
748683a
Merge remote-tracking branch 'origin/release/v3.0.x' into remove-pfm-…
faddat Apr 18, 2023
9584edd
Merge pull request #139 from White-Whale-Defi-Platform/remove-pfm-rep…
faddat Apr 18, 2023
534f3a6
Merge pull request #143 from White-Whale-Defi-Platform/use-thelper
faddat Apr 18, 2023
21a27bd
Merge remote-tracking branch 'origin/release/v3.0.x' into globalfee
faddat Apr 18, 2023
eb27699
Merge remote-tracking branch 'origin/release/v3.0.x' into globalfee
faddat Apr 18, 2023
30b9b72
test helpers
faddat Apr 18, 2023
2438487
Merge remote-tracking branch 'origin/release/v3.0.x' into use-osmo-pr…
faddat Apr 18, 2023
844662e
govv1beta1
faddat Apr 18, 2023
44215d4
use govv1
faddat Apr 18, 2023
6d7f9a1
tidy
pysel Apr 19, 2023
e88670b
Merge pull request #145 from CharlesJUDITH/fix-docker-push-action
faddat Apr 19, 2023
6ff7ea5
Merge pull request #148 from White-Whale-Defi-Platform/codeowners
faddat Apr 25, 2023
be6aded
build(deps): bump github.com/terra-money/alliance
dependabot[bot] May 5, 2023
14842d4
Merge pull request #155 from White-Whale-Defi-Platform/dependabot/go_…
faddat May 6, 2023
524581e
build(deps): bump github.com/cosmos/cosmos-sdk from 0.47.1 to 0.47.2
dependabot[bot] May 6, 2023
c8e4003
Merge pull request #152 from White-Whale-Defi-Platform/dependabot/go_…
faddat May 6, 2023
0c6ae9d
build(deps): bump github.com/prometheus/client_golang
dependabot[bot] May 6, 2023
2841460
Update README.md - fix docs link
faddat May 6, 2023
7b3bd30
ensure that v3 is unaffected by cherry
faddat May 10, 2023
58d8d13
Merge pull request #157 from White-Whale-Defi-Platform/fix-v3-cherry
faddat May 10, 2023
694c6b4
use latest wasmd
faddat May 10, 2023
1d7c7f6
Merge pull request #158 from White-Whale-Defi-Platform/v3.0.x-refresh
faddat May 10, 2023
71557e7
Merge remote-tracking branch 'origin/release/v3.0.x' into use-osmo-pr…
faddat May 10, 2023
ea3565d
Merge branch 'v3.0.x-refresh' into use-osmo-proto-domain
faddat May 10, 2023
b60bf4c
fix conflict in app.go
faddat May 10, 2023
debdecc
Merge pull request #141 from White-Whale-Defi-Platform/use-osmo-proto…
faddat May 10, 2023
5a6889f
Merge pull request #154 from White-Whale-Defi-Platform/dependabot/go_…
faddat May 10, 2023
a5e4bd0
Merge pull request #156 from White-Whale-Defi-Platform/faddat-patch-1
faddat May 10, 2023
20d343b
Merge remote-tracking branch 'origin/release/v3.0.x' into globalfee
faddat May 10, 2023
768841b
Merge remote-tracking branch 'origin/release/v3.0.x' into globalfee
faddat May 10, 2023
fb9180e
build(deps): bump github.com/docker/distribution
dependabot[bot] May 11, 2023
fafc28d
build(deps): bump github.com/spf13/cast from 1.5.0 to 1.5.1
dependabot[bot] May 15, 2023
30cb80c
build(deps): bump cosmossdk.io/math from 1.0.0 to 1.0.1
dependabot[bot] May 16, 2023
c993170
build(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3
dependabot[bot] May 19, 2023
b4babf1
Merge pull request #159 from White-Whale-Defi-Platform/dependabot/go_…
faddat May 20, 2023
01042ce
Merge pull request #162 from White-Whale-Defi-Platform/dependabot/go_…
faddat May 20, 2023
acc7791
Merge pull request #160 from White-Whale-Defi-Platform/dependabot/go_…
faddat May 20, 2023
f2a9932
Merge pull request #161 from White-Whale-Defi-Platform/dependabot/go_…
faddat May 20, 2023
08f8676
Delete codacy.yml
faddat May 22, 2023
a5471f6
build(deps): bump github.com/terra-money/alliance
dependabot[bot] May 23, 2023
640a1be
Merge pull request #165 from White-Whale-Defi-Platform/faddat/remove-…
vuong177 May 23, 2023
bd684f8
Merge pull request #166 from White-Whale-Defi-Platform/dependabot/go_…
faddat May 24, 2023
904a051
Merge branch 'release/v3.0.x' into globalfee
faddat May 24, 2023
b6b06f0
mod tidy
hoangdv2429 May 25, 2023
0a9cfb7
add globalfee to ante handler
sontrinh16 May 25, 2023
bd452a4
lint
hoangdv2429 May 25, 2023
6fa37ca
Merge pull request #168 from notional-labs/son/globalfee
hoangdv2429 May 25, 2023
a8ba5ec
build(deps): bump github.com/cosmos/ibc-go/v7 from 7.0.0 to 7.0.1
dependabot[bot] May 26, 2023
2cb2c26
Merge pull request #171 from White-Whale-Defi-Platform/dependabot/go_…
faddat May 26, 2023
8ff5722
bring in the .proto builder from Juno
faddat May 27, 2023
475327d
use final release of wasmd v0.40.0
faddat May 27, 2023
2a6c7fe
cleanup go.mod replaces
faddat May 27, 2023
10a03dc
Merge pull request #173 from White-Whale-Defi-Platform/faddat/wasm-tf-40
faddat May 29, 2023
1520c61
build(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4
dependabot[bot] May 30, 2023
bfccf25
Merge pull request #174 from White-Whale-Defi-Platform/dependabot/go_…
faddat May 30, 2023
d5f36cf
build(deps): bump github.com/spf13/viper from 1.15.0 to 1.16.0
dependabot[bot] May 31, 2023
ee93eab
Merge pull request #175 from White-Whale-Defi-Platform/dependabot/go_…
pysel May 31, 2023
84c5992
add pfm to transfer stack
sontrinh16 Jun 5, 2023
ef6156e
fix collect-gentx
anhductn2001 Jun 7, 2023
0a7fca8
remove depguard
faddat Jun 7, 2023
d93de3c
Merge pull request #178 from White-Whale-Defi-Platform/ducnt/fix-cg
vuong177 Jun 7, 2023
0fe9d8a
Merge pull request #177 from notional-labs/hot-fix
faddat Jun 9, 2023
ffcbfcd
save place
faddat Jun 9, 2023
5834d4f
remove intertx
faddat Jun 9, 2023
50ea9f6
Merge remote-tracking branch 'origin/release/v3.0.x' into globalfee
faddat Jun 9, 2023
5348f61
update proto build script
faddat Jun 9, 2023
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/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @Sen-Com is the repository administrator who ensures compliance with the White Whale Repository Guideline.
# The remaining code owners help maintain the repository.
* @PolkachuIntern @faddat @Sen-Com @kerber0x @0xFable
* @PolkachuIntern @faddat @Sen-Com @kerber0x @0xFable @vuong177 @pysel @hieuvubk
61 changes: 0 additions & 61 deletions .github/workflows/codacy.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/push-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/White-Whale-Defi-Platform/migaloo-chain:${{ env.MAJOR_VERSION }}
ghcr.io/White-Whale-Defi-Platform/migaloo-chain:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}
ghcr.io/White-Whale-Defi-Platform/migaloo-chain:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }}
ghcr.io/white-whale-defi-platform/migaloo-chain:${{ env.MAJOR_VERSION }}
ghcr.io/white-whale-defi-platform/migaloo-chain:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}
ghcr.io/white-whale-defi-platform/migaloo-chain:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }}
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ run:
linters:
disable-all: true
enable:
- depguard
- dogsled
- errcheck
- exportloopref
Expand All @@ -24,6 +23,7 @@ linters:
- staticcheck
- stylecheck
- typecheck
- thelper
- unconvert
- unparam
- unused
Expand Down
72 changes: 70 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')

APP_DIR = ./app
BINDIR ?= ~/go/bin
RUNSIM = $(BINDIR)/runsim

ifeq (,$(VERSION))
VERSION := $(shell git describe --tags)
# if VERSION is empty, then populate it with branch's name and raw commit hash
Expand All @@ -13,7 +17,7 @@ endif

LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
TM_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf
BUILDDIR ?= $(CURDIR)/build
Expand Down Expand Up @@ -64,7 +68,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=migaloo \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION)
-X github.com/cometbft/cometbft/version.TMCoreSemVer=$(TM_VERSION)

ifeq (cleveldb,$(findstring cleveldb,$(COSMOS_BUILD_OPTIONS)))
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
Expand Down Expand Up @@ -92,3 +96,67 @@ install: go.sum

build:
go build $(BUILD_FLAGS) -o bin/migalood ./cmd/migalood

runsim: $(RUNSIM)
$(RUNSIM):
@echo "Installing runsim..."
@go install github.com/cosmos/tools/cmd/[email protected]

test-sim-import-export: runsim
@echo "Running application import/export simulation. This may take several minutes..."
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(APP_DIR) 50 5 TestAppImportExport

test-sim-custom-genesis-multi-seed: runsim
@echo "Running multi-seed custom genesis simulation..."
@echo "By default, ${HOME}/.migalood/config/genesis.json will be used."
@$(BINDIR)/runsim -Genesis=${HOME}/.migalood/config/genesis.json -SimAppPkg=$(APP_DIR) 400 5 TestFullAppSimulation

test-sim-multi-seed-long: runsim
@echo "Running long multi-seed application simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(APP_DIR) 500 50 TestFullAppSimulation

test-sim-multi-seed-short: runsim
@echo "Running short multi-seed application simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(APP_DIR) 50 10 TestFullAppSimulation

test-sim-custom-genesis-fast:
@echo "Running custom genesis simulation..."
@echo "By default, ${HOME}/.migalood/config/genesis.json will be used."
@go test $(TEST_FLAGS) -mod=readonly $(SIMAPP) -run TestFullAppSimulation \
-Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h


###############################################################################
### Protobuf ###
###############################################################################
# THIS SECTION OF THE MAKEFILE IS FROM IBC-GO
# https://github.com/cosmos/ibc-go/blob/a18f96af99e4cec3b75ac9f9399534427679597f/Makefile#L315-L346

protoVer=0.11.6
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

proto-all: proto-format proto-lint proto-gen

proto-gen:
@echo "Generating Protobuf files"
@$(protoImage) sh ./scripts/protocgen.sh

proto-swagger-gen:
@echo "Generating Protobuf Swagger"
@$(protoImage) sh ./scripts/protoc-swagger-gen.sh

proto-format:
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

proto-lint:
@$(protoImage) buf lint --error-format=json

proto-check-breaking:
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main

proto-update-deps:
@echo "Updating Protobuf dependencies"
$(DOCKER) run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf mod update

.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Because of this, branching is like:

1. [Website](https://migaloo.zone)
2. [LitePaper]() - Coming Soon
3. [Docs]() - Coming Soon
3. [Docs]( https://docs.migaloo.zone/) - Coming Soon
4. [Roadmap](./docs/ROADMAP.md)
5. [Discord](https://discord.com/channels/908044702794801233/1069611972053712947)
6. [Twitter](https://twitter.com/WhiteWhaleDefi)
Expand Down
19 changes: 14 additions & 5 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,31 @@ import (
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/v6/modules/core/ante"
"github.com/cosmos/ibc-go/v6/modules/core/keeper"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
"github.com/cosmos/ibc-go/v7/modules/core/keeper"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"

migaloofeeante "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/x/globalfee/ante"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
// channel keeper.
type HandlerOptions struct {
ante.HandlerOptions

IBCKeeper *keeper.Keeper
WasmConfig *wasmTypes.WasmConfig
TXCounterStoreKey storetypes.StoreKey
IBCKeeper *keeper.Keeper
WasmConfig *wasmTypes.WasmConfig
TXCounterStoreKey storetypes.StoreKey
BypassMinFeeMsgTypes []string
GlobalFeeSubspace paramtypes.Subspace
StakingSubspace paramtypes.Subspace
}

var maxTotalBypassMinFeeMsgGasUsage uint64 = 1_000_000

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
Expand Down Expand Up @@ -54,6 +62,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
migaloofeeante.NewFeeDecorator(options.BypassMinFeeMsgTypes, options.GlobalFeeSubspace, options.StakingSubspace, maxTotalBypassMinFeeMsgGasUsage),
// SetPubKeyDecorator must be called before all signature verification decorators
ante.NewSetPubKeyDecorator(options.AccountKeeper),
ante.NewValidateSigCountDecorator(options.AccountKeeper),
Expand Down
Loading