Skip to content

fixed score reset logic in the pse module#48

Merged
miladz68 merged 3 commits into
masterfrom
milad/pse-fix-score-reset-logic
Dec 10, 2025
Merged

fixed score reset logic in the pse module#48
miladz68 merged 3 commits into
masterfrom
milad/pse-fix-score-reset-logic

Conversation

@miladz68

@miladz68 miladz68 commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

Description

Reviewers checklist:

  • Try to write more meaningful comments with clear actions to be taken.
  • Nit-picking should be unblocking. Focus on core issues.

Authors checklist

  • Provide a concise and meaningful description
  • Review the code yourself first, before making the PR.
  • Annotate your PR in places that require explanation.
  • Think and try to split the PR to smaller PR if it is big.

This change is Reviewable

@miladz68 miladz68 requested a review from a team as a code owner December 9, 2025 10:55
@miladz68 miladz68 requested review from TxCorpi0x, masihyeganeh and ysv and removed request for a team December 9, 2025 10:55
ysv
ysv previously approved these changes Dec 9, 2025

@ysv ysv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ysv reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @masihyeganeh, @miladz68, and @TxCorpi0x)


x/pse/keeper/score_map.go line 143 at r1 (raw file):

		}
	}
	return allDelegationTimeEntry, nil

nit: Entry -> Entries ?

@TxCorpi0x TxCorpi0x left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@TxCorpi0x reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @masihyeganeh and @miladz68)


x/pse/keeper/distribute.go line 30 at r1 (raw file):

	}

	allDelegationTimeEntries, err := finalScoreMap.iterateDelegationTimeEntries(ctx, k)

Can we use iterator func and do k.DelegationTimeEntries.Set(ctx, kv.Key, kv.Value)in the loop instead of getting all of the entries all at once and do the changes in a separate loop?

@miladz68 miladz68 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @masihyeganeh and @TxCorpi0x)


x/pse/keeper/distribute.go line 30 at r1 (raw file):

Previously, TxCorpi0x wrote…

Can we use iterator func and do k.DelegationTimeEntries.Set(ctx, kv.Key, kv.Value)in the loop instead of getting all of the entries all at once and do the changes in a separate loop?

no, writes are not allowed while iterator is open.

@TxCorpi0x TxCorpi0x left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@TxCorpi0x reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)

@ysv ysv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ysv reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)

@miladz68 miladz68 merged commit c4ba4a2 into master Dec 10, 2025
9 checks passed
@miladz68 miladz68 deleted the milad/pse-fix-score-reset-logic branch December 10, 2025 09:39
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.

3 participants