-
Notifications
You must be signed in to change notification settings - Fork 328
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
revise self stake buckets #4312
Conversation
4c07942
to
cfe1123
Compare
37f7c45
to
20bee9e
Compare
a5a4d79
to
7536390
Compare
action/protocol/staking/handler_candidate_transfer_ownership_test.go
Outdated
Show resolved
Hide resolved
action/protocol/staking/protocol.go
Outdated
// new vote reviser, revise ate greenland | ||
voteReviser := NewVoteReviser(cfg.Staking.VoteWeightCalConsts, correctCandsHeight, reviseHeights...) | ||
// new vote reviser, revise at greenland | ||
// TODO: pass ctx to voteReviser |
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.
think this is done below? or still needed?
}, nil, nil, nil, genesis.Default.GreenlandBlockHeight) | ||
Revise: ReviseConfig{ | ||
VoteWeight: genesis.Default.Staking.VoteWeightCalConsts, | ||
CorrectCandsHeight: genesis.Default.GreenlandBlockHeight, |
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.
correct or leave empty
}, nil, nil, nil, genesis.Default.GreenlandBlockHeight, genesis.Default.GreenlandBlockHeight) | ||
Revise: ReviseConfig{ | ||
VoteWeight: genesis.Default.Staking.VoteWeightCalConsts, | ||
CorrectCandsHeight: genesis.Default.GreenlandBlockHeight, |
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.
correct or leave empty
}, cbi, nil, nil, genesis.Default.GreenlandBlockHeight, genesis.Default.GreenlandBlockHeight) | ||
Revise: ReviseConfig{ | ||
VoteWeight: genesis.Default.Staking.VoteWeightCalConsts, | ||
CorrectCandsHeight: genesis.Default.GreenlandBlockHeight, |
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.
correct or leave empty
}, nil, nil, nil, genesis.Default.GreenlandBlockHeight) | ||
Revise: ReviseConfig{ | ||
VoteWeight: genesis.Default.Staking.VoteWeightCalConsts, | ||
CorrectCandsHeight: genesis.Default.GreenlandBlockHeight, |
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.
correct or leave empty
}, nil, csIndexer, nil, genesis.Default.GreenlandBlockHeight) | ||
Revise: ReviseConfig{ | ||
VoteWeight: genesis.Default.Staking.VoteWeightCalConsts, | ||
CorrectCandsHeight: genesis.Default.GreenlandBlockHeight, |
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.
correct or leave empty
case err != nil: | ||
return err | ||
} | ||
cands, err = vr.reviseSelfStakeBuckets(ctx, csm, height, cands) |
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.
revise self stake is an option for this time, not needed for every revise, so better to write like
if vr.shouldReviseSelfStakeBuckets(height) {
cands, err = vr.reviseSelfStakeBuckets()
}
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.
also it's possible to only revise affected cands right? like
if vr.shouldReviseSelfStakeBuckets(height) {
cands, err := vr.reviseSelfStakeBuckets()
}
cands
returned above should only contain affected cands (endorsement expired), we only need to revise the votes for these cands right?
7536390
to
85d7136
Compare
Quality Gate failedFailed conditions |
cands, err = vr.reviseSelfStakeBuckets(ctx, csm, height, cands) | ||
if err != nil { | ||
return err | ||
if vr.shouldReviseSelfStakeBuckets(height) { |
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.
it is actually revise for endorsement status, i think name it reviseEndorsement
or at least put endorsement
into the func name
jump to https://github.com/iotexproject/iotex-core/pull/4312/files/c9cbbe0ca978ead3ff6a8c9d87cb8ff4c935c5f3..7536390e8fbcde722b1209ef5676d3b2b2adabdc to review. add a feature to revise endorsements of self stake buckets
Fixes #(issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: