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: bump up cosmos [email protected] #783

Merged
merged 62 commits into from
Nov 21, 2022
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
dd303f4
fix: update x/mint parameter validation (backport #12384) (#12396)
mergify[bot] Jun 30, 2022
f79440f
chore: optimize get last completed upgrade (#12268)
robert-zaremba Jul 3, 2022
8400625
fix: Simulation is not deterministic due to GenTx (backport #12374) (…
adu-web3 Jul 4, 2022
cd576d7
fix: use go install instead of go get in makefile (#12435)
julienrbrt Jul 4, 2022
abfb005
chore: fumpt sdk v45 series #12442
faddat Jul 5, 2022
e0179be
feat: Move AppModule.BeginBlock and AppModule.EndBlock to extension i…
mergify[bot] Jul 19, 2022
e41d7cd
feat: add message index event attribute to authz message execution (b…
mergify[bot] Jul 22, 2022
bee2746
chore(store): upgrade iavl to v0.19.0 (backport #12626) (#12697)
mergify[bot] Jul 23, 2022
081106a
feat: Add `GetParamSetIfExists` to prevent panic on breaking param ch…
fedekunze Jul 26, 2022
ac4886e
feat: Add convenience method for constructing key to access account's…
mergify[bot] Aug 2, 2022
e17c69a
chore: bump tm in 0.45.x (#12784)
tac0turtle Aug 4, 2022
dc1ceb6
chore: 0.45.7 changelog prep (#12821)
tac0turtle Aug 4, 2022
263ef5e
docs(staking): typo in staking/state (backport #12834) (#12836)
mergify[bot] Aug 7, 2022
4f852dd
chore: fee payer event (backport #12850) (#12856)
mergify[bot] Aug 8, 2022
4362a52
chore: changelog update (backport #12859) (#12862)
mergify[bot] Aug 8, 2022
2df8bc6
fix: Use fixed length hex for pointer at FwdCapabilityKey (backport #…
yihuang Aug 9, 2022
49bf1ee
feat: deterministic map iteration (backport #12781) (#12944)
mergify[bot] Aug 18, 2022
f140302
chore: bump tendermint to `0.34.21` and iavl to `0.19.1` (#12970)
julienrbrt Aug 19, 2022
d477274
fix: proper error when parsing telemetry configuration (backport #129…
mergify[bot] Aug 23, 2022
17f314c
ci: fix release notes not populated by goreleaser (#13019)
mergify[bot] Aug 24, 2022
0efebd9
fix: missing return statement in BaseApp.Query (backport #13046) (#13…
mergify[bot] Aug 25, 2022
6ea09cb
chore: v0.45.8 release changelog (#13053)
julienrbrt Aug 25, 2022
21f2b6b
fix: call `SetIAVLCacheSize` with the configured value in simapp (bac…
mergify[bot] Aug 31, 2022
a02979d
feat: Add a cli cmd to prune old states according to current settings…
mergify[bot] Sep 2, 2022
d32022d
fix: rollback command don't actually delete multistore versions (back…
yihuang Sep 5, 2022
a276eda
fix: make linting work on 45 (#13185)
faddat Sep 8, 2022
5dc8b40
feat: configurable fastnode (backport #13321) (#13338)
mergify[bot] Sep 20, 2022
c37d9c8
fix: ensure withdraw_rewards events are always emitted on reward with…
mergify[bot] Sep 20, 2022
49cb9f4
imp(keyring): improve UX for keyring.List (#13369)
fedekunze Sep 27, 2022
c0e06d0
feat: ADR-038 Part 2: StreamingService interface, file writing implem…
yihuang Oct 3, 2022
819ee4d
feat: gRPC query for operator and chain configuration (backport #1348…
mergify[bot] Oct 11, 2022
8eb0635
chore: CHANGELOG update (backport #13536) (#13538)
mergify[bot] Oct 13, 2022
44f279c
refactor: Improve AllocateTokens (backport #13524) (#13527)
mergify[bot] Oct 13, 2022
822ecf5
chore: make iavl fast node migration off by default (#13540)
tac0turtle Oct 13, 2022
24f54b0
Merge pull request from GHSA-3qp7-gj37-g9rx
ebuchman Oct 14, 2022
4ad3a21
fix: move ics23 to correct folder (#13549)
aaronc Oct 14, 2022
191c8d8
fix: fix liveness tests #13551
ValarDragon Oct 14, 2022
08eafce
feat: add `GenSignedMockTx` (#13557)
julienrbrt Oct 16, 2022
1a8b7f1
fix: fix `make proto-gen` (#13564)
julienrbrt Oct 17, 2022
8563283
feat: [REDO] gRPC query for operator and chain configuration (backpor…
alexanderbez Oct 18, 2022
9fab156
chore: bump tendermint to `0.34.22` (#13585)
julienrbrt Oct 19, 2022
9a562b2
fix: (v0.45.x) regression in return value of WithdrawDelegationReward…
nddeluca Oct 20, 2022
ced46b3
fix(server): v0.45.x Populate the PruningKeepEvery config entry in Ge…
SpicyLemon Oct 21, 2022
3b4afa3
feat(cli): add module-account cli cmd and grpc get api (backport #136…
mergify[bot] Oct 24, 2022
c0b3a4e
chore: prepare 0.45.10 changelog (#13624)
julienrbrt Oct 24, 2022
db50658
update proto
dudong2 Nov 2, 2022
b071e7f
fix build
dudong2 Nov 2, 2022
fc22bb2
fix test
dudong2 Nov 3, 2022
44e57d8
chore: change default value of iavl-disable-fastnode to true
dudong2 Nov 3, 2022
ef6d4c4
test: remove TestCacheKVConcurrency
dudong2 Nov 7, 2022
fdbcc4b
chore: fix test build
dudong2 Nov 7, 2022
121a43e
docs: add changelog
dudong2 Nov 7, 2022
d550c31
Merge branch 'rc9/v0.46.0' into dudong2/feat/[email protected]
dudong2 Nov 8, 2022
b9ac7df
chore: apply pr reviews
dudong2 Nov 10, 2022
a9f3751
chore: remove awkward new line in comment
dudong2 Nov 10, 2022
92112b8
fix: lint error
dudong2 Nov 10, 2022
725aaad
chore: add cosmos.base.node.v1beta1.Service/Config for REST api
dudong2 Nov 16, 2022
7576587
chore: apply pr reviews
dudong2 Nov 16, 2022
f0aacab
Merge branch 'rc9/v0.46.0' into dudong2/feat/[email protected]
dudong2 Nov 16, 2022
f188296
chore: fix lint files
dudong2 Nov 16, 2022
b733391
feat: revert ostracon/abci/types.proto
dudong2 Nov 16, 2022
8686cc6
Merge remote-tracking branch 'lbm-sdk-upstream/rc9/v0.46.0' into dudo…
dudong2 Nov 21, 2022
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
20 changes: 14 additions & 6 deletions x/distribution/keeper/allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,22 @@ func (k Keeper) AllocateTokens(
// calculate fraction allocated to validators
communityTax := k.GetCommunityTax(ctx)
voteMultiplier := sdk.OneDec().Sub(proposerMultiplier).Sub(communityTax)
feeMultiplier := feesCollected.MulDecTruncate(voteMultiplier)

// allocate tokens proportionally to voting power
// TODO consider parallelizing later, ref https://github.com/cosmos/cosmos-sdk/pull/3099#discussion_r246276376
//
// TODO: Consider parallelizing later
//
// Ref: https://github.com/cosmos/cosmos-sdk/pull/3099#discussion_r246276376
for _, vote := range bondedVotes {
validator := k.stakingKeeper.ValidatorByConsAddr(ctx, vote.Validator.Address)

// TODO consider microslashing for missing votes.
// ref https://github.com/cosmos/cosmos-sdk/issues/2525#issuecomment-430838701
powerFraction := sdk.NewDec(vote.Validator.VotingWeight).QuoTruncate(sdk.NewDec(totalPreviousPower))
reward := feesCollected.MulDecTruncate(voteMultiplier).MulDecTruncate(powerFraction)
// TODO: Consider micro-slashing for missing votes.
//
// Ref: https://github.com/cosmos/cosmos-sdk/issues/2525#issuecomment-430838701
powerFraction := sdk.NewDec(vote.Validator.Power).QuoTruncate(sdk.NewDec(totalPreviousPower))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our Ostracon should use vote.Validator.VotingWeight instead of vote.Validator.Power, because it is different with tendermint in the power for voting.

reward := feeMultiplier.MulDecTruncate(powerFraction)

k.AllocateTokensToValidator(ctx, validator, reward)
remaining = remaining.Sub(reward)
}
Expand All @@ -100,7 +106,8 @@ func (k Keeper) AllocateTokens(
k.SetFeePool(ctx, feePool)
}

// AllocateTokensToValidator allocate tokens to a particular validator, splitting according to commission
// AllocateTokensToValidator allocate tokens to a particular validator,
// splitting according to commission.
func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) {
// split tokens between validator and delegators according to commission
commission := tokens.MulDec(val.GetCommission())
Expand Down Expand Up @@ -131,6 +138,7 @@ func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.Vali
sdk.NewAttribute(types.AttributeKeyValidator, val.GetOperator().String()),
),
)

outstanding := k.GetValidatorOutstandingRewards(ctx, val.GetOperator())
outstanding.Rewards = outstanding.Rewards.Add(tokens...)
k.SetValidatorOutstandingRewards(ctx, val.GetOperator(), outstanding)
Expand Down