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/txfees #85

Merged
merged 113 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
971a425
add specs for txfees
GNaD13 Mar 4, 2025
04c87da
proposal
GNaD13 Mar 4, 2025
30abf74
nit
GNaD13 Mar 4, 2025
63d96d9
Merge pull request #78 from oraichain/txfees-module-design
GNaD13 Mar 6, 2025
325943a
app module interface
GNaD13 Mar 6, 2025
3cdef3e
gen proto
GNaD13 Mar 6, 2025
a9cdd1b
add params and genesis
GNaD13 Mar 6, 2025
0195c14
done module structure
GNaD13 Mar 7, 2025
7b9e970
Merge pull request #81 from oraichain/dang/module-interface
GNaD13 Mar 7, 2025
09eb9cd
add token list store function
GNaD13 Mar 7, 2025
0bf505f
done store
GNaD13 Mar 7, 2025
feba391
Merge pull request #82 from oraichain/dang/txfees-module-store
GNaD13 Mar 7, 2025
51b3dcd
add params
GNaD13 Mar 7, 2025
b5a421e
proposal add update params
GNaD13 Mar 7, 2025
e889460
add msg fee token
GNaD13 Mar 9, 2025
d13f3aa
add comment
GNaD13 Mar 9, 2025
e0f9330
nit
GNaD13 Mar 10, 2025
37c2e1b
Merge pull request #83 from oraichain/dang/add-proposal-add-fee-token
GNaD13 Mar 10, 2025
b6385ea
query contract spot price
GNaD13 Mar 10, 2025
68c3b96
nit
GNaD13 Mar 10, 2025
2d208ab
epoch
GNaD13 Mar 10, 2025
1b6860c
Merge pull request #84 from oraichain/dang/query-spot-price
GNaD13 Mar 10, 2025
5e37ea5
nit
GNaD13 Mar 10, 2025
9709634
deduct fees
GNaD13 Mar 10, 2025
bb0b5e3
add mempool ante
GNaD13 Mar 11, 2025
6d40930
Merge pull request #87 from oraichain/dang/ante-handlers
GNaD13 Mar 11, 2025
b424f86
genesis
GNaD13 Mar 11, 2025
b0c44ba
params and genesis
GNaD13 Mar 12, 2025
54e8002
nit
GNaD13 Mar 12, 2025
5316b5e
Merge pull request #89 from oraichain/params-and-genesis
GNaD13 Mar 12, 2025
0f1ad5d
Merge remote-tracking branch 'orai-ssh/release/v0.50.x' into feat/txfees
GNaD13 Mar 12, 2025
cdbb2d4
Merge remote-tracking branch 'orai-ssh/feat/txfees' into feat/txfees
GNaD13 Mar 12, 2025
8f40d0c
update dependency with new globalfee ante
GNaD13 Mar 12, 2025
929b5e2
Merge pull request #90 from oraichain/dependency
GNaD13 Mar 12, 2025
3c1c3e7
add txfees module
GNaD13 Mar 12, 2025
86b1049
nit
GNaD13 Mar 12, 2025
7e8ac24
Merge pull request #91 from oraichain/integrate-with-app.go
GNaD13 Mar 12, 2025
d1e4974
allowed token store test
GNaD13 Mar 12, 2025
49fdbd5
nit
GNaD13 Mar 12, 2025
6118bf1
add store test
GNaD13 Mar 12, 2025
7dfef18
ante
GNaD13 Mar 12, 2025
e08935f
Merge pull request #93 from oraichain/setup-integration-test
GNaD13 Mar 12, 2025
240fc49
Merge remote-tracking branch 'orai-ssh/release/v0.50.x' into feat/txfees
GNaD13 Mar 12, 2025
2b19f85
add test epoch
GNaD13 Mar 12, 2025
f113a05
Merge pull request #94 from oraichain/test-epoch
GNaD13 Mar 12, 2025
f9e5170
add test exchange rate
GNaD13 Mar 12, 2025
befae2c
nit
GNaD13 Mar 12, 2025
25e5ca6
nit
GNaD13 Mar 12, 2025
52a2fa5
nit
GNaD13 Mar 12, 2025
e165dc1
Merge pull request #95 from oraichain/test-epoch
GNaD13 Mar 12, 2025
a91481d
nit
GNaD13 Mar 12, 2025
c4b38bf
add txfees keeper to ante
GNaD13 Mar 12, 2025
c7ee021
Merge branch 'feat/txfees' into test-msg-server
GNaD13 Mar 12, 2025
c26f616
add log debug
GNaD13 Mar 12, 2025
f0a9460
nit
GNaD13 Mar 12, 2025
f9f7651
nit
GNaD13 Mar 12, 2025
6105afe
nit
GNaD13 Mar 12, 2025
c80c0ce
fix bug genesis
GNaD13 Mar 12, 2025
afbf24a
nit
GNaD13 Mar 12, 2025
5c1bc02
Merge pull request #96 from oraichain/test-msg-server
GNaD13 Mar 12, 2025
c90117d
add msg add fee token test
GNaD13 Mar 13, 2025
68b6302
Merge pull request #97 from oraichain/test-msg-server
GNaD13 Mar 13, 2025
cb8ede6
nit
GNaD13 Mar 13, 2025
1933c73
nit
GNaD13 Mar 13, 2025
f89ba4a
add script for deploy contract & update price query wasm new version
Drizzle210 Mar 13, 2025
2d7ca5e
add more test
GNaD13 Mar 13, 2025
4df628e
Merge pull request #99 from oraichain/test-msg-server
GNaD13 Mar 13, 2025
db98b95
merge script deploy price query contract
Drizzle210 Mar 13, 2025
d5ecd37
Merge pull request #98 from Drizzle210/feat/txfees
GNaD13 Mar 13, 2025
2a787de
feat: add query allowed tokens
ledanghuy1811 Mar 13, 2025
f93edbb
feat: add query for tokens config
ledanghuy1811 Mar 13, 2025
74fa891
feat: add query token config
ledanghuy1811 Mar 13, 2025
a24c5c4
feat: add query token exchange rate
ledanghuy1811 Mar 13, 2025
e43e568
Merge pull request #100 from oraichain/feat/implement-txfees-grpc-query
ledanghuy1811 Mar 13, 2025
8b042fa
fix
GNaD13 Mar 13, 2025
37af7ea
Merge pull request #101 from oraichain/fix-scripts-test
GNaD13 Mar 13, 2025
5289d24
Merge branch 'feat/txfees' into add-interchaintest
GNaD13 Mar 13, 2025
ceea8b9
Merge remote-tracking branch 'orai-ssh/feat/txfees' into add-intercha…
GNaD13 Mar 13, 2025
dcd8028
feat: add base for cli query
ledanghuy1811 Mar 13, 2025
ba42b40
feat: add params cli query
ledanghuy1811 Mar 13, 2025
caa54bf
feat: add query allowed tokens cli
ledanghuy1811 Mar 13, 2025
c216d70
feat: add query token exchange rate cli
ledanghuy1811 Mar 13, 2025
80da77c
feat: add query tokens config cli
ledanghuy1811 Mar 13, 2025
84db706
feat: add query token config cli
ledanghuy1811 Mar 13, 2025
cc79c28
set up test
GNaD13 Mar 13, 2025
688b572
Merge pull request #102 from oraichain/feat/txfees-cli-query
ledanghuy1811 Mar 14, 2025
9baa546
Merge remote-tracking branch 'orai-ssh/feat/txfees' into add-intercha…
GNaD13 Mar 14, 2025
93b6ee8
nit
GNaD13 Mar 14, 2025
95d30a3
nit
GNaD13 Mar 14, 2025
5bd2288
done interchain e2e test
GNaD13 Mar 14, 2025
a31a1e4
nit
GNaD13 Mar 14, 2025
c0e28e7
nit
GNaD13 Mar 14, 2025
4846525
add workflow
GNaD13 Mar 14, 2025
4da2d9d
Merge pull request #103 from oraichain/add-interchaintest
GNaD13 Mar 14, 2025
a20fdf4
add upgrade handlers
GNaD13 Mar 14, 2025
f6a2711
nit
GNaD13 Mar 14, 2025
e1e8d85
nit
GNaD13 Mar 14, 2025
7fbf8ad
Merge pull request #104 from oraichain/add-upgrade-handlers
GNaD13 Mar 14, 2025
16291c1
nit
GNaD13 Mar 14, 2025
2f16f41
nit
GNaD13 Mar 14, 2025
8c9a7b8
feat: add base script test
ledanghuy1811 Mar 14, 2025
4d8247d
feat: add script test for txfees
ledanghuy1811 Mar 15, 2025
afc3145
Merge pull request #106 from oraichain/feat/script-test-txfees
ledanghuy1811 Mar 17, 2025
d500c27
change to continue instead of panic when iterate epoch
GNaD13 Mar 17, 2025
b75542a
Merge remote-tracking branch 'orai-ssh/feat/txfees' into feat/txfees
GNaD13 Mar 17, 2025
df5942e
change design to query in ante
GNaD13 Mar 17, 2025
6bdae34
fix ict
GNaD13 Mar 17, 2025
1b8e3c7
Merge pull request #107 from oraichain/move-query-in-ante
GNaD13 Mar 17, 2025
bf2ad98
feat: update script test for txfees
ledanghuy1811 Mar 17, 2025
70ddf41
Merge pull request #108 from oraichain/feat/script-test-txfees
ledanghuy1811 Mar 17, 2025
e1e12bd
add test ante
GNaD13 Mar 17, 2025
c8f4c5a
nit
GNaD13 Mar 17, 2025
e75a8b4
Merge pull request #109 from oraichain/ante_test
GNaD13 Mar 17, 2025
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
15 changes: 15 additions & 0 deletions .github/workflows/interchaintest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,20 @@ jobs:
uses: actions/checkout@v4

- run: make ictest-tf-force-transfer-ibc
env:
BRANCH_CI: "latest"
ictest-txfees-add-fee-token:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.22.7'

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-txfees-add-fee-token
env:
BRANCH_CI: "latest"
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ ictest-tf-force-transfer-ibc:
# Executes wasm gas less tests via interchaintest
ictest-wasm-gasless:
cd tests/interchaintest && go test -race -v -run TestWasmGasLessContract .

# Executes txfees tests via interchaintest
ictest-txfees-add-fee-token:
cd tests/interchaintest && go test -race -v -run TestAddFeeToken .
###############################################################################
### Linting ###
###############################################################################
Expand Down
8 changes: 7 additions & 1 deletion app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"

txfeesante "github.com/CosmWasm/wasmd/x/txfees/ante"
txfeeskeeper "github.com/CosmWasm/wasmd/x/txfees/keeper"

"github.com/cosmos/cosmos-sdk/types/tx/signing"

storetypes "cosmossdk.io/store/types"
Expand Down Expand Up @@ -56,6 +59,7 @@ type HandlerOptions struct {
MaxTxGasWanted uint64
CircuitKeeper *circuitkeeper.Keeper
BankKeeper *bankkeeper.BaseKeeper
TxFeesKeeper txfeeskeeper.Keeper
DisabledAuthzMsgs []string
BypassMinFeeMsgTypes []string
}
Expand Down Expand Up @@ -187,7 +191,9 @@ func newCosmosAnteHandler(options HandlerOptions) sdk.AnteHandler {
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
// nil so that it only checks with the min gas price of the chain, not the custom fee checker. For cosmos messages, the default tx fee checker is enough
globalfeeante.NewFeeDecorator(options.BypassMinFeeMsgTypes, options.GlobalFeeKeeper, options.StakingKeeper, maxBypassMinFeeMsgGasUsage),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, nil),
// ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, nil),
txfeesante.NewMempoolFeeDecorator(options.BypassMinFeeMsgTypes, options.TxFeesKeeper),
txfeesante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeesKeeper),
// we use evmante.NewSetPubKeyDecorator so that for eth_secp256k1 accs, we can validate the signer using the evm-cosmos mapping logic
evmante.NewSetPubKeyDecorator(options.AccountKeeper, options.EvmKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(options.AccountKeeper),
Expand Down
21 changes: 20 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ import (
"github.com/spf13/cast"

"github.com/CosmWasm/wasmd/client/docs"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
Expand Down Expand Up @@ -178,6 +179,10 @@ import (
erc20keeper "github.com/evmos/ethermint/x/erc20/keeper"
erc20types "github.com/evmos/ethermint/x/erc20/types"

"github.com/CosmWasm/wasmd/x/txfees"
txfeeskeeper "github.com/CosmWasm/wasmd/x/txfees/keeper"
txfeestypes "github.com/CosmWasm/wasmd/x/txfees/types"

"github.com/CosmosContracts/juno/v18/x/globalfee"
globalfeekeeper "github.com/CosmosContracts/juno/v18/x/globalfee/keeper"
globalfeetypes "github.com/CosmosContracts/juno/v18/x/globalfee/types"
Expand Down Expand Up @@ -302,6 +307,7 @@ type WasmApp struct {
Erc20Keeper erc20keeper.Keeper
FeeMarketKeeper feemarketkeeper.Keeper
GlobalFeeKeeper globalfeekeeper.Keeper
TxFeesKeeper txfeeskeeper.Keeper

// Middleware wrapper
Ics20WasmHooks *ibchooks.WasmHooks
Expand Down Expand Up @@ -428,7 +434,7 @@ func NewWasmApp(
capabilitytypes.StoreKey, ibcexported.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey,
wasmtypes.StoreKey, icahosttypes.StoreKey,
icacontrollertypes.StoreKey, clocktypes.StoreKey, globalfeetypes.StoreKey, ibchookstypes.StoreKey, packetforwardtypes.StoreKey, tokenfactorytypes.StoreKey,
evmtypes.StoreKey, feemarkettypes.StoreKey, erc20types.StoreKey,
evmtypes.StoreKey, feemarkettypes.StoreKey, erc20types.StoreKey, txfeestypes.StoreKey,
)

tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey)
Expand Down Expand Up @@ -822,6 +828,13 @@ func NewWasmApp(
AuthorityAddr,
)

app.TxFeesKeeper = txfeeskeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[txfeestypes.StoreKey]),
&app.WasmKeeper,
AuthorityAddr,
)

app.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper(
keys[tokenfactorytypes.StoreKey],
app.GetSubspace(tokenfactorytypes.ModuleName),
Expand Down Expand Up @@ -924,6 +937,7 @@ func NewWasmApp(
evm.NewAppModule(app.EvmKeeper, app.AccountKeeper, evmSs),
feemarket.NewAppModule(app.FeeMarketKeeper, feeMarketSs),
erc20.NewAppModule(app.Erc20Keeper, app.AccountKeeper, app.GetSubspace(erc20types.ModuleName)),
txfees.NewAppModule(app.TxFeesKeeper),
)

// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
Expand All @@ -948,6 +962,7 @@ func NewWasmApp(
feemarkettypes.ModuleName: feemarket.AppModuleBasic{},
erc20types.ModuleName: erc20.AppModuleBasic{},
globalfee.ModuleName: globalfee.AppModuleBasic{},
txfeestypes.ModuleName: txfees.AppModuleBasic{},
})
app.BasicModuleManager.RegisterLegacyAminoCodec(legacyAmino)
app.BasicModuleManager.RegisterInterfaces(interfaceRegistry)
Expand Down Expand Up @@ -987,6 +1002,7 @@ func NewWasmApp(
feemarkettypes.ModuleName,
evmtypes.ModuleName,
erc20types.ModuleName,
txfeestypes.ModuleName,
)

app.ModuleManager.SetOrderEndBlockers(
Expand All @@ -1011,6 +1027,7 @@ func NewWasmApp(
feemarkettypes.ModuleName,
evmtypes.ModuleName,
erc20types.ModuleName,
txfeestypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
Expand Down Expand Up @@ -1047,6 +1064,7 @@ func NewWasmApp(
feemarkettypes.ModuleName,
evmtypes.ModuleName,
erc20types.ModuleName,
txfeestypes.ModuleName,
}
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
Expand Down Expand Up @@ -1179,6 +1197,7 @@ func (app *WasmApp) setAnteHandler(txConfig client.TxConfig, wasmConfig wasmtype
FeeMarketKeeper: app.FeeMarketKeeper,
WasmConfig: &wasmConfig,
WasmKeeper: &app.WasmKeeper,
TxFeesKeeper: app.TxFeesKeeper,
ContractKeeper: app.ContractKeeper,
TXCounterStoreService: runtime.NewKVStoreService(txCounterStoreKey),
CircuitKeeper: &app.CircuitKeeper,
Expand Down
4 changes: 3 additions & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ import (
v0506 "github.com/CosmWasm/wasmd/app/upgrades/v0506"
v0507 "github.com/CosmWasm/wasmd/app/upgrades/v0507"
v0508 "github.com/CosmWasm/wasmd/app/upgrades/v0508"
v0509 "github.com/CosmWasm/wasmd/app/upgrades/v0509"
v2 "github.com/CosmWasm/wasmd/x/wasm/migrations/v2"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)

// Upgrades list of chain upgrades
var Upgrades = []upgrades.Upgrade{v050.Upgrade, v0501.Upgrade, v0502.Upgrade, v0503.Upgrade, v0504.Upgrade, v0505.Upgrade, v0506.Upgrade, v0507.Upgrade, v0508.Upgrade}
var Upgrades = []upgrades.Upgrade{v050.Upgrade, v0501.Upgrade, v0502.Upgrade, v0503.Upgrade, v0504.Upgrade, v0505.Upgrade, v0506.Upgrade, v0507.Upgrade, v0508.Upgrade, v0509.Upgrade}

// RegisterUpgradeHandlers registers the chain upgrade handlers
func (app *WasmApp) RegisterUpgradeHandlers() {
Expand Down Expand Up @@ -70,6 +71,7 @@ func (app *WasmApp) RegisterUpgradeHandlers() {
IBCKeeper: app.IBCKeeper,
MintKeeper: &app.MintKeeper,
GovKeeper: &app.GovKeeper,
TxFeesKeeper: app.TxFeesKeeper,
ICAControllerKeeper: app.ICAControllerKeeper,
IBCFeeKeeper: app.IBCFeeKeeper,
Codec: app.appCodec,
Expand Down
2 changes: 2 additions & 0 deletions app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

storetypes "cosmossdk.io/store/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
txfeeskeeper "github.com/CosmWasm/wasmd/x/txfees/keeper"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper"
Expand All @@ -31,6 +32,7 @@ type AppKeepers struct {
ScopedIBCKeeper *capabilitykeeper.ScopedKeeper
GovKeeper *govkeeper.Keeper
ICAControllerKeeper icacontrollerkeeper.Keeper
TxFeesKeeper txfeeskeeper.Keeper
IBCFeeKeeper ibcfeekeeper.Keeper
IBCKeeper *ibckeeper.Keeper
MintKeeper *mintkeeper.Keeper
Expand Down
56 changes: 56 additions & 0 deletions app/upgrades/v0509/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package v0509

import (
"context"

storetypes "cosmossdk.io/store/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
txfeestypes "github.com/CosmWasm/wasmd/x/txfees/types"

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/CosmWasm/wasmd/app/upgrades"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/module"
)

const (
USDAI = "factory/orai1wuvhex9xqs3r539mvc6mtm7n20fcj3qr2m0y9khx6n5vtlngfzes3k0rq9/DYeTA4ZQhEwoJ5imjq1Q3zgwfTgkh4WmdfFHAq3jLrv3"
)

// UpgradeName defines the on-chain upgrade name
const UpgradeName = "v0.50.9"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: storetypes.StoreUpgrades{
Added: []string{txfeestypes.ModuleName},
Deleted: []string{},
},
}

func CreateUpgradeHandler(
mm upgrades.ModuleManager,
configurator module.Configurator,
ak *upgrades.AppKeepers,
keys map[string]*storetypes.KVStoreKey,
cdc codec.BinaryCodec,
) upgradetypes.UpgradeHandler {
return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)

// set params
ak.TxFeesKeeper.SetParams(sdkCtx, txfeestypes.DefaultParams())

// allow USDAI for fee
config := txfeestypes.FeeTokenConfiguration{
Denom: USDAI,
Status: txfeestypes.FeeTokenStatus_FROZEN,
}
ak.TxFeesKeeper.AddAllowedToken(sdkCtx, config.Denom)
ak.TxFeesKeeper.SetTokenConfiguration(sdkCtx, config)

return mm.RunMigrations(ctx, configurator, fromVM)
}
}
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ require (
github.com/lib/pq v1.10.9
github.com/ory/dockertest v3.3.5+incompatible
github.com/rs/cors v1.11.1
github.com/test-go/testify v1.1.4
github.com/twmb/franz-go v1.18.0
github.com/twmb/franz-go/pkg/kadm v1.14.0
golang.org/x/sync v0.10.0
Expand Down Expand Up @@ -281,7 +282,7 @@ replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

github.com/CosmosContracts/juno/v18/x/clock => github.com/oraichain/juno/x/clock v0.0.0-20240911045127-feca1b18c597
github.com/CosmosContracts/juno/v18/x/globalfee => github.com/oraichain/juno/x/globalfee v0.0.0-20240925043856-fe3d1d8b9ad3
github.com/CosmosContracts/juno/v18/x/globalfee => github.com/oraichain/juno/x/globalfee v0.0.0-20250312030216-ffe51b3d33e8

github.com/cometbft/cometbft => github.com/oraichain/cometbft v0.38.6-0.20250207043129-6ccdb4a201d3

Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,8 @@ github.com/oraichain/ibc-go-fork/v8 v8.4.1-0.20241202080239-8bdb6f914705 h1:++dP
github.com/oraichain/ibc-go-fork/v8 v8.4.1-0.20241202080239-8bdb6f914705/go.mod h1:zh6x1osR0hNvEcFrC/lhGD08sMfQmr9wHVvZ/mRWMCs=
github.com/oraichain/juno/x/clock v0.0.0-20240911045127-feca1b18c597 h1:vFCKH25Q+BVNWRImFym0rYzno6BW8+l9GplszOdZ9no=
github.com/oraichain/juno/x/clock v0.0.0-20240911045127-feca1b18c597/go.mod h1:JAaOF+0j23OoyEgd6uhE3cgNDpZcfVZx4/DBbnMjUsc=
github.com/oraichain/juno/x/globalfee v0.0.0-20240925043856-fe3d1d8b9ad3 h1:/Um//l2b6eGaAcVRwkzv2U7xTAqlYfiyaqG71bUyyac=
github.com/oraichain/juno/x/globalfee v0.0.0-20240925043856-fe3d1d8b9ad3/go.mod h1:T9g8covTFLipVYRou8cuvfjg+xtPmQINjxFjzRxEbo8=
github.com/oraichain/juno/x/globalfee v0.0.0-20250312030216-ffe51b3d33e8 h1:ccMFmwQIfCZmKCFtBIeF+9vzJgMY46HxPCB7jQc8i04=
github.com/oraichain/juno/x/globalfee v0.0.0-20250312030216-ffe51b3d33e8/go.mod h1:T9g8covTFLipVYRou8cuvfjg+xtPmQINjxFjzRxEbo8=
github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA=
github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs=
github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY=
Expand Down Expand Up @@ -1128,6 +1128,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E=
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE=
github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU=
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
Expand Down
68 changes: 68 additions & 0 deletions proto/cosmwasm/txfees/v1/epoch.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
syntax = "proto3";
package cosmwasm.txfees.v1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "cosmwasm/txfees/v1/params.proto";

option go_package = "github.com/CosmWasm/wasmd/x/txfees/types";

// EpochInfo defines information of a epoch
message EpochInfo {
// identifier is a unique reference to this particular timer.
string identifier = 1;
// start_time is the time at which the timer first ever ticks.
// If start_time is in the future, the epoch will not begin until the start
// time.
google.protobuf.Timestamp start_time = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"start_time\""
];
// duration is the time in between epoch ticks.
// In order for intended behavior to be met, duration should
// be greater than the chains expected block time.
// Duration must be non-zero.
google.protobuf.Duration duration = 3 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.jsontag) = "duration,omitempty",
(gogoproto.moretags) = "yaml:\"duration\""
];
// current_epoch is the current epoch number, or in other words,
// how many times has the timer 'ticked'.
// The first tick (current_epoch=1) is defined as
// the first block whose blocktime is greater than the EpochInfo start_time.
int64 current_epoch = 4;
// current_epoch_start_time describes the start time of the current timer
// interval. The interval is (current_epoch_start_time,
// current_epoch_start_time + duration] When the timer ticks, this is set to
// current_epoch_start_time = last_epoch_start_time + duration only one timer
// tick for a given identifier can occur per block.
//
// NOTE! The current_epoch_start_time may diverge significantly from the
// wall-clock time the epoch began at. Wall-clock time of epoch start may be
// >> current_epoch_start_time. Suppose current_epoch_start_time = 10,
// duration = 5. Suppose the chain goes offline at t=14, and comes back online
// at t=30, and produces blocks at every successive time. (t=31, 32, etc.)
// * The t=30 block will start the epoch for (10, 15]
// * The t=31 block will start the epoch for (15, 20]
// * The t=32 block will start the epoch for (20, 25]
// * The t=33 block will start the epoch for (25, 30]
// * The t=34 block will start the epoch for (30, 35]
// * The **t=36** block will start the epoch for (35, 40]
google.protobuf.Timestamp current_epoch_start_time = 5 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"current_epoch_start_time\""
];
// epoch_counting_started is a boolean, that indicates whether this
// epoch timer has began yet.
bool epoch_counting_started = 6;
reserved 7;
// current_epoch_start_height is the block height at which the current epoch
// started. (The block height at which the timer last ticked)
int64 current_epoch_start_height = 8;
}
19 changes: 19 additions & 0 deletions proto/cosmwasm/txfees/v1/fee_token.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";
package cosmwasm.txfees.v1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmwasm/txfees/v1/params.proto";

option go_package = "github.com/CosmWasm/wasmd/x/txfees/types";

enum FeeTokenStatus {
UPDATED = 0;
OUTDATED = 1;
FROZEN = 2;
}

message FeeTokenConfiguration {
string denom = 1;
FeeTokenStatus status = 2;
}
15 changes: 15 additions & 0 deletions proto/cosmwasm/txfees/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package cosmwasm.txfees.v1;

import "gogoproto/gogo.proto";
import "cosmwasm/txfees/v1/params.proto";
import "cosmwasm/txfees/v1/epoch.proto";

option go_package = "github.com/CosmWasm/wasmd/x/txfees/types";

// GenesisState defines the txfees module's genesis state.
message GenesisState {
// params defines the paramaters of the module.
Params params = 1 [ (gogoproto.nullable) = false ];
repeated EpochInfo epochs = 2 [ (gogoproto.nullable) = false ];
}
Loading
Loading