RPCv1 XDR views: migrate getEvents - #978
Merged
Merged
Conversation
cjonas9
force-pushed
the
migrate-getEvents-views
branch
from
September 8, 2026 17:50
fbb8fc8 to
8e36958
Compare
cjonas9
force-pushed
the
migrate-getEvents-views
branch
from
September 8, 2026 19:51
8e36958 to
a9530b3
Compare
cjonas9
force-pushed
the
migrate-getEvents-views
branch
from
September 8, 2026 19:57
a9530b3 to
1b33011
Compare
This was referenced Sep 8, 2026
cjonas9
force-pushed
the
migrate-getEvents-views
branch
from
September 8, 2026 22:18
1b33011 to
c1300ff
Compare
cjonas9
force-pushed
the
migrate-getEvents-views
branch
2 times, most recently
from
September 11, 2026 07:27
334d228 to
12499f9
Compare
cjonas9
force-pushed
the
migrate-getEvents-views
branch
from
September 11, 2026 17:40
12499f9 to
2368950
Compare
cjonas9
marked this pull request as ready for review
September 11, 2026 17:53
There was a problem hiding this comment.
Pull request overview
Migrates RPCv1 event filtering and response generation to zero-copy XDR views while sharing matching logic with RPCv2.
Changes:
- Adds shared view-based event filter compilation and matching.
- Updates SQLite scanning and RPC response construction to use XDR views.
- Updates RPCv2 integration, tests, and SQLite dependency.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
go.mod |
Updates SQLite dependency. |
go.sum |
Updates SQLite checksums. |
internal/store/event.go |
Defines view-based scanner API. |
internal/store/event_match.go |
Adds shared event matching logic. |
rpcv2/stores/event/match.go |
Reuses shared matcher types and functions. |
rpcv2/stores/event/match_test.go |
Updates matcher tests. |
rpcv2/stores/event/extract_test.go |
Adapts extraction tests to views. |
rpcv2/eventsapi/get_events_v2.go |
Builds responses from event views. |
rpcv2/eventsapi/get_events_v1.go |
Delegates shared filtering and conversion. |
rpcv1/sqlitedb/migration_test.go |
Updates scanner callback signature. |
rpcv1/sqlitedb/event.go |
Scans stored events as views. |
rpcv1/sqlitedb/event_test.go |
Updates view-based scanner tests. |
methods/get_events.go |
Uses shared filters and view-based responses. |
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cjonas9
force-pushed
the
migrate-getEvents-views
branch
from
September 11, 2026 20:07
2368950 to
fa7cc42
Compare
cjonas9
force-pushed
the
migrate-getEvents-views
branch
from
September 11, 2026 20:09
fa7cc42 to
da49b8a
Compare
cjonas9
force-pushed
the
migrate-getEvents-views
branch
from
September 16, 2026 04:37
e424d09 to
d7630df
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The hot response path lost its page-size preallocation and now repeatedly reallocates and copies results.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 1
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
tamirms
added a commit
that referenced
this pull request
Sep 18, 2026
#978 changed the v1 event reader's callback to store.ViewScanFunction, which hands the fixture a DiagnosticEventView valid only for the call. The fixture takes the event's raw XDR from the view and copies it out. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What
Moves RPCv1
getEventsonto XDR views. The filter loop and the response renderer both paid forUnmarshals of every scannedxdr.DiagnosticEvent; now nothing in the query path decodes an event.Handler-local matcher (
methods/event_filter.go): a view port of the SDK'sGetEventsRequest.Matches. Filters compile once per request into wire-form comparison values (decoded contract ids, marshaled topic segments, a trailing**as an arity flag) and match against the raw bytes the view hands back. rpcv2'sstores/eventand itsv1Filtersshim are untouched.RPCv1 query path:
store.ScanFunction->store.ViewScanFunction: takesxdr.DiagnosticEventView, returns(bool, error).sqlitedb.GetEventsreads rows assql.RawBytesand wraps them as views; scanner errors abort the scan.methods/get_events.golocates each event's fields once viaFields(), matches, and renders matches inside the scan callback. Topics are read only after type and contract id pass. The callback's own error is captured and returned unchanged, as getTransactions does, so a render failure keeps its system error code.Shared renderer:
methods.EventInfoFromViewreplaces botheventInfoForEventand the rpcv2eventInfoV2body.ev.Fields()andv0.Fields()locate type, contract id, topics and data in one pass each and return trimmed views, so their bytes are used directly with noRaw()re-walks. The type name comes from a switch instead of the SDK's per-call map. rpcv2 wraps it and rejects non contract/system types on the returned name. Wire output is byte-identical.Why
See epic #732.
🤖 Generated with Claude Code