Revolutionizing Event Monitoring: New System Unveiled to Capture Every Block Moment!
Dive Into the Future of Blockchain with Enhanced Oversight on Event Streams and Missed Events Detection.
Commit Details:
feat: set up monitoring for event stream based on snapchain block numbers (#2607) ## Why is this change needed? Detect when there are missed events using the `BlockConfirmed` event. ## Merge Checklist _Choose all relevant options below by adding an `x` now or at any time before submitting for review_ - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [x] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets) - [x] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [ ] PR includes [documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs) if necessary. <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the event stream monitoring capabilities by introducing new types and methods to track block events, including event counts by type, and updating the related structures across multiple packages. ### Detailed summary - Introduced `eventCountsByType` in `BlockConfirmedBody`. - Added `BlockConfirmedBody_EventCountsByTypeEntry` interface. - Modified `createBaseBlockConfirmedBody` to initialize `eventCountsByType`. - Updated serialization and deserialization logic for `BlockConfirmedBody` to handle `eventCountsByType`. - Created `EventStreamMonitor` class to manage event counts and monitor block events. - Integrated `EventStreamMonitor` into `HubEventStreamConsumer`. - Enhanced error handling and logging for missed events and old events in the event stream. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->