Skip to content

fix(provider): historical provider doesn't respect pinned block number#360

Merged
kariy merged 1 commit intomainfrom
fix/fork-historical-provider
Nov 13, 2025
Merged

fix(provider): historical provider doesn't respect pinned block number#360
kariy merged 1 commit intomainfrom
fix/fork-historical-provider

Conversation

@kariy
Copy link
Member

@kariy kariy commented Nov 13, 2025

The fork version of the HistoricalStateProvider should falls back to requesting data from the forked network ONLY when the pinned block number (i.e., the block number the HistoricalStateProvider is created for - the block_id given to <ForkedProvider as StateFactoryProvider>::historical) is less than or equal to the block number which katana is forked at.

Currently, HistoricalStateProvider would immediately falls back to the forked network. The request is then handled by the Backend and Backend is pinned to the forked block number and not the block number the state provider is for.

@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

❌ Patch coverage is 89.50276% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.76%. Comparing base (9bde0ae) to head (9124af2).
⚠️ Report is 184 commits behind head on main.

Files with missing lines Patch % Lines
...rage/provider/provider/src/providers/fork/state.rs 76.11% 16 Missing ⚠️
...torage/provider/provider/src/providers/fork/mod.rs 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #360      +/-   ##
==========================================
+ Coverage   73.32%   73.76%   +0.44%     
==========================================
  Files         209      256      +47     
  Lines       23132    31418    +8286     
==========================================
+ Hits        16961    23177    +6216     
- Misses       6171     8241    +2070     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kariy kariy merged commit 49cd84d into main Nov 13, 2025
11 checks passed
@kariy kariy deleted the fix/fork-historical-provider branch November 13, 2025 18:16
chudkowsky pushed a commit that referenced this pull request Nov 18, 2025
#360)

The fork version of the `HistoricalStateProvider` should falls back to requesting data from the forked network ONLY when the pinned block number (i.e., the block number the `HistoricalStateProvider` is created for - the `block_id` given to `<ForkedProvider as
StateFactoryProvider>::historical`) is less than or equal to the block number which katana is forked at.

Currently, `HistoricalStateProvider` would immediately falls back to the forked network. The request is then handled by the `Backend` and `Backend` is pinned to the forked block number and not the block number the state provider is for.
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.

1 participant