Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves evmreader reliability through several interconnected changes: WebSocket subscription retry logic with liveness detection, idempotent input handling, input count validation against on-chain state, unified fetchInputs logic replacing duplicated code, and adapter caching with staleness detection.
Changes:
- Added WebSocket liveness timeout, retry counter reset logic, and
Alive()/Ready()health checks backed byatomic.Bool - Unified
fetchInputsForEpochandfetchApplicationInputsinto a singlefetchInputsmethod with bounds filtering, duplicate detection, and input count validation - Introduced adapter caching per application address with config-change invalidation, replaced
time.Sleepin tests with deterministicflushHeaders, and moved test infrastructure to dedicated files
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/evmreader/evmreader.go | Adapter caching, liveness timer, retry logic with consecutive failure tracking |
| internal/evmreader/service.go | WS config fields, alive/ready atomics, Serve() goroutine lifecycle |
| internal/evmreader/input.go | indexInputsIntoEpochs pure function, unified fetchInputs, input count validation |
| internal/evmreader/sealedepochs.go | Use unified fetchInputs, overlap-block search fix, input count mismatch check |
| internal/evmreader/util.go | insertSorted returns duplicate flag, removed indexApps |
| internal/evmreader/output.go | Fixed copy-paste naming (inputs→outputs in comments/variables) |
| internal/repository/postgres/epoch.go | ON CONFLICT DO NOTHING for idempotent input inserts |
| internal/config/generated.go | New WS config: liveness timeout, max retries, reconnect interval |
| internal/config/generate/Config.toml | Config definitions for new WS settings |
| internal/evmreader/*_test.go | Comprehensive tests: mocks refactored, deterministic flush, new edge case/error path coverage |
| internal/evmreader/testdata/*.json | Removed embedded JSON fixtures, replaced with programmatic makeHeader/makeInputEvent |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
dc29507 to
8f38d9b
Compare
c8c4fa5 to
437642e
Compare
mpolitzer
previously approved these changes
Mar 13, 2026
437642e to
28f484f
Compare
…remove runtime type assertion
28f484f to
80d058c
Compare
80d058c to
e59b130
Compare
mpolitzer
previously approved these changes
Mar 15, 2026
The merge-base changed after approval.
mpolitzer
previously approved these changes
Mar 16, 2026
The merge-base changed after approval.
renatomaia
previously approved these changes
Mar 16, 2026
The merge-base changed after approval.
renatomaia
approved these changes
Mar 16, 2026
mpolitzer
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.