Skip to content

perf: cache reward normalization RPC lookups - #10

Merged
eflipper13 merged 2 commits into
mainfrom
g27-reward-rpc-cache
Nov 18, 2026
Merged

eflipper13 merged 2 commits into
mainfrom
g27-reward-rpc-cache

Conversation

@eflipper13

Copy link
Copy Markdown
Owner

Purpose

Reduce duplicate read-only RPC lookups during one coinstake reward-normalization operation for G27/R2.

Changes

  • Added block-scoped prevout caching by TXID, VOUT, and verified block-context hash.
  • Added normalization-scoped address caching for explicit and unambiguous getaddressinfo results.
  • Cache lifetime is limited to a single normalize_reward_transaction() call.
  • Added focused synthetic tests for duplicate and unique references, cache isolation, and historical prevout fallback.
  • Documented cache scope and synthetic before/after RPC counts.

Synthetic benchmark

Metric Before After
gettxout 2 1
getaddressinfo 4 1
getrawtransaction 0 0
Total 6 2

Verification

  • Direct execution of fixture-free test_reward_adapter.py: 10 passed
  • Direct execution of fixture-free test_prevout_resolver.py: 6 passed
  • git diff --check: PASS
  • Tracked artifact policy: PASS
  • No pytest environment was available locally; repository CI will run the full configured workflow.

Safety

No RPC allowlist, reward attribution, maturity, reorganization, SQLite, CLI, dashboard, or deployment behavior was changed. No production resources or private files were accessed.

This PR is for human review and remains unmerged.

Copilot AI added 2 commits November 18, 2026 20:18
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@eflipper13
eflipper13 merged commit 982f83b into main Nov 18, 2026
2 checks passed
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