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

Fetching staker from stakerId is duplicated. #932

Open
ashish10677 opened this issue Sep 7, 2022 · 0 comments
Open

Fetching staker from stakerId is duplicated. #932

ashish10677 opened this issue Sep 7, 2022 · 0 comments
Labels
code cleanup Improvements to make the code clean and more readable. good first issue Good for newcomers

Comments

@ashish10677
Copy link
Member

Rationale

Staker value is fetched in https://github.com/razor-network/razor-go/blob/33bdf45d066526da1eaa2ac4da8e7f92e5d2f7e2/cmd/vote.go#L154

But while calling HandleCommit it is again fetched, increasing the number of RPC call.
https://github.com/razor-network/razor-go/blob/33bdf45d066526da1eaa2ac4da8e7f92e5d2f7e2/cmd/vote.go#L279

This can be avoided if we pass staker instead of stakerId to the HandleCommit function.

Implementation

Pass staker instead of stakerId and modify the HandleCommit function accordingly.

@ashish10677 ashish10677 added good first issue Good for newcomers code cleanup Improvements to make the code clean and more readable. labels Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Improvements to make the code clean and more readable. good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant