Commit Graph

204 Commits

Author SHA1 Message Date
0xsatoshi
8d761147a2 fix 2024-08-03 15:05:14 +08:00
0xsatoshi
4917eb5976 fix 2024-08-03 15:05:14 +08:00
Solovyov1796
986172d3a7 rename denoms 2024-08-03 15:05:13 +08:00
Solovyov1796
4fabd4d011 fix unit test 2024-08-03 15:05:03 +08:00
Solovyov1796
c7ed82b4f4 remove das module 2024-08-03 15:04:55 +08:00
MiniFrenchBread
b53783447b feat: precompile 2024-08-03 15:04:55 +08:00
Solovyov1796
47cee39c64 fix unit test 2024-08-03 15:04:53 +08:00
0xsatoshi
3da66a87e6 fix 2024-08-03 15:04:48 +08:00
Solovyov1796
34a76200f0 fix unit test for x 2024-08-03 15:04:48 +08:00
Solovyov1796
89d3829646 add 0g code 2024-08-03 15:04:48 +08:00
Solovyov1796
ffad9dbdd5 rename kava 2024-08-03 15:04:46 +08:00
Solovyov1796
454733f55b remove useless modules 2024-08-03 15:04:32 +08:00
Solovyov1796
14e1e3a7d4 rename go mod path 2024-08-03 15:03:23 +08:00
Nick DeLuca
c9d900be2c
Set the CDP Block Interval to 100 during v0.26.x upgrade (#1865)
* set CDP block interval to 100 to only run interest synchronization
for risky cdps every 100 blocks instead of every block

* refactor and use constant for setting to improve clarity; update
block interval to 50 instead of 100.  This will decrease risk by
running around every 6 minutes instead of 12 mintues for current
mainnet block times.
2024-03-29 11:05:26 -07:00
Nick DeLuca
8f93ca2048
Use IAVL 0.20.x for v0.26.x release, update deps (#1862)
* revert back to iavl v1 to avoid hash changes on new modules like
we are seeing on the v0.24.x to v0.25.x upgrade block.  Also, add
replace statements for exp and rapid to match upstream cosmos-sdk

* fix sharding prune store logging and error return.

* add comment to clarify WithKeyTable usage
2024-03-28 14:38:07 -07:00
Draco
6b41ed84b8
Add packet forward store to upgrade (#1843) 2024-03-08 16:34:31 -05:00
Draco
17691e95a8
Merge branch 'master' into release/v0.26.x 2024-03-08 09:10:32 -05:00
Draco
5c0f27b952
Add ibc packet forward middleware for ibc transfer (#1839)
* Add ibc packet forward middleware for ibc transfer

* Update changelog for ibc packet forwarding
2024-03-07 16:47:46 -05:00
Levi Schoen
2bc0c62570
register solomachine module for v6 to v7 ibc-go migration (#1831) 2024-02-16 12:49:58 -05:00
Levi Schoen
58d04e2996 register solomachine module for v6 to v7 ibc-go migration (#1830) 2024-02-15 15:24:55 -08:00
Draco
ad387e6a42
Add upgrade handler for Kava v0.26.0 (#1827)
* Add upgrade handler for Kava v0.26.0

* Update tests e2e to run upgrade tests
2024-02-13 13:27:27 -05:00
Draco
614d4e40fe
Update cosmos-sdk to v0.47.7 (#1811)
* Update cometbft, cosmos, ethermint, and ibc-go

* Replace github.com/tendermint/tendermint by github.com/cometbft/cometbft

* Replace github.com/tendermint/tm-db by github.com/cometbft/cometbft-db

* Replace gogo/protobuf with cosmos/gogoproto & simapp replacement

* Replace cosmos-sdk/simapp/helpers with cosmos-sdk/testutil/sims

* Remove no longer used simulations

* Replace ibchost with ibcexported
See https://github.com/cosmos/ibc-go/blob/v7.2.2/docs/migrations/v6-to-v7.md#ibc-module-constants

* Add new consensus params keeper

* Add consensus keeper to blockers

* Fix keeper and module issues in app.go

* Add IsSendEnabledCoins and update SetParams interface changes

* Fix protobuf build for cosmos 47 (#1800)

* fix cp errors by using -f; fix lint by only linting our proto dir;
and use proofs.proto directly from ics23 for ibc-go v7

* run proto-all; commit updated third party deps and swagger changes

* regenerate proto files

* use correct gocosmos build plugin for buf

* re-gen all protobuf files to update paths for new gocosmos plugin

* update protoc and buf to latest versions

* fix staking keeper issues in app.go

* update tally handler for gov changes

* chain id fix and flag fixes

* update deps for cometbft 47.7 upgrade

* remove all module legacy queriers

* update stakingKeeper to pointer

* Replace ModuleCdc from govv1beta1 to govcodec

* remove simulations

* abci.LastCommitInfo → abci.CommitInfo

* Remove unused code in keys.go

* simapp.MakeTestEncodingConfig -> moduletestutil.MakeTestEncodingConfi

* Fix chain id issues in tests

* Fix remaining unit test issues

* Update changelog for upgrade

* Fix e2e tests using updated kvtool

* Update protonet to v47 compatible genesis

* Bump cometbft-db to v0.9.1-kava.1

* Update kvtool

* Remove extra changelog

* Fix merged rocksdb issues

* go mod cleanup

* Bump cometbft-db to v9 and go to 1.21

* Bump rocksdb version to v8.10.0

* Update kvtool to latest version

* Update gin to v1.9.0

* Use ibctm.ModuleName in app_test

* Fallback to genesis chain id instead of client toml

* Remove all simulations

* Fix cdp migrations issue with v47

* Update dependencies to correct tags

---------

Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
2024-02-06 17:54:10 -05:00
Draco
1d4ccf6657
formatting fixes (#1783) 2023-11-21 14:08:07 -05:00
drklee3
395b69ac2f
feat(community): add MsgUpdateParams for governance (#1745)
* Add authority, MsgUpdateParams

* Add e2e test for x/community UpdateParamsMsg proposal

* Ensure new params are different

* Add errors and update codec

* Update changelog

* Use single reused govAuthorityAddr

* Add unit tests for authority and msg

* Validate authority address

* Update proto comment

* Check for ErrInvalidSigner in invalid authority error
2023-10-11 10:22:25 -07:00
drklee3
ae4cb15d73
Emit events for inflation disable and staking rewards (#1743)
* Emit events for staking rewards

* Update test to check disable inflation check

* Only emit staking rewards event when non-zero value

* use existing transfer amount for event

* add assertion that no events are emitted for zero rewards; refactor
event assertions to be a little cleaner

---------

Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
2023-10-03 15:10:22 -07:00
Nick DeLuca
102cc0fff3
Community Pool Staking Rewards Implementation & Improvements (#1742)
* add new field upgrade_time_set_staking_rewards_per_second with intention
of integrating into the disable inflation logic to set an initial
staking reward time

* when the disable inflation upgrade time occurs, set the staking rewards
per second to the value specified by the new
upgrade_time_set_staking_rewards_per_second.  This will allow a decoupled
implementation between the ugprade switching logic, and the core
functionality of paying staking rewards from the pool

* add staking rewards state to community keeper and community module
genesis that is required to calculate and track staking reward payouts
accross blocks

* add implementation of staking reward payouts

* remove unused error

* touch up tests and add a test case that fully tests behavior when pool
is drained

* add function comments

* refactor and pull out main calculation to private pure function with
no dependence on keeper

* zero out default parameters -- these are too chain specific to have
useful defaults

* small touch ups on comments, test cases

* use correct Int from sdkmath, not old sdk types; update protonet genesis
for new parmater

* fix copy pasta comment

* use bond denom from staking keeper instead of referncing ukava directly

* add staking reward state for valid genesis

* update kvtool genesis for new params and rewards state
2023-10-03 08:41:54 -07:00
Draco
43be3815cc
feat: disable inflation upgrade logic (#1706)
* feat: disable inflation upgrade logic

* improve disable inflation comments

* add upgrade tests

* update changelog

* split disable inflation upgrade and the upgrade check

* remove pay rewards logic

* clean up incentives test

* add abci test

* refactor upgradeTime and blockTime check

* fix abci test

* fix wrong pr in changelog

* refactor disable inflation tests, behavior, and implementation
  - Unit tests are now shared between keeper and abci begin blocker
    since behavior is 100% the same
  - ABCI is unaware of keeper initial keeper logic branch (keeper
    methods required to be called in certain order by begin blocker)
  - Behavior of zero time is changed -- this now doesn't run for the
    zero time.  This is more ideal for new chains (genesis should set
    all correct state instead of relying on inflation disable logic),
    and allows for a simpler implementation.
  - Begin blocker now panics if parameters are not in state

* remove previous tests and implementation

* remove previous block time keeper state -- not needed for inflation
disalbing

* move inflation disabling to private method and add more comments

* remove unused key

* use correct spelling for idempotence

---------

Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
2023-10-02 13:10:22 -07:00
Ruaridh
bc260d8091
feat(community): add switchover param (#1704)
* add community params type

* add get/set params methods

* add community genesis state type

* add community init/export genesis

* add querier methods for params

* add query cli cmd

* update changelog

* update protonet genesis

* Add `RewardsPerSecond` param to `x/community` module (#1707)

* Add RewardsPerSecond param to community

* Update rewards per second param to int

* Add rewards_per_second to protonet genesis

* Use default rewards per second of 744191

* Include value if negative in Validate error

* Rename RewardsPerSecond param to StakingRewardsPerSecond

* Add changelog entry

* Add param migration, update consensus version to 2

* Update proto docs

* Update staking_rewards_per_second param name in protonet genesis (#1730)

* Update godoc

Co-authored-by: Robert Pirtle <Astropirtle@gmail.com>

* add genesis state tests

* document what 0 upgrade time means

* update kvtool to include new params

---------

Co-authored-by: drklee3 <derrick@dlee.dev>
Co-authored-by: Robert Pirtle <Astropirtle@gmail.com>
2023-09-22 09:05:12 -07:00
Robert Pirtle
9a0aed7626
feat(x/metrics): add module for emiting custom chain metrics (#1668)
* initialize x/metrics with metrics collection

* include global labels in x/metrics metrics

* add x/metrics spec

* add x/metrics test coverage

* update changelog
2023-08-25 12:23:53 -07:00
Robert Pirtle
15c243224c
fix(evmutil): create module account on InitGenesis (#1655)
* fix(evmutil): create module account on InitGenesis

ensures the creation of the x/evmutil module account on init genesis.

* update changelog

* cleanup debug logging
2023-07-24 16:00:19 -07:00
Robert Pirtle
49812b6e7c
fix(cli): Resolve problem with assert-invariants cmd (#1624)
* remove no-op migrate command

* move assert-invariants from migrate -> cmd

* fix: don't modify validators for assert-invariants

Makes validator addition in TestApp initialization optional.

* update changelog
2023-06-09 16:52:52 -07:00
Robert Pirtle
528be6350e
feat(evmutil): add CosmosCoinsFullyBackedInvariant (#1610)
* add IterateAllDeployedCosmosCoinContracts method

* refactor unpacking big int from erc20 query

* add QueryERC20TotalSupply method

* feat(evmutil): add CosmosCoinsFullyBackedInvariant

* update changelog
2023-06-05 11:39:53 -07:00
Ruaridh
1459170a37
fix(evmutil): register MsgConvertCosmosCoinToERC20 on amino (#1599)
* add amino registration test

* register evmutil types on app amino codec

* register new msg type in amino and proto,
also use new register method that checks length to catch ledger issues

* clarify variable naming
2023-05-26 19:06:26 -07:00
Robert Pirtle
ff709d73e1
feat(evmutil): add allow list for evm-convertible sdk denoms (#1590)
* add proto for allowed sdk denoms -> evm conversion

* add validation for AllowedNativeCoinERC20Token

* add validation for AllowedNativeCoinERC20Tokens

* add AllowedNativeDenoms into params & genesis

* add evmutil Params.Validate() test

* fix eip712 ante test

* update changelog

* update internal testnet genesis.json

* update state & param specs

updates to the sections describing functionality will be updated once
that functionality actually exists... :)

* update field decimal -> decimals

field now matches erc20 spec

* add validation decimals will cast to uint8

* add v2 store migration for evmutil

* create & register evmutil migrations

* adds migrator to evmutil's keeper
* sets up Migrate1To2 migration
* registers migration in module
* updates GetParams to properly handle historic block queries

* add unit test for GetParams with historic store
2023-05-19 16:01:46 -07:00
Nick DeLuca
31ba0badfc
update ethermint for latest kava version that fixes (#1588)
migration and legacy parameter handling
2023-05-04 10:27:04 -07:00
Robert Pirtle
c5f414e6a5
feat: add community cdp repay debt proposal (#1565)
* add CommunityPoolCDPRepayDebtProposal proto & type

* add cdpKeeper to x/community's keeper

* add handler for CommunityPoolCDPRepayDebtProposal

* more test cases

* rename CommunityPoolCDP -> CommunityCDP

the proposal does not interact with the vanilla community pool

* fix & test stringer

* update changelog
2023-04-20 14:13:16 -07:00
Robert Pirtle
8c1c29a03a
feat: add CommunityPoolLendWithdrawalPermission (#1562)
* feat: add CommunityPoolLendWithdrawalPermission

* update kvtool to master branch

* register with PubProposal legacy amino codec

* register missing legacy amino codec PubProposal
2023-04-18 12:31:43 -07:00
drklee3
56f697fba6
feat: overwrite x/distribution /community_pool endpoint to include x/community balance (#1563)
* Add query path rewrites

* Add test for new x/community endpoint

* Update doc for RegisterAPIRouteRewrites

* Add changelog entry

* Add changelog entry link
2023-04-17 12:54:13 -07:00
drklee3
23e054e402
feat: re-add validator-vesting legacy rest endpoints (#1542)
* Re-add validator-vesting legacy rest endpoints

* Add changelog entry

* Re-add /vesting swagger config
2023-04-06 15:51:34 -07:00
drklee3
82f5ed5c3c
feat: block new vesting create messages (#1539)
* Block new vesting create messages

* doc: Update VestingAccountDecorator doc comment
2023-04-06 13:21:56 -07:00
drklee3
3375484f79
Update deprecated Cosmos methods (#1530)
* Use cosmossdk.io/errors for deprecated error methods

* Update error registration with cosmossdk.io/errors

* Use cosmossdk.io/math for deprecated sdk.Int alias

* Fix modified proto file

* Update sdk.Int usage in swap hooks

* Update e2e test deprecated method usage
2023-04-05 16:21:59 -07:00
drklee3
f757d7ab15
feat: upgrade to Cosmos v0.46 (#1477)
* Update cosmos-sdk to v0.45.10-kava

* Add RegisterNodeService to app

* Update cosmos proto files

* Update cosmos proto files

* Use tagged v0.45.10-kava-v0.19-0.21 cosmos version

* update x/auth/legacy to x/auth/migrations

* Delete rest packages and registration

* Remove rest from proposal handlers

* Remove legacy types referencing removed sdk types

* Remove legacy tx broadcast handler

* Update incentive staking hooks to return error

* Remove grpc replace directive, use new grpc version

* Fix storetypes import

* Update tally_handler with updated gov types

* Delete legacy types

* Use new gov default config

* Update RegisterTendermintService params

Signed-off-by: drklee3 <derrick@dlee.dev>

* Replace sdk.StoreKey with storetypes.StoreKey

* Replace sdk.Int#ToDec with sdk.NewDecFromInt

* Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update most intances of govtypes to govv1beta1

* Unpack coin slice for Coins#Sub and Coins#SafeSub

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update committee gov codec registration

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update migrate utils period_vesting Coins#Sub

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update Coin#Sub in community proposal handler

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update community, earn, kavadist proposal gov registration

* Update evm cli client EthSecp256k1Type check

* AccAddressFromHex to AccAddressFromHexUnsafe

* Add mint DefaultInflationCalculationFn to earn test

* Update use of removed staking.NewHandler

* Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode

* cmd: Update new snapshot app option

Signed-off-by: drklee3 <derrick@dlee.dev>

* cmd: Add tendermint default config, use cosmos rpc status command

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update ethermint import path

github.com/tharsis/ethermint -> github.com/evmos/ethermint

* Upgrade ibc-go to v6

* Update proto dependencies

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update Tally handler test with new gov types

* Update helpers.GenTx -> helpers.GenSignedMockTx

* Update evmkeeper.NewKeeper params

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update ante authz, tests

* Add feemarket transient key, pass subspaces to evm/feemarket keepers

* Update new ante decorators

* Add new addModuleInitFlags to server commands

* Pass codec to keyring.New in genaccounts

* Pass codec to client keys add

* Add SendCoins to evmutil bank_keeper

* Use github.com/cosmos/iavl@v0.19.5

* Add ante HandlerOptions

* Add unimplemented SendCoins to evmutil bank keeper

Ethermint x/evm does not use this method

* Update init-new-chain script to disable post-london blocks

* Modify test genesis states to append 1 validator

* Update tally handler test to use string values

* Prevent querying balance for empty sdk.AccAddress in auction bidding test

* Set default bond denom to ukava

* Remove overwritten bank genesis total supply in committee proposal test

Signed-off-by: drklee3 <derrick@dlee.dev>

* Use ukava for testing staked balance

* Disable minting in community proposal handler test

Previously stake denom is used, which resulted in 0 minted coins

* Update hard APYToSPY test expected value

Increased iterations in sdk.ApproxRoot, updated closer to real value

* Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards

* Allow bkava earn incentive test values to match within small margin for rounding

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update invalid denom in issuance message coin validation

Colons are now valid in denoms

Signed-off-by: drklee3 <derrick@dlee.dev>

* Remove genesis validator in incentive delegation tests

* Update pricefeed market test for invalid denom

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update incentive delegator rewards test without genesis validator

Signed-off-by: drklee3 <derrick@dlee.dev>

* Add validator to export test

* Clear bank state in minting tests

Signed-off-by: drklee3 <derrick@dlee.dev>

* Remove validator for no stake tally test

Signed-off-by: drklee3 <derrick@dlee.dev>

* Clear incentive state before InitGenesis in incentive genesis export test

* Update swagger

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update ethermint version to match replaced version

* Remove legacy swagger

* Add NewEthEmitEventDecorator

* Remove redundant func for AddModuleInitFlags

* Remove unused addBankBalanceForAddress func

* Add SetIAVLLazyLoading option to app cmd

* Use legacy.RegisterAminoMsg for committee msg concrete registration

* Remove unnecessary Amino field

* Add evm_util bankkeeper SendCoins comment

* Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear

* Validate incentive params.RewardsPerSecond to be non-zero

* Validate swap pools to disallow colons in token denoms

* Register all legacy amino types on gov modulecdc

* Remove redundant Comittee interface registration

* Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7

Causes failed to load state at height errors

* Update ethermint to new pinned version with minGasPrices parse error fix

* Update cosmos fork dependcy commit to include reverted account constructor patch

* Update Cosmos v0.46.11 and cometbft v0.34.27

* Bump minimum go version to 1.19

* Update tendermint proto

* Update internal testnet genesis

* Move NewCanTransferDecorator before NewEthGasConsumeDecorator

* Add hard borrow store tests (#1514)

* add store tests for Borrow type

* refactor Deposit tests to match

* Fix old bep3 tests (#1515)

* Update Ethermint to 1b17445 to fix duplicate proto registration

* Add custom status command to use snake_case and stdout

* Add SetInflation helper

* Reduce ambiguity with evm CanSignEthTx error

* Remove init genesis validator claim in test

* Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note

* chore: use tagged versions for Cosmos and Ethermint forks

* update kvtool & increase wait for ibc transfer test

---------

Signed-off-by: drklee3 <derrick@dlee.dev>
Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-03 20:08:45 -04:00
Robert Pirtle
05a705be79
remove x/community references (#1454)
* remove new community pool from earn

* remove x/community from kavadist

* remove overridden community-pool query
2023-01-26 10:01:28 -07:00
Robert Pirtle
0d38ce77a1
replace x/kavamint with x/mint (#1452)
* replace x/kavamint with x/mint

* replace x/mint with x/kavamint in internal testnet

* delete all x/kavamint code (#1453)
2023-01-26 09:50:27 -07:00
Ruaridh
4b8e224f6a
Revert incentive refactor commits (#1433)
* Revert "Add incentive migrations for earn rewards (#1406)"

This reverts commit 937e5f339f.

* Revert "Use different accumulator for earn (#1395)"

This reverts commit cf009647e6.

* Revert "Add base earn incentive accumulator (#1393)"

This reverts commit 44a90a8ef9.

* Revert "Add generic incentive `AccumulateRewards` method (#1392)"

This reverts commit dce631d3de.

* Revert "Add GetSynchronizedClaim and swap adapter (#1386)"

This reverts commit f52a581ea9.

* Revert "Add Initialize/Synchronize Claim methods (#1383)"

This reverts commit c2061f626e.

* Revert "Add source adapter interface definition (#1377)"

This reverts commit 2abb2ce606.

* Revert "Add incentive RewardIndexes types and state methods (#1381)"

This reverts commit 4a3002b09c.

* Revert "Add AccrualTime type and state methods (#1379)"

This reverts commit df1c2ffc34.

* Revert "Add incentive claim state methods (#1375)"

This reverts commit 90735e29ed.

* Revert "Add generic Claim type (#1371)"

This reverts commit 45fc1a7643.

* Regerate protos and minor revert fixes
2022-12-22 01:08:16 +00:00
Robert Pirtle
8eb9e1d4a1
Add LegacyCommunityPool query to x/community (#1432)
* add proto for LegacyCommunityPool query

* add distribution keeper to community keeper

* implement LegacyCommunityPool query

* add cli cmd for legacy-community-pool
2022-12-19 13:56:46 -08:00
Robert Pirtle
ad0d1f80c8
Override original community-pool query service (#1430)
* initial version

* override x/distribution community-pool query

* test subset of original x/distribution queries

Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
2022-12-19 13:50:43 -08:00
Robert Pirtle
f0731ceb0e
Setup CLI for x/community lend proposals (#1427)
* add tx for CommunityPoolLendDepositProposal

* add cli cmd for CommunityPoolWithdrawProposal
2022-12-12 17:10:36 -08:00
Robert Pirtle
7c58fb5303
Add x/community Lend proposals (#1425)
* implement & register x/community lend proposals

* register proposals in x/community codec

* allow x/community macc to receive funds

* init lend from genesis in proposal tests

* test CommunityLendWithdrawProposal

* helpful comment on x/community keeper deps

* use RouteKey in module.go
2022-12-12 16:38:27 -08:00
Robert Pirtle
016eecfcc0
remove x/mint (#1416)
* use kavamint in incentive to calculate staking apy

* use kavamint minting: rewards_earn_staking_integration_test

* update incentive tests to mint only with kavamint

* remove x/mint from incentive tests

* remove x/mint from kava app

* fix minting in x/auction tests

* replace simapp fund calls with test helper

* remove mint state from genesis.json
2022-12-09 14:31:31 -08:00