-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Context / Problem
The claimer service monitors on-chain consensus events to submit claims and track their acceptance for authority/quorum apps.
Today, it detects events using the legacy ChunkedFilterLogs approach (topic-based log filtering). Other services (e.g. evmreader) already use the newer ethutil.FindTransitions mechanism, which performs an efficient divide-and-conquer search based on monotonic counters queried via view functions.
We want to migrate the claimer’s monitoring for both claim events to FindTransitions for consistency, simpler querying, and better performance characteristics.
Monitored events:
ClaimSubmittedClaimAccepted
Proposed change
Replace ChunkedFilterLogs-based monitoring for the monitored claim events with ethutil.FindTransitions, using monotonic event counters exposed by the consensus contract.
Implementation approach (high level):
- For each monitored event, use a corresponding on-chain counter view function as the transition oracle.
- Implement a
TransitionQueryFnthat returns the counter value at a block. - Implement an
OnHitFnthat, for each detected transition block, fetches the concrete event(s) for that block/range and emits them in chronological order. - Preserve existing start/end block semantics and ordering guarantees.
Deliverables
- Migrate
ClaimSubmittedmonitoring toethutil.FindTransitions. - Migrate
ClaimAcceptedmonitoring toethutil.FindTransitions. - Ensure claimer no longer relies on
ChunkedFilterLogsfor these two monitored events. - Update claimer tests to cover the new transition-based logic for both events:
- no transitions
- single transition
- multiple transitions (including multiple events in the same block)
- boundary case at
startBlock(use ofprevValue) - error propagation from the transition oracle and from log/event fetching
Acceptance criteria (applies to both ClaimSubmitted and ClaimAccepted)
- Monitoring uses
ethutil.FindTransitions(noChunkedFilterLogsfor these events). - Given a block range containing N occurrences of the event, the claimer detects exactly those N events and processes them in chronological order.
- Correctly handles transitions exactly at
startBlock(no off-by-one;prevValueis used appropriately). - Correctly handles blocks with multiple occurrences of the same event (no missed events).
- Correctly handles empty ranges (no transitions) without errors and without producing events.
- On invalid oracle responses or RPC errors, the claimer returns a clear error (and does not silently skip ranges).
Tests:
-
make testpasses. - Claimer test suite includes coverage for both events across the scenarios listed above.
Note
getNumberOfAcceptedClaims() is already available. The equivalent submitted-claims counter (getNumberOfSubmittedClaims()) may land shortly; structure the implementation so adding/wiring the submitted-claims counter is a small change once it exists.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status