flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Audit] Fee-collection events are the only handler not wrapped in a transaction, and worker inconsistency compounds UX-visible drift

Open K1NGD4VID opened this issue 3 months ago • 10 comments

Filed from the second-wave repository audit (issue 37/100). See the audit summary for full category context.

  • Location: backend/src/workers/soroban-event-worker.ts:1000-1060 (handleFeeCollected)
  • Problem: Unlike every other event handler in the file, this one performs its dedup check and its upsert as two separate top-level prisma calls instead of one prisma.$transaction, reopening a TOCTOU window the rest of the file was clearly designed to avoid.
  • Evidence: No $transaction wrapper, in contrast to sibling handlers in the same file.
  • Suggested implementation: Wrap the dedup-check + upsert in prisma.$transaction, matching the other handlers.
  • Acceptance criteria: A test simulating two near-simultaneous fee-collected events for the same tx confirms exactly one StreamEvent row is created.
  • Difficulty: S
  • Expected impact: Closes a duplicate-fee-event race visible to anyone reconciling fee revenue from the API.

K1NGD4VID avatar Aug 29 '26 18:08 K1NGD4VID

Hello and good day. I'm experienced and would love to resolve your issues in no time. Thank you

DeveloperEmmy avatar Aug 29 '26 19:08 DeveloperEmmy

@abimbolaalabi has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

Please assign this to me!

ℹ️ Repo Maintainers: To accept this application, review their application or assign @abimbolaalabi to this issue.

abimbolaalabi avatar Aug 29 '26 19:08 abimbolaalabi

@michealross has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

Let me work on this.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @michealross to this issue.

michealross avatar Aug 29 '26 19:08 michealross

@iyanukid2008-pixel has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

Hello maintainer, after reviewing this issue and it requirements, it falls under my section, and I'll like to solve this issue

ℹ️ Repo Maintainers: To accept this application, review their application or assign @iyanukid2008-pixel to this issue.

iyanukid2008-pixel avatar Aug 29 '26 20:08 iyanukid2008-pixel

@d1a-m3n has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

pls assign me to this task, i can work on it

ℹ️ Repo Maintainers: To accept this application, review their application or assign @d1a-m3n to this issue.

d1a-m3n avatar Aug 29 '26 20:08 d1a-m3n

Congratulations, @d1a-m3n! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

🧑‍💻 @d1a-m3n: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Aug 29 '26 20:08 drips-wave[bot]

This issue has been removed from the Stellar Wave Program by the repository maintainers.

@d1a-m3n, you have been unassigned from this issue. If you have any questions, please reach out to the repo maintainers.

drips-wave[bot] avatar Nov 18 '26 16:11 drips-wave[bot]

@Raheemah2k26 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

Hi maintainer, I can get this issue fixed quickly. Please assign it to me

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Raheemah2k26 to this issue.

Raheemah2k26 avatar Nov 21 '26 12:11 Raheemah2k26

Congratulations, @Raheemah2k26! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.

🧑‍💻 @Raheemah2k26: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Nov 21 '26 12:11 drips-wave[bot]

This issue has been completed by @Raheemah2k26 as part of the Stellar Wave Program's 11th Wave 🥳

😎 @Raheemah2k26: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

drips-wave[bot] avatar Nov 21 '26 16:11 drips-wave[bot]