-
Notifications
You must be signed in to change notification settings - Fork 71
Fixing RPC fetching and reading of slots, adding mocking to RPC for testing #837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bfa060b to
0890216
Compare
Improve I see no reason why these should fail More explanations
6de8cd6 to
783d6de
Compare
|
Is this affecting concrete execution as well? |
It should not be, AFAIK. Also, I still need to refine this, some tests are failing. |
f311356 to
228e151
Compare
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
25fa9c5 to
a942706
Compare
7b39444 to
b535bbb
Compare
| Just (Lit _) -> continue x | ||
| Just _ | not c.external -> continue x | ||
| _ -> rpcCall c slotConc |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this 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.
Co-authored-by: blishko <[email protected]>
cf69009 to
a12c044
Compare
No need to update this test No need for this change
a12c044 to
6b775ed
Compare
|
OK, I tried to go through one more time, and I cleaned up this PR. Should be a little easier on the eyes now :) |
blishko
left a comment
There was a problem hiding this 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!
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
--debugmode, 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