Skip to content

Conversation

@msooseth
Copy link
Collaborator

@msooseth msooseth commented Aug 26, 2025

Description

There was a bug with RPC not fetching data. The fix for this was that in case the contract is remote, check the underlying concrete storage directly to see if the value has already been fetched. If not, then fetch it. It's a relatively simple, straightforward code change.

The more complex part of this PR is that I added a test framework for creating and using mock data for RPC, so we can create and replay RPC call data for proper testing. When in --debug mode, all RPC data is written to JSON files. These can then be collated together with a python script. I used python because it's only to be used by developers, so it doesn't need to be present and exposed in nix, etc.

Fixes #757

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

Improve

I see no reason why these should fail

More explanations
@gustavo-grieco
Copy link
Collaborator

Is this affecting concrete execution as well?

@msooseth
Copy link
Collaborator Author

Is this affecting concrete execution as well?

It should not be, AFAIK. Also, I still need to refine this, some tests are failing.

@msooseth msooseth changed the title Fixing issue with RPC fetching and reading of slots Fixing RPC fetching and reading of slots, adding mocking to RPC for testing Aug 28, 2025
Update

Update

No need

Update for block too

Finally working

Update

Adding test

Update

Update

Update for debug

Update

These are expected to fail

Clean

Fixing RPC
Comment on lines +1434 to +1436
Just (Lit _) -> continue x
Just _ | not c.external -> continue x
_ -> rpcCall c slotConc
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Basically, the issue here was, that the readStorage would return a Just (SLoad...) in some cases, which is wrong -- it actually didn't find the concrete storage, and the data may not have been retrieved from RPC.

@msooseth msooseth marked this pull request as ready for review September 1, 2025 15:42
Copy link
Collaborator Author

@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.

Thanks! Yesss, I have now fixed some of these. Let me go through once more.

No need to update this test

No need for this change
@msooseth
Copy link
Collaborator Author

msooseth commented Sep 8, 2025

OK, I tried to go through one more time, and I cleaned up this PR. Should be a little easier on the eyes now :)

Copy link
Collaborator

@blishko blishko left a comment

Choose a reason for hiding this comment

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

Let's go ahead with this one!

@msooseth msooseth merged commit bd31f25 into main Sep 9, 2025
6 of 7 checks passed
@msooseth msooseth deleted the fix-value-getting branch September 9, 2025 12:53
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.

Bug in RPC analyzing interesting contract: false negative generated

4 participants