-
Notifications
You must be signed in to change notification settings - Fork 0
Save boosted txs #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save boosted txs #470
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
31c58c3 to
5f70e06
Compare
|
@ben-kaufman guess I can close #470 in favour of this one?! EDIT: #460. |
5f70e06 to
a90fa04
Compare
@ovitrif ideally yes |
a90fa04 to
062363f
Compare
Thanks! I meant #460, but I think you understood me 🙏🏻 |
|
sorry for removing last Claude code review, was not my intention. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements functionality to track and display boosted transaction IDs for both RBF (Replace-By-Fee) and CPFP (Child-Pays-For-Parent) boost operations. Instead of deleting replaced transactions, they are now marked as removed from mempool with a doesExist = false flag.
Key changes:
- Boost transaction IDs are now stored in the
boostTxIdsfield for both RBF and CPFP operations - RBFed transactions are marked as removed from mempool instead of being deleted
- Logic added to mark replacement transactions as removed when the original transaction confirms
- UI updated to display boost transaction IDs and show removed status
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| BoostTransactionViewModel.kt | Updated to save parent/child transaction IDs to boostTxIds for both RBF and CPFP operations |
| ActivityRow.kt | Added UI display for removed transactions |
| ActivityExploreScreen.kt | Shows boosted transaction IDs with copy-to-clipboard functionality; removed unused navigation callback |
| ActivityDetailScreen.kt | Added test tag for removed transaction status |
| CoreService.kt | Added logic to mark replacement transactions as removed when original transaction confirms |
| ActivityRepo.kt | Changed deletion to marking as removed from mempool; updated pending boost processing to include parentTxId |
| PendingBoostActivity.kt | Added optional parentTxId field for tracking RBF relationships |
|
@ben-kaufman Can we delay merging until PR #461 is merged?! TY |
|
Please note, 'Removed from mempool' tx is showing a "Boosting icon" and I believe it shouldn't:
Also there's a discrepancy between iOS and Android. On iOS the label in the tx details reads "Transactions Removed from Mempool" and in Android "Removed from Mempool". I think it should be unified.
In addition I'd like to also ask as in synonymdev/bitkit-ios#230 (comment) to provide |
|
Which version should we go with then for the UI? |
Android seems more proper IMHO: both:
|
|
Updated the iOS PR so it should look the same |
E2e tests updated and passing on both iOS and Android. |
Pull Request Review: Save Boosted TXsSummaryThis PR implements functionality to track and display boosted transaction relationships for both RBF and CPFP transaction boosting mechanisms. The changes properly handle the lifecycle of replaced transactions by marking them as "removed from mempool" rather than deleting them, and track the relationship between parent and replacement transactions. Code Quality & Best Practices✅ Strengths
|
Pull Request Review: Save boosted txsI've reviewed PR #470 which implements saving boosted transaction IDs for activities and changes the behavior from deleting RBFed transactions to marking them as removed from mempool. ✅ StrengthsWell-tested implementation:
Clear semantic changes:
Good UI integration:
🔍 Issues & Concerns1. Performance Issue in
|
|
@ben-kaufman please merge master into this, fix conflicts and push, I will review afterwards 🙏🏻 |
|
@ovitrif I updated the branch (had no conflicts) |
Thanks! Feel free to ignore some of the issues, we don't have to respect them blindly. |
PR Review: Save boosted txsOverviewThis PR implements tracking of boosted transaction IDs for activities and changes the behavior from deleting RBFed transactions to marking them as removed from mempool. The implementation is well-structured with comprehensive test coverage. ✅ Strengths
🔍 Code Quality & Best PracticesActivityRepo.kt (lines 248-296)
CoreService.kt (lines 512-553)
BoostTransactionViewModel.kt
ActivityExploreScreen.kt (lines 261-291)
🐛 Potential Bugs & Edge Cases
⚡ Performance Considerations
🔒 Security Concerns
🧪 Test CoverageExcellent test coverage with 417 new test lines! Tests cover:
Suggestions for additional tests:
📝 Minor Suggestions
🎯 SummaryThis is a well-implemented PR with:
Recommendation: Approve with one minor optimization suggestion The performance concern is minor and only affects edge cases with large transaction histories. Consider optimizing the Review generated by Claude Code |
Pull Request Review: Save Boosted TransactionsOverviewThis PR implements tracking of boosted transaction IDs and changes the handling of RBF transactions from deletion to marking as removed from mempool. Overall, the implementation is solid with comprehensive test coverage. Below are my detailed findings. ✅ Strengths1. Excellent Test Coverage
2. Proper Data Model Evolution
3. Improved UX
🐛 Potential Issues1. Race Condition in
|
dab56c9 to
7dbed41
Compare
Pull Request Review: Save boosted txs (#470)OverviewThis PR implements tracking and display of boosted transaction IDs for both RBF (Replace-By-Fee) and CPFP (Child Pays For Parent) scenarios. The implementation aligns with the iOS versions in PRs #199 and #230. ✅ Strengths1. Comprehensive Test Coverage
2. Semantic Improvement
3. Good Error Handling
4. Clear Documentation
|
Code Review: Save Boosted TxsI've reviewed PR #470 and overall the implementation looks solid! The changes align well with the iOS implementations (PRs #199 and #230). Here's my detailed feedback: ✅ Strengths
🐛 Potential Issues1. Performance concern in
|
ovitrif
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@ben-kaufman Need your review as well now. Also please add this UI change to iOS as well: |
Code Review - PR #470: Save boosted txsOverviewThis PR implements tracking of boosted transaction relationships for RBF and CPFP operations. The implementation replaces transaction deletion with a "removed from mempool" marker and displays boosted transaction IDs in activity details. Positive Aspects1. Excellent Test Coverage
2. Good Documentation
3. Proper Error Handling
4. Clean Architecture
Issues & Concerns1. Critical: Potential Race Condition in markReplacementTransactionsAsRemovedLocation: Issue: The function fetches ALL onchain activities and iterates through them to find replacements. This could cause issues: val allActivities = getActivities(
filter = ActivityFilter.ONCHAIN,
// ... fetches ALL activities
)Problems:
Recommendation: 2. Performance: O(n) Iteration in markReplacementTransactionsAsRemovedLocation: Issue: Linear scan through all activities for each confirmed removed transaction. for (activity in allActivities) {
if (activity !is Activity.Onchain) continue
val onchainActivity = activity.v1
val isReplacement = onchainActivity.boostTxIds.contains(originalTxId) && ...Impact:
Recommendation:
3. Bug: Timestamp InconsistencyLocation: Issue: Two different ways to get current timestamp: // ActivityRepo.kt:488
updatedAt = nowTimestamp().toEpochMilli().toULong()
// CoreService.kt:542
updatedAt = System.currentTimeMillis().toULong() / 1000uProblems:
Recommendation: 4. Potential Bug: Missing Null CheckLocation: val existingActivity = getActivity(activityId).getOrNull()
?: return@withContext Result.failure(Exception("Activity $activityId not found"))Issue: Current behavior: runCatching {
return@withContext Result.failure(...) // This throws, not returns
}Recommendation: private suspend fun markActivityAsRemovedFromMempool(activityId: String): Result<Unit> = withContext(bgDispatcher) {
runCatching {
val existingActivity = getActivity(activityId).getOrNull()
?: throw Exception("Activity $activityId not found")
// ... rest of logic
}
}5. UX: Removed Transactions Still ClickableLocation: Issue: Boosted transaction IDs are clickable and copy to clipboard, but removed transactions might no longer exist in blockchain explorers. Recommendation:
6. Code Smell: Large Class Warning AddedLocation: @Suppress("LargeClass", "LongParameterList")Issue: Adding Recommendation:
7. Minor: Inconsistent Color for Removed TransactionsLocation: Issue: Icon uses // ActivityIcon.kt:98
icon = when {
!activity.doesExist() -> painterResource(R.drawable.ic_x)
...
},
iconColor = Colors.Brand, // Always blue, even for removed
// ActivityDetailScreen.kt:584
statusIcon = painterResource(R.drawable.ic_x)
statusColor = Colors.Red // Red for removedRecommendation: iconColor = when {
!activity.doesExist() -> Colors.Red
else -> Colors.Brand
}Security Considerations✅ No Major Security Issues Found
Performance Considerations
Suggested ImprovementsHigh Priority
Medium Priority
Low Priority
Test Coverage AssessmentScore: 9/10 - Excellent coverage of new functionality What's tested:
What could be added:
SummaryThis is a well-implemented feature with excellent test coverage and good architecture. The main concerns are:
The code quality is high, and the approach of marking transactions as removed rather than deleting them is the right design choice for maintaining history. Recommendation: Approve with minor fixes (timestamp consistency and return logic). Great work on this PR! The test coverage is particularly impressive. 🎉 |
|
cc
cc. @jvsena42 , need a final re-review of my latest changes so we can merge this. |
|
@ovitrif looks good, but I can't approve since it's my PR. I also updated iOS with the same change |
You could push one more change or rebase last commit of mine, then I can approve and voila 🙏🏻 |




This PR saves the boosted tx ids for an activity and shows them in activity details.
It also replaces the deleting of an RBFed tx with marking it as removed from mempool, and adds a check to mark boosted tx as removed if the original tx got confirmed.
Same as: synonymdev/bitkit-ios#199 and synonymdev/bitkit-ios#230