You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Validator reputation/reviewCount updates run outside the quorum transaction #80
Why this matters now: Inconsistent reputation data undermines the validator-incentive model the platform is built on.
Problem / What:castVote (validatorService.ts:96-107) increments reviewCount in a separateprisma.user.updatebefore calling resolveQuorum→finalizeProof, which updates validatorReputation inside its own transaction (lines 210-221). If finalizeProof rolls back or throws after reviewCount was incremented, the validator's reviewCount is inflated while reputation is unchanged — permanent drift.
Key Challenges: Moving all reputation accounting into the single finalization transaction (or making it event-sourced), and reconciling any already-drifted rows.
Acceptance Criteria:
reviewCount and validatorReputation changes for a vote are atomic with finalization.
A fault injected during finalization leaves reputation counters consistent (test).
I checked src/services/validatorService.ts on current HEAD. castVote still increments reviewCount via a standalone prisma.user.update (around lines 101–103) before resolveQuorum → finalizeProof, which updates validatorReputation inside its own transaction. If finalization rolls back after that increment, reviewCount drifts permanently while reputation does not.
Plan:
Move reviewCount / reputation accounting into the same finalization transaction so both commit or neither does.
Add a fault-injection test that a failure during finalization leaves counters consistent.
Activity
greyhe0x commentedon Aug 23, 2026
I'd like to take this.
I checked
src/services/validatorService.tson current HEAD.castVotestill incrementsreviewCountvia a standaloneprisma.user.update(around lines 101–103) beforeresolveQuorum→finalizeProof, which updatesvalidatorReputationinside its own transaction. If finalization rolls back after that increment,reviewCountdrifts permanently while reputation does not.Plan:
reviewCount/ reputation accounting into the same finalization transaction so both commit or neither does.please assign this to me if that works.
grantfox-oss commentedon Aug 23, 2026
🦊 GrantFox — @greyhe0x has been assigned to this issue as part of the Third Campaign campaign!
Next steps:
Closes #80)Good luck! Track your progress on GrantFox.
grantfox-oss commentedon Aug 24, 2026
🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!
@greyhe0x's PR #95 was approved and merged by @cybermax4200.
🏆 @greyhe0x: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (48 total points). Track your full progress on GrantFox.
👏 Great work, @greyhe0x! Keep contributing to ecotask-network.