Skip to content

fix: get_all_completed_transactions limit issues#7267

Merged
SWvheerden merged 1 commit intotari-project:developmentfrom
mmrrnn:fix_get_all_completed_transactions_limit_issues
Jun 26, 2025
Merged

fix: get_all_completed_transactions limit issues#7267
SWvheerden merged 1 commit intotari-project:developmentfrom
mmrrnn:fix_get_all_completed_transactions_limit_issues

Conversation

@mmrrnn
Copy link
Copy Markdown
Contributor

@mmrrnn mmrrnn commented Jun 26, 2025

Description

Limit filter was applied twice:

  1. when fetching completed and cancelled transactions, we use limit for both
    2 We apply offset and limit filter on merged records, which means: offset 20, limit 20. returns 0 records

Summary by CodeRabbit

  • Bug Fixes
    • Resolved an issue where completed and cancelled transactions were not fully retrieved due to an unintended limit. All relevant transactions are now fetched as expected.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jun 26, 2025

Walkthrough

The update changes the get_all_completed_transactions method in the wallet gRPC server to fetch all completed and cancelled transactions without applying a limit at the service call level. Instead of using the request's limit parameter, a fixed value of zero is passed, ensuring all relevant transactions are retrieved before any further filtering or pagination.

Changes

File(s) Change Summary
applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs Modified get_all_completed_transactions to fetch all transactions by passing limit=0 to service calls instead of using the request's limit parameter. No changes to public APIs.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant WalletGrpcServer
    participant TransactionService

    Client->>WalletGrpcServer: get_all_completed_transactions(req)
    WalletGrpcServer->>TransactionService: get_completed_transactions(limit=0)
    WalletGrpcServer->>TransactionService: get_cancelled_completed_transactions(limit=0)
    TransactionService-->>WalletGrpcServer: List of transactions
    WalletGrpcServer-->>Client: Filtered and paginated transaction list
Loading

Possibly related PRs

Suggested reviewers

  • SWvheerden

Poem

In the wallet’s warren, limits are gone,
Now every transaction hops along.
No more fences, no more gates—
All completed trades, the server awaits.
Rabbits rejoice, with data so free,
Every hop, a transaction spree!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3676ef and b614054.

📒 Files selected for processing (1)
  • applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs (3)
Learnt from: SolfataraEmit
PR: tari-project/tari#6994
File: docs/src/API_GRPC_Explanation.md:236-244
Timestamp: 2025-04-28T11:41:15.722Z
Learning: The minotari_console_wallet reports a fourth field `timelocked_balance` in the terminal output for the `getBalance` method, which should be reflected in the documentation for accuracy. The `wallet.proto` file confirms that `timelocked_balance` is defined as the fourth field in the `GetBalanceResponse` message.
Learnt from: SolfataraEmit
PR: tari-project/tari#6994
File: docs/src/API_GRPC_Explanation.md:236-244
Timestamp: 2025-04-28T11:41:15.722Z
Learning: The minotari_console_wallet reports a fourth field `timelocked_balance` in the terminal output for the `getBalance` method, which should be reflected in the documentation for accuracy.
Learnt from: ksrichard
PR: tari-project/tari#7129
File: applications/minotari_node/src/http/handler/sync_utxos_by_block.rs:21-29
Timestamp: 2025-05-29T20:59:32.020Z
Learning: In the Tari codebase, request validation for RPC services is handled at the service layer using the `serde_valid` crate rather than at the HTTP handler level. For example, `SyncUtxosByBlockRequest` validates that limit is between 1-5 and page is minimum 0. HTTP handlers should delegate validation to the service layer rather than implementing their own validation.
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: ci
  • GitHub Check: Cucumber tests / Base Layer
  • GitHub Check: test (mainnet, stagenet)
  • GitHub Check: cargo check with stable
  • GitHub Check: Cucumber tests / FFI
  • GitHub Check: test (nextnet, nextnet)
  • GitHub Check: test (testnet, esmeralda)
🔇 Additional comments (3)
applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs (3)

1326-1334: LGTM! Correct fix for double limit application.

This change properly removes the limit from the individual get_completed_transactions call, allowing all completed transactions to be fetched before applying pagination to the combined results. This addresses the core issue where limits were being applied twice.


1335-1345: LGTM! Consistent fix applied to cancelled transactions.

This change correctly removes the limit from the get_cancelled_completed_transactions call, maintaining consistency with the completed transactions fix. Now both service calls will return all relevant transactions before pagination is applied to the combined results.


1353-1364: Excellent! Proper pagination applied to combined results.

The offset and limit are now correctly applied to the combined, sorted transaction list. This ensures that pagination works as expected across both completed and cancelled transactions, rather than being applied separately to each category. The fix completely resolves the double-limit application issue described in the PR objectives.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

Test Results (CI)

    3 files    126 suites   51m 45s ⏱️
1 353 tests 1 351 ✅ 0 💤 2 ❌
4 057 runs  4 055 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit b614054.

@github-actions
Copy link
Copy Markdown

Test Results (Integration tests)

 2 files  1 errors  1 suites   18m 34s ⏱️
 8 tests 7 ✅ 0 💤 1 ❌
10 runs  7 ✅ 0 💤 3 ❌

For more details on these parsing errors and failures, see this check.

Results for commit b614054.

@SWvheerden SWvheerden merged commit da3f82d into tari-project:development Jun 26, 2025
13 of 17 checks passed
sdbondi added a commit to sdbondi/tari that referenced this pull request Jul 4, 2025
* development:
  chore: fix regression bug (tari-project#7276)
  feat!: expand gRPC readiness status to contain current processed block info (tari-project#7262)
  fix!: payref migration and indexes, add grpc query via output hash (tari-project#7266)
  feat: auto zero value coinbase reward calculation (tari-project#7259)
  feat!: improve grpc token supply (tari-project#7261)
  chore: new release v4.7.0-pre.0 (tari-project#7268)
  fix: get_all_completed_transactions limit issues (tari-project#7267)
  fix: ledger builds (tari-project#7260)
  feat: offline signing (tari-project#7122)
  test: verify accumulated difficulty (tari-project#7243)
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.

2 participants