reilabs / starknet-replay

CLI tool to replay Starknet transactions and profile libfuncs usage.
0 stars 0 forks source link

Storage refactoring #29

Closed Eagle941 closed 1 month ago

Eagle941 commented 1 month ago

The key of this PR is to refactor the layer which communicates with Pathfinder database to make space for switching between different nodes.

I have created a new trait ReplayStorage with functions that are needed to replay transactions.

I have also created a new struct BlockNumber which is used to convert between the block number of the various backends into the block number format used by starknet-replay.

To further detatch from using structs from pathfinder, I have amended the types used in ReplayRange and ReplayClassHash with the new internal BlockNumber.

I have replaced OrderedHashMap with HashMap in ReplayStatistics to ignore insertion order during equality operations.

Finally, to verify these changes are working, I have expanded the test suite: