Skip to content

Conversation

@blishko
Copy link
Collaborator

@blishko blishko commented Oct 30, 2025

Description

In processing query to fetch a slot, the current code checks the cache twice.
First directly in the handler code, secondly in function fetchSlotFrom.
Since this function is not used anywhere else, we inline it and eliminate one unnecessary cache check.

We also remove debug printing that is now actually unreachable.

Given how withSession is written, the small addresses are going to be
handled before we ever reach this point in the code.
In processing query to fetch a slot, the current code checks the cache
twice.
First directly in the handler code, secondly in function
`fetchSlotFrom`.
Since this function is not used anywhere else, we inline it and
eliminate one unnecessary cache check.
@blishko blishko requested a review from msooseth October 30, 2025 13:16
Copy link
Collaborator

@msooseth msooseth left a comment

Choose a reason for hiding this comment

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

LGTM. Those warnings are reachable, but we probably shouldn't warn about them.

@blishko
Copy link
Collaborator Author

blishko commented Oct 30, 2025

I am pretty sure they are unreachable now.
If addr <= 17, then withSession is going to hit this case: a | a <= 0xdeadbeef -> pure def
And it will just proceed immediately with continue (with empty contract/zero value). It never enters the lambda where the debug prints are located.

@msooseth msooseth merged commit 81a50a6 into main Oct 30, 2025
7 checks passed
@msooseth msooseth deleted the rpc-refactor branch October 30, 2025 14:35
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.

3 participants