Skip to content

fix: make soroban event processing idempotent - #1342

Open
d1a-m3n wants to merge 3 commits into
LabsCrypt:mainfrom
d1a-m3n:fix/fee-collected-transaction
Open

fix: make soroban event processing idempotent#1342
d1a-m3n wants to merge 3 commits into
LabsCrypt:mainfrom
d1a-m3n:fix/fee-collected-transaction

Conversation

@d1a-m3n

@d1a-m3n d1a-m3n commented Aug 30, 2026

Copy link
Copy Markdown

Description

This PR fixes duplicate fee_collected events being processed more than once by the Soroban event worker.

The worker now checks whether a StreamEvent has already been recorded before creating another one. This keeps event processing idempotent and prevents duplicate fee collection records when the same event is received again.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • 🔧 Refactoring
  • ⚡ Performance improvement
  • 🧪 Test addition or update

Related Issues

Closes #1220

Changes Made

  • Added duplicate detection for fee_collected events.
  • Prevented duplicate StreamEvent records from being created.
  • Added a test covering both the first processing of a fee collection event and a repeated/duplicate event.
  • Verified that duplicate events are skipped and a warning is logged.

Testing

I ran the Soroban event worker test suite locally.

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Test Steps

  1. Run the Soroban event worker tests.
  2. Verify that the fee_collected event test passes.
  3. Verify that the duplicate event does not create another StreamEvent.
  4. Verify that all existing tests in the file continue to pass.

Result: 13/13 tests passed.

Breaking Changes

None.

Screenshots/Demo

Not applicable.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Updated Postman/Hoppscotch API collections if routes changed
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have checked for breaking changes and documented them if applicable

Additional Notes

The targeted test file passes all 13 tests. The project's global coverage threshold can cause the full test command to exit with a coverage error when running only this individual test file, but there are no failing tests in the file itself.

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.

[Audit] Pause/resume respond "success" without actually changing any state

1 participant