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:
Added integration test test_replay_blocks which runs the replayer on a single transaction. Test marked as ignore because it requires having the full Pathfinder database on the local hard drive.
Added unit test test_equality_replay_statistics to verify ReplayStatistics equality has been derived correctly.
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 bystarknet-replay
.To further detatch from using structs from
pathfinder
, I have amended the types used inReplayRange
andReplayClassHash
with the new internalBlockNumber
.I have replaced
OrderedHashMap
withHashMap
inReplayStatistics
to ignore insertion order during equality operations.Finally, to verify these changes are working, I have expanded the test suite:
test_replay_blocks
which runs the replayer on a single transaction. Test marked asignore
because it requires having the full Pathfinder database on the local hard drive.test_equality_replay_statistics
to verifyReplayStatistics
equality has been derived correctly.