cyphersnake / solana-events-parser

Provides various utilities for working with Solana blockchain transactions and events
MIT License
27 stars 4 forks source link

feat: improve rollback mechanism #4

Closed cyphersnake closed 1 year ago

cyphersnake commented 1 year ago

This commit refactors the event_reader_service.rs file by introducing a new Rollback enum and modifying the resync_rollback field in the EventsReader struct to use this enum. The Rollback enum is used to specify different types of rollbacks, including None, Beginning, and Signature. The res ync_rollback field is now of type Arc<RwLock<Rollback>>.

Additionally, a new method reset_last_resynced_transaction is added to the ResyncedTransactionsPtrStorage trait and implemented for the rocksdb module . This method allows resetting the last resynced transaction for a specific program ID.

These changes improve the clarity and maintainability of the codebase.