Merged
Conversation
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
Contributor
Reviewer's GuideThis PR refactors processFinalizedTransactions to batch multiple deposit outputs per transaction by vout, updates the mint preparation and status‐update logic accordingly, and extends models and tests to support this grouping. Sequence diagram for grouped processing in processFinalizedTransactionssequenceDiagram
participant Indexer
participant DB
participant BlocksDB
participant SuiClient
Note over Indexer: Start processFinalizedTransactions
Indexer->>DB: SELECT finalized txs (tx_id, vout, block_hash, block_height)
DB-->>Indexer: Return FinalizedTxD1Row[]
Indexer->>Indexer: Group txs by tx_id
loop For each tx group
Indexer->>BlocksDB: Get block by block_hash
BlocksDB-->>Indexer: Return block
Indexer->>Indexer: Prepare mintBatchArg for each group
end
Indexer->>SuiClient: tryMintNbtcBatch(mintBatchArgs)
SuiClient-->>Indexer: Batch mint result
loop For each deposit
Indexer->>DB: UPDATE nbtc_minting SET status (by tx_id, vout)
end
Class diagram for updated transaction grouping modelsclassDiagram
FinalizedTxD1Row <|-- GroupedFinalizedTx
class FinalizedTxD1Row {
+string tx_id
+number vout
+string block_hash
+number block_height
}
class GroupedFinalizedTx {
+string block_hash
+number block_height
+FinalizedTxD1Row[] deposits
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Consider wrapping the batch of status updates in a single DB transaction to ensure atomicity and avoid partial commits.
- The processedPks variable name is not very descriptive; consider renaming it to something like processedDeposits for better readability.
- Add a test case with multiple deposits for the same tx_id to verify the grouping logic handles batch processing and updates correctly.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider wrapping the batch of status updates in a single DB transaction to ensure atomicity and avoid partial commits.
- The processedPks variable name is not very descriptive; consider renaming it to something like processedDeposits for better readability.
- Add a test case with multiple deposits for the same tx_id to verify the grouping logic handles batch processing and updates correctly.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
robert-zaremba
left a comment
There was a problem hiding this comment.
potential bugs. need more clarification
robert-zaremba
approved these changes
Aug 29, 2025
Contributor
robert-zaremba
left a comment
There was a problem hiding this comment.
pre-approving, but requested few changes
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdSummary by Sourcery
Process finalized Bitcoin transactions in grouped batches to handle multiple deposits per transaction, update mint status per output (vout), and ensure correct batch minting in SUI.
New Features:
Enhancements:
Tests: