Skip to content

add vote reviser #2370

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

Merged
merged 6 commits into from
Aug 3, 2020
Merged

add vote reviser #2370

merged 6 commits into from
Aug 3, 2020

Conversation

yutongp
Copy link
Contributor

@yutongp yutongp commented Aug 2, 2020

No description provided.

@yutongp yutongp requested a review from a team as a code owner August 2, 2020 05:30
@@ -55,7 +55,10 @@ func (r *receiptLog) SetData(data []byte) {
r.data = data
}

func (r *receiptLog) Build(ctx context.Context, err error) *action.Log {
func (r *receiptLog) Build(ctx context.Context, err error, skipLogOnErr bool) *action.Log {
if err != nil && skipLogOnErr {
Copy link
Member

Choose a reason for hiding this comment

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

why add this? don't think it's correct?

for instance, it returns ErrCandidateNotExist (not critical), in this case we should return a receipt with corresponding status

Copy link
Member

Choose a reason for hiding this comment

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

BTW, this (skip log on err) is the behavior prior to FbkMigration height

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixing the inconsistency of number of topics. skip only after greenland which is larger than fairbankmigrationheight

@yutongp
Copy link
Contributor Author

yutongp commented Aug 2, 2020

Plz also fix the test. Thanks

@codecov
Copy link

codecov bot commented Aug 2, 2020

Codecov Report

Merging #2370 into master will decrease coverage by 0.00%.
The diff coverage is 52.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2370      +/-   ##
==========================================
- Coverage   55.53%   55.52%   -0.01%     
==========================================
  Files         216      217       +1     
  Lines       19747    19818      +71     
==========================================
+ Hits        10966    11004      +38     
- Misses       7348     7373      +25     
- Partials     1433     1441       +8     
Impacted Files Coverage Δ
action/protocol/staking/vote_reviser.go 52.38% <52.38%> (ø)
action/protocol/staking/protocol.go 40.98% <55.55%> (+0.26%) ⬆️
action/protocol/staking/candidate.go 62.16% <0.00%> (+0.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4daa619...c27cdff. Read the comment docs.

@CoderZhi CoderZhi force-pushed the vote_reviser branch 3 times, most recently from aa42970 to 0656093 Compare August 2, 2020 23:35
Comment on lines 227 to 229
if !p.voteReviser.NeedRevise(blkCtx.BlockHeight) {
return nil
}
Copy link
Contributor Author

@yutongp yutongp Aug 3, 2020

Choose a reason for hiding this comment

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

this is incorrect. should just skip revise not the whole function. that is why i used to put this check as an internal function. it is easy to skip other logic if check here

@yutongp
Copy link
Contributor Author

yutongp commented Aug 3, 2020

wait on nightly testing to merge

@yutongp yutongp merged commit 638804b into master Aug 3, 2020
@yutongp yutongp deleted the vote_reviser branch August 3, 2020 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants