Skip to content

Capture chain exchange messages in F3 observer#1031

Merged
masih merged 1 commit into
mainfrom
masih/observe-chain-exchanges
Jun 25, 2025
Merged

Capture chain exchange messages in F3 observer#1031
masih merged 1 commit into
mainfrom
masih/observe-chain-exchanges

Conversation

@masih

@masih masih commented Jun 25, 2025

Copy link
Copy Markdown
Member

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

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
Copilot AI review requested due to automatic review settings June 25, 2025 10:38
@github-project-automation github-project-automation Bot moved this to Todo in F3 Jun 25, 2025
@masih masih moved this from Todo to In review in F3 Jun 25, 2025
@masih masih self-assigned this Jun 25, 2025
@masih masih requested a review from Kubuxu June 25, 2025 10:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_exchanges table in the SQL schema.
  • Adds options and CLI flag to configure chain exchange observation.
  • Implements in-process handling, batching, and storage of chainexchange.Message values.

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 new WithChainExchangeBufferSize option.
		&cli.DurationFlag{

observer/observer.go:773

  • The code uses sync.WaitGroup here but sync is not imported at the top of the file. Add import "sync" to avoid a compile error.
	var wg sync.WaitGroup

observer/schema.sql:98

  • The schema defines VoteValue as 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

codecov Bot commented Jun 25, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 205 lines in your changes missing coverage. Please review.

Project coverage is 65.68%. Comparing base (00ff781) to head (fa92fcf).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
observer/observer.go 0.00% 180 Missing ⚠️
observer/options.go 0.00% 16 Missing ⚠️
observer/model.go 0.00% 9 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
observer/model.go 0.00% <0.00%> (ø)
observer/options.go 6.00% <0.00%> (-0.45%) ⬇️
observer/observer.go 0.00% <0.00%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@masih masih added this pull request to the merge queue Jun 25, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jun 25, 2025
@masih masih added this pull request to the merge queue Jun 25, 2025
Merged via the queue into main with commit d13dac1 Jun 25, 2025
14 of 15 checks passed
@masih masih deleted the masih/observe-chain-exchanges branch June 25, 2025 13:17
@github-project-automation github-project-automation Bot moved this from In review to Done in F3 Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Observe chain exchange messages by observer

3 participants