-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix!: balance bonding/unbonding module pools #122
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7c57df7
wip
Reecepbcups 160e31e
updateBondedPoolPower
Reecepbcups a7a87d3
wip `updateBondedPoolPower` (96% of 100%)
Reecepbcups 1855e2a
wip: fix accounting with mint/burning absed on balance
Reecepbcups 26c2814
EndBlocker to burn NotBonded tokens
Reecepbcups ae1d552
why
Reecepbcups ca0c1ed
on remove: slash PoA validator 100%
Reecepbcups 609a916
remove endblock
Reecepbcups 16bb6bc
Slash on new shares of 0
Reecepbcups d90932d
lint
Reecepbcups 8e2cf02
update integration md
Reecepbcups 19e8b2f
expected: SlashingKeeper & BankKeeper
Reecepbcups 84dabb3
use expected keeper within `NewKeeper`
Reecepbcups 7d84f16
comment
Reecepbcups 12ccb7c
reduce to TokensToConsensusPower
Reecepbcups 783216d
comment on bft consensus power
Reecepbcups File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package keeper | ||
|
||
import ( | ||
"context" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" | ||
) | ||
|
||
type BankKeeper interface { | ||
GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin | ||
MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error | ||
SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error | ||
SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error | ||
} | ||
|
||
type SlashingKeeper interface { | ||
DeleteMissedBlockBitmap(ctx context.Context, addr sdk.ConsAddress) error | ||
SetValidatorSigningInfo(ctx context.Context, address sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) error | ||
} | ||
|
||
// We use almost all the methods from StakingKeeper. Just using it directly | ||
/* | ||
type StakingKeeper interface { | ||
Hooks() stakingtypes.StakingHooks | ||
|
||
SetParams(ctx context.Context, params stakingtypes.Params) error | ||
SetLastValidatorPower(ctx context.Context, operator sdk.ValAddress, power int64) error | ||
SetDelegation(ctx context.Context, delegation stakingtypes.Delegation) error | ||
SetValidator(ctx context.Context, validator stakingtypes.Validator) error | ||
SetValidatorByConsAddr(ctx context.Context, validator stakingtypes.Validator) error | ||
SetNewValidatorByPowerIndex(ctx context.Context, validator stakingtypes.Validator) error | ||
SetLastTotalPower(ctx context.Context, power math.Int) error | ||
DeleteLastValidatorPower(ctx context.Context, operator sdk.ValAddress) error | ||
GetLastTotalPower(ctx context.Context) (math.Int, error) | ||
|
||
Slash(ctx context.Context, consAddr sdk.ConsAddress, infractionHeight, power int64, slashFactor math.LegacyDec) (math.Int, error) | ||
|
||
MinCommissionRate(ctx context.Context) (math.LegacyDec, error) | ||
BondDenom(ctx context.Context) (string, error) | ||
|
||
GetValidator(ctx context.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, err error) | ||
GetAllValidators(ctx context.Context) (validators []stakingtypes.Validator, err error) | ||
GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, err error) | ||
GetLastValidatorPower(ctx context.Context, operator sdk.ValAddress) (power int64, err error) | ||
|
||
GetAllDelegations(ctx context.Context) (delegations []stakingtypes.Delegation, err error) | ||
|
||
TokensFromConsensusPower(ctx context.Context, power int64) math.Int | ||
TokensToConsensusPower(ctx context.Context, tokens math.Int) int64 | ||
|
||
PowerReduction(ctx context.Context) math.Int | ||
} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably call this function more than needed. Only is called on a change to the validator set, so see this as fine given sets will be mostly static