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: FeeDecorator #323

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
cb67db4
add scripts for token migration (#300)
nghuyenthevinh2000 Jul 21, 2023
38f351e
feat(app): Import Fork of Osmosis (#252)
alchemist-ti Jun 27, 2023
d6a53cd
* remove old soft-forks
inon-man Jul 23, 2023
1a040c3
Merge branch 'main' into refactoring
inon-man Aug 8, 2023
31eb98c
Merge branch 'main' into refactoring
inon-man Aug 8, 2023
7b4111f
remove legacy rest
nghuyenthevinh2000 Aug 8, 2023
78deb1b
update ibc-go to v6 to match with cosmos-sdk v46
nghuyenthevinh2000 Aug 8, 2023
86dafb6
update ibc to v6
nghuyenthevinh2000 Aug 8, 2023
589241b
remove legacy migrations
inon-man Aug 10, 2023
95572ed
fix go module dependencies
inon-man Aug 11, 2023
4aac888
WIP
inon-man Aug 11, 2023
1c4407c
WIP
inon-man Aug 11, 2023
6f0df62
WIP
inon-man Aug 11, 2023
3c4b2dc
WIP
inon-man Aug 11, 2023
5707bd8
WIP
inon-man Aug 11, 2023
5c80f61
Merge branch 'refactoring' into cosmos-sdk-46
inon-man Aug 11, 2023
328edcb
fix syntax
nghuyenthevinh2000 Aug 12, 2023
9536aee
fix ibc fee
nghuyenthevinh2000 Aug 12, 2023
8ab7ca5
pass unit test
nghuyenthevinh2000 Aug 12, 2023
59a91f0
update core wasmd
nghuyenthevinh2000 Aug 13, 2023
1fe0b24
successful make build
inon-man Aug 14, 2023
8ebc911
fix lint
inon-man Aug 14, 2023
126b19c
refactor oracle
inon-man Aug 14, 2023
f9f0fc8
v5 upgrade handler
inon-man Aug 14, 2023
960fbec
add ibcfee and ibccontroller store keys to StoreUpgrades
inon-man Aug 14, 2023
565ad40
use tags
inon-man Aug 14, 2023
d4f8098
add missing ScopedIBCFeeKeeper
inon-man Aug 14, 2023
80b867b
dep: use same go dependencies
inon-man Aug 14, 2023
fbbbb63
refactor
inon-man Aug 14, 2023
6899580
fix: gov v1 legacy amino codec
inon-man Aug 15, 2023
0ed5eac
refactor: codecs
inon-man Aug 15, 2023
fc9ae08
feat: FeeDecorator
inon-man Aug 17, 2023
6962413
feat: set mempool version to v1
inon-man Aug 20, 2023
b28559f
feat: use mempool v1
inon-man Aug 20, 2023
85e24d1
refactor
inon-man Aug 20, 2023
59461f2
fix: ErrInsufficientFee message
inon-man Aug 20, 2023
7eb82cd
disallow small mempools
inon-man Aug 20, 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
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ issues:
- text: "ST1016:"
linters:
- stylecheck
- path: "migrations"
text: "SA1019:"
- text: "SA1019:"
linters:
- staticcheck
- text: "leading space"
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ Ref: https://keepachangelog.com/en/1.0.0/
## [Unreleased]

### State Machine Breaking

* (app) [#319](https://github.com/classic-terra/core/pull/319) Upgrade SDKs
* (treasury) [#272](https://github.com/classic-terra/core/pull/272) Split the burn tax to the distribution module

## Features
* (wasm) [#309](https://github.com/classic-terra/core/pull/309) Support WASM stargate queries
* (ante) [#301](https://github.com/classic-terra/core/pull/301) Tax Exemption for smart contracts

## [v2.1.2](https://github.com/classic-terra/core/releases/tag/v2.1.2)

### Features
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ RUN --mount=type=cache,target=/root/.cache/go-build \

# Cosmwasm - Download correct libwasmvm version and verify checksum
RUN set -eux &&\
WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) && \
WASMVM_DOWNLOADS="https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}"; \
WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 5) && \
WASMVM_DOWNLOADS="https://github.com/classic-terra/wasmvm/releases/download/${WASMVM_VERSION}"; \
wget ${WASMVM_DOWNLOADS}/checksums.txt -O /tmp/checksums.txt; \
if [ ${BUILDPLATFORM} = "linux/amd64" ]; then \
WASMVM_URL="${WASMVM_DOWNLOADS}/libwasmvm_muslc.x86_64.a"; \
Expand Down
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,21 @@ build-release-arm64: go.sum
install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/terrad

docs:
@./scripts/protoc-swagger-gen.sh
gen-swagger-docs:
bash scripts/protoc-swagger-gen.sh

@rm -f client/docs/statik/statik.go
@statik -src=client/docs/swagger-ui -dest=client/docs -f -m
update-swagger-docs: statik
$(BINDIR)/statik -src=client/docs/swagger-ui -dest=client/docs -f -m
@if [ -n "$(git status --porcelain)" ]; then \
echo "\033[91mSwagger docs are out of sync!!!\033[0m";\
echo "Swagger docs are out of sync!";\
exit 1;\
else \
echo "\033[92mSwagger docs are in sync\033[0m";\
echo "Swagger docs are in sync!";\
fi

.PHONY: build build-linux install docs
apply-swagger: gen-swagger-docs update-swagger-docs

.PHONY: build build-linux install update-swagger-docs apply-swagger

########################################
### Tools & dependencies
Expand Down
33 changes: 12 additions & 21 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/server/api"
Expand All @@ -33,7 +32,6 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
Expand All @@ -45,15 +43,13 @@ import (

// upgrades
"github.com/classic-terra/core/v2/app/upgrades"
forks "github.com/classic-terra/core/v2/app/upgrades/forks"
v2 "github.com/classic-terra/core/v2/app/upgrades/v2"
v3 "github.com/classic-terra/core/v2/app/upgrades/v3"
v4 "github.com/classic-terra/core/v2/app/upgrades/v4"
v5 "github.com/classic-terra/core/v2/app/upgrades/v5"

customante "github.com/classic-terra/core/v2/custom/auth/ante"
customauthrest "github.com/classic-terra/core/v2/custom/auth/client/rest"
customauthtx "github.com/classic-terra/core/v2/custom/auth/tx"
core "github.com/classic-terra/core/v2/types"

"github.com/CosmWasm/wasmd/x/wasm"

Expand All @@ -68,10 +64,10 @@ var (
DefaultNodeHome string

// Upgrades defines upgrades to be applied to the network
Upgrades = []upgrades.Upgrade{v2.Upgrade, v3.Upgrade, v4.Upgrade}
Upgrades = []upgrades.Upgrade{v2.Upgrade, v3.Upgrade, v4.Upgrade, v5.Upgrade}

// Forks defines forks to be applied to the network
Forks = []upgrades.Fork{forks.DisableSwapFork, forks.IbcEnableFork, forks.VersionMapEnableFork}
Forks = []upgrades.Fork{}
)

// Verify app interface at compile time
Expand All @@ -85,7 +81,7 @@ var (
// capabilities aren't needed for testing.
type TerraApp struct {
*baseapp.BaseApp
keepers.AppKeepers
*keepers.AppKeepers

legacyAmino *codec.LegacyAmino
appCodec codec.Codec
Expand Down Expand Up @@ -142,7 +138,6 @@ func NewTerraApp(
legacyAmino,
maccPerms,
allowedReceivingModAcc,
app.ModuleAccountAddrs(),
skipUpgradeHeights,
homePath,
invCheckPeriod,
Expand Down Expand Up @@ -259,9 +254,6 @@ func (app *TerraApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abc
if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
if ctx.ChainID() == core.ColumbusChainID {
panic("Must use v1.0.x for importing the columbus genesis (https://github.com/classic-terra/core/releases/)")
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
}
Expand Down Expand Up @@ -329,20 +321,14 @@ func (app *TerraApp) SimulationManager() *module.SimulationManager {
// API server.
func (app *TerraApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
clientCtx := apiSvr.ClientCtx
rpc.RegisterRoutes(clientCtx, apiSvr.Router)
// Register legacy tx routes.
authrest.RegisterTxRoutes(clientCtx, apiSvr.Router)
// Register legacy custom tx routes.
customauthrest.RegisterTxRoutes(clientCtx, apiSvr.Router)

// Register new tx routes from grpc-gateway.
authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
// Register custom tx routes from grpc-gateway.
customauthtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
// Register new tendermint queries routes from grpc-gateway.
tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// Register legacy and grpc-gateway routes for all modules.
ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router)
ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// register swagger API from root so that other applications can override easily
Expand All @@ -359,7 +345,12 @@ func (app *TerraApp) RegisterTxService(clientCtx client.Context) {

// RegisterTendermintService implements the Application.RegisterTendermintService method.
func (app *TerraApp) RegisterTendermintService(clientCtx client.Context) {
tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry)
tmservice.RegisterTendermintService(
clientCtx,
app.BaseApp.GRPCQueryRouter(),
app.interfaceRegistry,
app.Query,
)
}

// RegisterSwaggerAPI registers swagger route with API Server
Expand Down Expand Up @@ -407,7 +398,7 @@ func (app *TerraApp) setupUpgradeHandlers() {
app.mm,
app.configurator,
app.BaseApp,
&app.AppKeepers,
app.AppKeepers,
),
)
}
Expand Down
2 changes: 1 addition & 1 deletion app/forks.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
func BeginBlockForks(ctx sdk.Context, app *TerraApp) {
for _, fork := range Forks {
if ctx.BlockHeight() == fork.UpgradeHeight {
fork.BeginForkLogic(ctx, &app.AppKeepers, app.mm)
fork.BeginForkLogic(ctx, app.AppKeepers, app.mm)
return
}
}
Expand Down
Loading
Loading