Skip to content

Comments

chore: Update the bundle's POST endpoint to use the mempool#13

Open
toruguera wants to merge 1 commit intofeat/mempool-enginefrom
chore/update-bundle-endpoint-mempool
Open

chore: Update the bundle's POST endpoint to use the mempool#13
toruguera wants to merge 1 commit intofeat/mempool-enginefrom
chore/update-bundle-endpoint-mempool

Conversation

@toruguera
Copy link

Modify POST /bundle endpoint to use asynchronous Mempool processing

Summary

Refactored the bundle creation endpoint to use the Mempool system for asynchronous processing instead of immediate synchronous transaction submission.

Changes

Modified Endpoint Behavior

  • Removed immediate transaction submission to Stellar network
  • Bundle is now added to Mempool queue for asynchronous processing
  • Endpoint returns immediately with status: "PENDING" instead of transactionHash
  • Response message updated to "Bundle received and queued for processing"

Code Changes

  • add-bundle.process.ts:

    • Removed transaction builder, OPEX handler, and network submission logic
    • Added bundle weight calculation and SlotBundle creation
    • Integrated Mempool via getMempool().addBundle()
    • Maintained validation, fee calculation, and UTXO persistence
  • post.ts:

    • Updated response schema: removed transactionHash, added status
    • Updated response message to reflect async processing
  • core/mempool/index.ts (new):

    • Created Mempool singleton module with initialization helpers

Files Modified

  • src/core/service/bundle/add-bundle.process.ts
  • src/http/v1/bundle/post.ts
  • src/core/mempool/index.ts (new)

Impact

  • Bundles are now processed asynchronously through the Mempool queue
  • Faster API response time (no network wait)
  • Better resource utilization with batch processing

…s the bundle operation and send to the Stellar network
@toruguera toruguera requested a review from fazzatti January 12, 2026 13:12
@toruguera toruguera self-assigned this Jan 12, 2026
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.

1 participant