Skip to content

Conversation

@gustavo-grieco
Copy link
Collaborator

@gustavo-grieco gustavo-grieco commented Oct 8, 2025

Description

This PR contains some little changes in the RPC api and some code to serialize and deserialize the cache. This is essential for tools like Echidna, as it allows to quickly re-run a fuzzing campaign without the need to re-fetching the slots (which gives native speed execution). While there was some code to save individual slots for debugging that approach is too slow to use in a cache, which can be called hundreds of times per second.

Checklist

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

@gustavo-grieco gustavo-grieco changed the title Added rpc cache serialization code RFC: Added rpc cache serialization code Oct 13, 2025
@msooseth
Copy link
Collaborator

Ah, this looks really interesting actually, thanks! This can replace my very simple JSON writing/reading, right? If so, can we replace it entirely with this? This seems more systematic and more serious :)

@gustavo-grieco
Copy link
Collaborator Author

In theory, this new code can replace the old serialization, however, there is a catch: this serialization only happens at the startup (to restore into the cache) and when the exploration and solving already finished (to save the cache). This means that in order to debug a case, you need to wait until the end. With the current code, just enabling the debug flag you will dump the RPC responses as soon as they are requested.

@msooseth
Copy link
Collaborator

In theory, this new code can replace the old serialization, however, there is a catch: this serialization only happens at the startup (to restore into the cache) and when the exploration and solving already finished (to save the cache). This means that in order to debug a case, you need to wait until the end. With the current code, just enabling the debug flag you will dump the RPC responses as soon as they are requested.

That's actually okay! and then we could remove the RPCContract and other stuff, so we could be lean and mean :) I only wrote that code so we can replay a full, running, example. So it would be a perfect, in fact, better, replacement! Could you maybe adjust the PR to do that? It'd be awesome, because it'd be less code and actually more powerful. Would be really nice. Otherwise, I can also do this change if you like, as a PR to your PR :) Let me know what you think!

@gustavo-grieco gustavo-grieco changed the title RFC: Added rpc cache serialization code Added rpc cache serialization code Oct 19, 2025
@gustavo-grieco gustavo-grieco marked this pull request as ready for review October 19, 2025 22:08
@gustavo-grieco
Copy link
Collaborator Author

@msooseth the old code was replaced by the cache save/load. I also changed the old cli RPC test with the new one, using a cache file for the particular block used and it seems to be working.

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.

WOW nice! I just checked, and it's a LOT better than my mocking code. Thanks! I left some potential changes

Can you please add a line to the chanagelog? I'd rather have this documented, because (1) it's a big change (2) it's a nice change (3) it changes the CLI options :)

@gustavo-grieco
Copy link
Collaborator Author

@msooseth Already added the line in the changelog and addressed all the other comments.

@msooseth msooseth merged commit 0d9e274 into argotorg:main Oct 20, 2025
7 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.

3 participants