Skip to content

feat: add global --no-cache flag to bypass local cache - #428

Open
Cashman-Exchange wants to merge 7 commits into
Toolbox-Lab:mainfrom
Cashman-Exchange:feat/issue-421-implement-global-cli-bypass-cache-flag
Open

feat: add global --no-cache flag to bypass local cache#428
Cashman-Exchange wants to merge 7 commits into
Toolbox-Lab:mainfrom
Cashman-Exchange:feat/issue-421-implement-global-cli-bypass-cache-flag

Conversation

@Cashman-Exchange

Copy link
Copy Markdown

Overview

This PR adds a global --no-cache flag to the grat CLI that bypasses all local state cache databases and cache files for the duration of a single command. When enabled, every cache lookup is skipped and the CLI falls through to live Soroban RPC and Stellar history archive queries, ensuring transaction simulation and decoding always use current network data during active development.

Related Issue

Changes

🚀 Global CLI No-Cache Flag

  • [ADD] crates/cli/src/main.rs

    • Adds a global no_cache: bool argument to the Cli struct.
    • Exposes the --no-cache flag on all commands.
    • Threads the flag through command parameters into the shared network/decoder configuration.
  • [MODIFY] crates/cli/src/commands/decode.rs

    • Accepts the new no_cache parameter.
    • Forwards it into the decode pipeline so grat decode <hash> --no-cache behaves as expected.
  • [MODIFY] crates/core/src/network/config.rs

    • Stores the no_cache flag in network configuration.
    • Makes the bypass setting available to RPC clients and cache providers.
  • [MODIFY] crates/core/src/cache/mod.rs, crates/core/src/cache/store.rs, crates/core/src/cache/provider.rs

    • Cache lookups are short-circuited when no_cache is set.
    • Existing cache entries are ignored.
    • Fetch logic always falls through to live network providers instead of returning stale state reconstruction data.
  • [MODIFY] crates/core/src/rpc/client.rs

    • Forces raw RPC fetching for transaction simulation/decoding when no_cache is active.
    • Avoids cache-backed state reconstruction so developers always receive fresh network data.

Verification Results

cargo build --workspace
✅ Build passes with the new global --no-cache flag

grat decode <hash> --no-cache
✅ Local cache lookup skipped
✅ Existing cache entries ignored
✅ Raw Soroban RPC fetch used for simulation/decoding
✅ No stale state returned
Acceptance Criteria Status
Global --no-cache flag exists on Cli
Flag threads through command parameters into decoders/network config
Decode command ignores local state cache databases
Raw RPC fetching is used for transaction simulation/decoding
Existing cache entries are not returned when --no-cache is set

Closes #421

@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@Cashman-Exchange Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f7fbdbe-9bf0-4e7f-b875-1c195860573a


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

Comment @coderabbitai help to get the list of available commands.

@codeZe-us
codeZe-us self-requested a review August 27, 2026 22:12

@codeZe-us codeZe-us left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR reviewed

@codeZe-us

Copy link
Copy Markdown
Contributor

@Cashman-Exchange resolve conficts

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.

Implement Global CLI Bypass Cache Flag

2 participants