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

staker Id needs to be corrected in logs in getting biggest staker #1225

Closed
Yashk767 opened this issue Aug 9, 2024 · 0 comments
Closed

staker Id needs to be corrected in logs in getting biggest staker #1225

Yashk767 opened this issue Aug 9, 2024 · 0 comments
Assignees
Labels

Comments

@Yashk767
Copy link
Contributor

Yashk767 commented Aug 9, 2024

Description

On feature/v1.2.0 after getStakeSnapshot batching changes in getting biggest staker, inside for loop we have:

for i := 0; i < len(stakeSnapshotArray); i++ {
		log.Debug("Propose: Staker Id: ", i)
		stake := stakeSnapshotArray[i]
		log.Debugf("Stake Snapshot of staker having stakerId %d is %s", i+1, stake)
		if stake.Cmp(biggestStake) > 0 {
			biggestStake = stake
			biggestStakerId = uint32(i + 1)
		}
	}

Here log.Debug("Propose: Staker Id: i") is incorrect as staker Id should be i+1 and
we do log it correctly after 2 lines in log.Debugf("Stake Snapshot of staker having stakerId %d is %s", i+1, stake)

So we can remove the redundant and incorrect log log.Debug("Propose: Staker Id: ", i)

@Yashk767 Yashk767 added the bug Something isn't working label Aug 9, 2024
@Yashk767 Yashk767 self-assigned this Aug 9, 2024
@Yashk767 Yashk767 changed the title staker Id needs to be corrected in logs in getting biggest staker Id staker Id needs to be corrected in logs in getting biggest staker Aug 9, 2024
@Yashk767 Yashk767 added refactor and removed bug Something isn't working labels Aug 9, 2024
@linear linear bot closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant