* Add incentive grpc query service
* Register query server
* Add grpc query test
* Add grpc query test
* Fix proto lints
* Fix missing savings field, update tests
* Update proto docs
* Use consts for query reward types
* Add owner to queryRewards err
* Add empty reward type to be valid
* 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
* add `x/kavamint` module (#1376)
* stub out the x/kavamint module
* mint staking rewards in x/kavamint BeginBlocker
* calculate cumulative inflation from x/kavamint
* cleanup, abstract bond denom, grpc query tests
* store & use previous block time to calculate mints
* move test suite to testutil
* add test of x/kavamint BeginBlocker
* cleanup & comments from @DracoLi review
* fix x/incentive integration test
* remove rest client grpc test
* add x/kavamint module spec
* track previous block time in genesis
* suggested cleanup from PR review
* bugfix incorrect module account check
* add x/community module (#1388)
* add x/community module
* refactor and setup fund-community-pool tx
* remove unused features (params, genesis state)
* test x/community query and message
* update with master branch deps
* updates from review
* indicate deprecated methods on module (still needed to fulfill interface)
* remove legacy querier
* derive msg Route() and Type() from sdk.MsgTypeURL(&msg)
* use module name for message Route()
* mint community pool inflation in x/kavamint (#1389)
* mint community pool inflation in x/kavamint
* refactor x/kavamint abci inflation test
* test inflation from x/kavamint
* default kavamint rates to 0%
* rename kavamint account name variables
* panic if genesis kavamint previous block time not set
* emit event on kavamint begin blocker
* add kavamint year of inflation sanity check test
* update fund_community_pool message event
* add x/community spec
* refactor inflation accumulation into single func
* use new comm pool in kavadist multispend proposal (#1403)
the x/community module houses the new community pool. this commit
points the CommunityPoolMultiSpendProposal at the new community pool
so that multispend proposals can continue to be processed once original
fee pool funds are move to x/community
* updates from proto lint changes
* update earn proposals to use new community pool
originally the CommunityPoolDepositProposal & CommunityPoolWithdrawProposal
used the vanilla community pool fee pool. this commit updates them both
to use the new x/community module account.
* spec formatting update
* add x/community & x/kavamint to internal testnet genesis
* increase test coverage of x/kavamint
* increase test coverage of x/community
* use string type for sdk.Dec proto fields; disable generation of getters
for genesis and params (and other store objects)
* follow sdk conventions for params endpoint naming
* add kavamint to swagger; update swagger & proto docs
* remove legacy querier; touch up module to match others
* reduce max minting rate; refactor genesis to allow nil/zero block time;
repace proto stringers and remove getters; keep sdk.Dec values strings
in protos; increase validation of sdk.Dec values in params; increase
coverage; add module account permission checks; ensure import and export
of genesis does not change state
* fix scaling of rate values -- should be yearly rates
* revert key change
* fix typo in test name
* fix regression in running tests -- rename method
Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
* Add initial earn claim migrations
* Use existing types for migrations, add accural time migrations
* Add MigrateRewardIndexes
* Delete old state after migration
* Update store test with multiple entries
* Move key methods to keys.go
* Update incentive consensus version to 3
* Call MigrateRewardIndexes in main migration, remove debugging statements
* Fix migration version to v3
* Update module versions
* Update outdated v1 comment
* Add accumulators
* Move accumulator back to keeper package
* Add earn specific accumulators
* Move store methods to sub-package
* Move earn accumulator
* Rename accumulator files
* Add store doc comment
* Add earn accumulator tests, panic if accumulator not used with earn claim type
* Update earn accumulator tests to use new methods
* Add staking test for earn accumulator
* Add test for accumulator proportional rewards
* Remove old copy of GetProportionalRewardsPerSecond
* Add test for basic accumulator
* Fix AddIncentiveMultiRewardPeriod replacement
* Deduplicate base earn reward accumulator
* Check errors in tests
* Validate RewardPeriods in Params.Validate()
* Use adapter to fetch earn total shares
* Add generic accumulator
* Add MultiRewardPeriodOfClaimType type to params
* Add adapters wrapper
* Add MultiRewardPeriodsOfClaimType to params
* Add multireward period to genesis test
* Rename MultiRewardPeriodOfClaimType to TypedMultiRewardPeriod
* Use source adapters wrapper
* start makefile refactor to smaller units; break out proto-dep updating;
add check-proto-deps target for use in CI in order to determine if
depdencies have diverged
* add proto check workflow
* download go modules before checking proto deps
* clean up -- hide output and add error message for check target
* add error message for check-rsync
* update any type, and ibc-go protos for v3.4.0
* add buf generate files for gogo, docs, and swagger
* update swagger dirs and run with latest swagger gen
* ignore new build directories
* refactor proto makefile logic -- use buf instead of scripts
* remove old protobuf scripts
* run all proto checks on push
* remove moved file
* set default value for protoc machine
* install build deps seperately
* fetch master for buf check breaking
* checkout from https url in CI for buf breaking
* fix rsync file permissions on darwin
* ignore build dirs
* fix issue with apple provided make; clean up build deps; switch to buf
format
* remove clang format file -- using buf format now
* run make proto-format (buf format changes)
* update generated files for proto format changes
* Add init/sync claim methods
* Add todo
* Make GetSynchronizedClaim method todo
* Remove GetSynchronizedClaim
Work moved to different task
* Update GetRewardIndexesOfClaimType method
* Add methods for reward accrual time
* Add accrual time methods
* Add claim type to IterateAllRewardAccrualTimes callback method
* Use new AccrualTime proto type for state methods, add to genesis
* Add GetAllRewardAccrualTimes doc
* Add accrual times to genesis methods
* Remove DecodeKeyPrefix
* Update acrual time iterate method naming
* Update Iterate claims naming
* Use method for sourceID key conversion
the yaml tags are not needed as they are generated automatically from the
json tags.
additionally fixed proto formatting error requiring doc comments on enum
values (for x/incentive claim type enum).
* Update incentive test to use beginblocker instead manual accumulation
* Update integration test suite
* Add base integration test, wip staking reward calculation
* Get actual staking reward amounts from BeginBlocker events, calculate expected indexes
* Simplify event parsing
* Add initial earn accum test with real keepers
* Add the rest of the accum integration tests with real keepers
* Check if delegation rewards are zero before transferring
* Update staking integration test to use updated methods
* Call earn hooks with correct share values
User's shares instead of total vault shares
* Use different amounts for different accounts
* Add claim test with staking claims
* Remove logging statements
* Remove log
* Pass suite.T() to mock earn hooks
* Use begin blocker for staking reward distribution
* Remove unused beginblocker
* Remove log
* wip Add claim
* Add distr keeper and claiming
* Add claim test
* Update claim test with failures
* wip Add staking rewards
* -S
Fix savings to earn incentive methods
* Use a single accural time for all earn incentives
* Add additional required liquid methods
* Update genesis to only include 1 accrual time for earn
* Revert "Update genesis to only include 1 accrual time for earn"
This reverts commit cc7e35347298681c0c8a4a0b9bf9b9b296c25531.
* Revert "Use a single accural time for all earn incentives"
This reverts commit aeb49c4622d4e3d99dc6421c8830932b1b546be9.
* Update tests with incentive distribution
* Add earn to incentive rewards query
* add earn cli tx
* Update claim example to use ukava large
* Use underlying ukava to determine proportional reward amount
* Rename liquid methods to reflect derivative value
* Add tests for derivative values
* Return error to panic in BeginBlocker
Co-authored-by: karzak <kjydavis3@gmail.com>
* Add module name to multiplier
* Add claim test to use correct multiplier
* Add separate test for GetMultiplierByDenom
* Add 0 length lockup for earn to params test
* Add additional tests for genesis and params
* Add bkava handler for earn incentives
* Add bkava accum tests
* Add bkava denoms in index state
* Set storeTimeEquals to default value
* Add supply expected keepers
* Add tests for proportional adjustment
* Add liquid keeper to incentive keeper
* Use weighted reward periods for bkava
* Add liquid keeper to tests
* Add Accumulate override rewards period with deccoins
* Adjust test to handle sub unit coins
* Add liquid keeper to test
* Fix div by zero for proportional rewards
* Update test for actual expected values
* Update expected indexes to be same for different vaults
* Allow no stored time for vaults that have no indexes or state
* Add test for partial bkava deposit
* Add math check to test
* Deterministically iterate over bkava denoms
* Remove unused expected liquid method GetAllDerivativeDenoms
* Add incentive types
* Add earn state methods
* Update earn incentives
* Update unit test NewKeeper to include earn keeper
* Fix sharesOwned typo
* Shares not used for AfterVaultDepositCreated
* Add earn to init genesis
* Pass earn keeper to incentive keeper
* Add sdk.Msg impl, disable legacy migrations
* Disable migrations
* Update incentive earn sync test
* Add earn to client and querier
* Add accum and init tests
* Add additional earn tests
* Fill in fakeEarnKeeper methods to fix tests
* Add earn reward periods to params, begin blocker earn reward
* Add earn to query
* Update genesis_test with missing DefaultMultiRewardPeriods parameter
* Remove disable of migration package
* Fix proto type comments
* Remove unused migration state
* Add legacytx.LegacyMsg compile time interface check
* add earn state validation to genesis validation
Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
* ibc v3 upgrade
* ibc no longer uses confio
* add proofs proto for ibc/v3
* wip add ethermint module
* update cosmos to 0.45.0
* add ethermint proto & bug fixes
* remove todo
* update docs
* fix a number of bugs
* minor comments update
* fix breaking tests
* Wrap bank keeper for EVM to convert decimals (#1154)
* Add bankkeeper wrapper for evm
* Remove agas from init-new-chain.sh, use ukava for evm_denom
* Fix sdk.Coins conversion, require min 1 coin amount
* Remove gas from init script
idk how this happened lol
* Remove debug logging stmt
* Restore original init ukava amounts
* Fix inplace coins conversion
* Use evmtypes.BankKeeper interface insteadof banktypes
* Add TestGetBalance
* Add doc comments, remove temp actualAmt vars
actualAmt vars replaced with inline calls to make it more clear that the
converted value is being used, as opposed to accidentally reusing the
raw EVM amt.
* Add TestSetBalance
* Add TestIdempotentConversion
* Panic if converted coin from EVM is 0
This happens if a value is less than 1ukava
* Deep copy coins instead of in place modification
* Update test coins amount
* Add panic tests for small EVM amounts
* Use evmtypes.BankKeeper as NewEVMBankKeeper param
* Tidy test setup
* ensure sdk config is set when creating new apps
* Respond EVM bank keeper GetBalance with SpendableCoins
Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
* further speed up docker builds
* feat: restore previous keys add defaults, add eth flag (#1172)
* feat: restore previous keys add defaults, add eth flag
* remove outdated comment
* fix: remove redundant flag default
* evm bank keeper with akava handling
* fix issues
* add remaining tests
* add emv module to app
* add missing imports
* clean up comments
* wip akava keeper
* evm keeper
* fix genesis import
* reduce module permissions
* add bank keeper tests
* cleanup tests
* genesis tests
* change defaults
* add eth faucet key & fix issues
* switch to kava ethermint
* add a lot of tests
* add balances invariant
* add evm tests
* Remove panic if Swagger disabled in config (#1155) (#1183)
Co-authored-by: Derrick Lee <derrick@dlee.dev>
* add invariant to catch any akava balance > 1 ukava
* clarify name of balances invariant
* connect invariants to app
* fix evmbankkeeper akava issues
* add spec for evmutil
* remove zero balance accounts from state
* minor adustments
* update to ethermint 0.10.0
* fix eth ante
* add missing godoc comment
* Update x/evmutil/spec/01_concepts.md
Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
* Update x/evmutil/spec/01_concepts.md
Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
* Update ethermint to v0.12 (#1203)
* update to ethermint v0.12.2
* use app.Options for new evm options
* fix missed references to app.Options
* use ethermint branch while waiting on upstream fix
* evm migrations for tesnet alpha 2 (#1206)
* update to ethermint v0.12.2
* use app.Options for new evm options
* fix missed references to app.Options
* use ethermint branch while waiting on upstream fix
* add upgrade handler for evm-alpha testnet 2
* v17 migration setup + evm modules
* refactor migrate states
* x/feemarket migration
* v17 migrations setup + evm modules migration (#1210)
* v17 migration setup + evm modules
* refactor migrate states
* update gen time
* fix: update genesis time in test output
Co-authored-by: karzak <kjydavis3@gmail.com>
* add savings module to app blockers
Co-authored-by: Derrick Lee <derrick@dlee.dev>
Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
Co-authored-by: karzak <kjydavis3@gmail.com>
* define and generate proto types
* implement savings claim msg + test
* implement savings claim + test
* register msg and add store keys
* implement savings claim keeper methods
* update function comment
* define and generate proto types, update types dir
* update gen state with savings + test
* update legacy test data for ci test
* update proto types numbering
* update params proto types numbering
* move multipliers to their own file
* add multipliers per denom to MsgClaimHardReward
* claim with multipliers per denom for hard claims
* remove unused error
* add multipliers per denom to params
connect to to hard claiming
* temporary fix migration
* update usdx claiming for new multiplier params
* claim with multipliers per denom for delegator
* claim with multipliers per denom for swap rewards
* tidy up multiplier name validation
* rename new multipliers field in params
* remove old multpliers from params
* clear up various TODOs
* add tags to new structs
* remove dead code
* extract borrow sync logic into separate func
* fix borrow reward calculations
Use the normalized borrow as the source shares in reward calculations.
* extract supply sync logic into separate func
* prepare to fix supply reward calculations
* fix deposit reward calculations
Use the normalized deposit as the source shares in reward calculations.
* extract usdx sync logic into separate func
* prepare to fix usdx reward calculations
* fix cdp reward calculations
Use the normalized cdp debt as the source shares in reward calculations.
* fix compile error from messed up partial stage
* Fix incentive usdx reward bug (#976)
* minor test refactors
* fix overpayment bug
Init methods should not read params.
Add test to cover bug
* fix typos
* add test for validate multi reward periods
* tidy up: combine files
* don't accumulate global indexes containing zeros
Previously if the time since last block was 0,
indexes were added containing 0s.
Now leave them out. Missing is assumed to be 0.
* move state independent test to types folder
* clarify reward source concept to "source shares"
- rename variables and update doc comments
- extract method from swap accumulation
* tidy up and expand swap accumulation unit tests
* rename swap test file to match others
* update swap pool id format in tests
* refactor borrow accumulation, use new accumulator
* refactor supply accumulation, use new accumulator
* refactor delegator accumulation, use accumulator
* refactor usdx accumulation, use new accumulator
* fix types const
* remove unsed methods
* more usdx minting param validation.
Protect against the rewards per second denom changing.
It should always be "ukava".
* add safety check in InitGenesis
It prevents huge accumulations on the first block by limiting all
previous accumulation times to be within one year of genesis
* add todo for adding swp token distirbution info
* update state store key separator and extract pool key sep
* update state key separater and pool id seperator to not conflict with
'/' in ibc vouchers
* fix pool ids for updated sep
* move defualt values to file where they're used
* add type to hold RewardIndexes in genesis state
* add reward indexes state to genesis
* fix genesis state importers
* add iterator keeper methods for accrual times
* remove syncing from export/init genesis
* separate incentive migration to new file
* refactor out common funcs from incentive migration
* update legacy genesis state to v0.14.3
* add test and example migrated json
* fully initialize rewards in genesis builder
* add kava-7-mainnet incentive state
* run aliasgen
* add missing type to incentive/legacy
Co-authored-by: karzak <kjydavis3@gmail.com>