Skip to content

fix(metrics): attribute simulation fetches - #1502

Merged
GabrielePicco merged 2 commits into
thlorenz/rate-limitfrom
thlorenz/rate-limit+simulate-origin
Jul 30, 2026
Merged

fix(metrics): attribute simulation fetches#1502
GabrielePicco merged 2 commits into
thlorenz/rate-limitfrom
thlorenz/rate-limit+simulate-origin

Conversation

@thlorenz

@thlorenz thlorenz commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Attribute account fetches needed to simulate a transaction to a dedicated simulate_transaction metrics entrypoint rather than send_transaction.

Details

Simulation account ensuring now preserves its own request origin through the existing account-fetch context. This separates simulation-driven fetch, clone, pending-work, and companion-fetch observability from submitted transactions without changing transaction preparation, account ordering, primary-mode checks, replay handling, or simulation responses.

The new entrypoint is a static, bounded Prometheus label value. Transaction signatures remain tracing-only and are not labels.

Example PromQL for simulation-owned fetch activity over five minutes:

sum by (layer, outcome) (
  increase(chainlink_pending_fetch_accounts_total{
    entrypoint="simulate_transaction",
    fetch_reason="requested_account"
  }[5m])
)

The change adds metrics-level coverage and Aperture simulation tests to verify the new attribution while retaining existing send-transaction behavior.

Summary by CodeRabbit

  • Bug Fixes
    • Improved simulateTransaction account and ledger fetching by using the correct request context.
    • Simulation requests now report accurate fetch metrics and remote-account claim counts.
    • Added clearer tracking of simulated transaction activity in monitoring data.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 21cb6c0b-a35b-4254-ba51-7c4d89134ae7

📥 Commits

Reviewing files that changed from the base of the PR and between 2ac3bea and 4ce35f0.

📒 Files selected for processing (4)
  • magicblock-aperture/src/requests/http/mod.rs
  • magicblock-aperture/src/requests/http/simulate_transaction.rs
  • magicblock-metrics/src/metrics/mod.rs
  • magicblock-metrics/src/metrics/types.rs

📝 Walkthrough

Walkthrough

Adds a SimulateTransaction account-fetch entrypoint and context constructor, including signature access, remote-account claim counting, labels, and tests. Updates HTTP simulation handling to use the simulation-specific context and extends metric tests for its labels.

Suggested reviewers: gabrielepicco, taco-paco

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch thlorenz/rate-limit+simulate-origin

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.

@GabrielePicco
GabrielePicco marked this pull request as ready for review July 30, 2026 10:55
@GabrielePicco
GabrielePicco force-pushed the thlorenz/rate-limit+simulate-origin branch from 2ac3bea to 24acbd6 Compare July 30, 2026 10:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ac3bea2f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread magicblock-metrics/src/metrics/types.rs
@GabrielePicco
GabrielePicco force-pushed the thlorenz/rate-limit+simulate-origin branch from 24acbd6 to 4ce35f0 Compare July 30, 2026 12:57
@GabrielePicco
GabrielePicco merged commit 1d9aa3e into master Jul 30, 2026
36 checks passed
@GabrielePicco
GabrielePicco deleted the thlorenz/rate-limit+simulate-origin branch July 30, 2026 13:14
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