Conversation
Time Submission Status
|
Bug Report Checklist
@MicBun, please use git blame and specify the link to the commit link that has introduced this bug. |
|
Caution Review failedThe pull request is closed. WalkthroughThe PR refactors transaction fetching in Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Function as getLastTransactions()
participant Indexer
participant BlockMap as blockToTx Map
Client->>Function: Request transactions
Note over Function: Initialize missing blocks set
loop Iterative fetches (max 3 attempts)
Function->>Function: Calculate range<br/>(min/max from missing blocks)
alt Blocks remaining
Function->>Indexer: Query range (descending)
alt Success
Indexer-->>Function: Transactions batch
Function->>Function: Parse results
Note over Function: Track new missing blocks
else Fetch/Parse Error
Function->>Function: Log warning
end
alt Progress made
Function->>BlockMap: Update entries<br/>(only if height missing)
else No progress
Function->>Function: Break early
end
else All blocks found
Function->>Function: Exit loop
end
end
Function->>BlockMap: Final mapping step
Function-->>Client: Return transactions
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
merge immediately: needs to be implemented in trufscan |
resolves: https://github.com/trufnetwork/trufscan/issues/99
Summary by CodeRabbit