Capture chain exchange messages in F3 observer#1031
Merged
Conversation
Add the ability to capture chain exchange messages via F3 observer and make them queryable via SQL statement. The captured chain exchange messages offers a mapping of EC chain key to the concrete EC chain value itself, since partial GMessages only contain the EC chain key and not the chain itself. Fixes #970
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for capturing and persisting chain exchange messages in the F3 observer pipeline so they can be queried via SQL.
- Introduces a new
chain_exchangestable in the SQL schema. - Adds options and CLI flag to configure chain exchange observation.
- Implements in-process handling, batching, and storage of
chainexchange.Messagevalues.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| observer/schema.sql | Added chain_exchanges table for persisting chain exchange data |
| observer/options.go | Added chainExchangeBufferSize and chainExchangeMaxMessageAge options |
| observer/observer.go | Implemented observeChainExchanges, storage logic, and pubsub validator |
| observer/model.go | Defined ChainExchange model and constructor |
| cmd/f3/observer.go | Exposed chainExchangeMaxMessageAge flag to the CLI |
Comments suppressed due to low confidence (3)
cmd/f3/observer.go:128
- [nitpick] Consider adding a corresponding CLI flag (e.g.
--chainExchangeBufferSize) to allow users to configure the buffer size for chain exchange messages, matching the newWithChainExchangeBufferSizeoption.
&cli.DurationFlag{
observer/observer.go:773
- The code uses
sync.WaitGrouphere butsyncis not imported at the top of the file. Addimport "sync"to avoid a compile error.
var wg sync.WaitGroup
observer/schema.sql:98
- The schema defines
VoteValueas a STRUCT array, but the insertion uses a JSON cast (?::json). Either change the column to JSON/JSONB or adjust the insert to match the STRUCT type.
VoteValue STRUCT(
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1031 +/- ##
==========================================
- Coverage 66.91% 65.68% -1.24%
==========================================
Files 80 80
Lines 9510 9706 +196
==========================================
+ Hits 6364 6375 +11
- Misses 2652 2838 +186
+ Partials 494 493 -1
🚀 New features to boost your workflow:
|
Kubuxu
approved these changes
Jun 25, 2025
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.
Add the ability to capture chain exchange messages via F3 observer and make them queryable via SQL statement.
The captured chain exchange messages offers a mapping of EC chain key to the concrete EC chain value itself, since partial GMessages only contain the EC chain key and not the chain itself.
Fixes #970