DEV2: Implementation of multiple goroutines for concurrent flushing#15
DEV2: Implementation of multiple goroutines for concurrent flushing#15maoueh merged 35 commits intofirehose-fh3.0from
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces configurable concurrent flushing of firehose blocks via multiple goroutines, updates tests to support this new configuration, and includes benchmarking reports.
- Add
ConcurrentBlockFlushingconfig and implement worker queues for asynchronous block serialization and ordered output - Update tests to run in sequential and concurrent modes and add new concurrency-specific tests
- Include performance benchmarking report in
firehose_concurrency_2.md
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| eth/tracers/internal/tracetest/firehose/helpers_test.go | Update newFirehoseTestTracer signature to accept FirehoseConfig |
| eth/tracers/internal/tracetest/firehose/firehose_test.go | Add loops for sequential and concurrent test runs and pass new config |
| eth/tracers/firehose_concurrency_test.go | New unit tests validating concurrent flushing behavior |
| eth/tracers/firehose_concurrency_2.md | Benchmarking report for concurrent block flushing |
| eth/tracers/firehose.go | Implement core concurrency logic, added config field, worker queues, and clean shutdown |
Comments suppressed due to low confidence (2)
eth/tracers/firehose.go:154
- [nitpick] The field name
closeChannelsis ambiguous for async.Once; consider renaming it tocloseOnceor similar to better reflect its purpose.
closeChannels sync.Once
eth/tracers/internal/tracetest/firehose/firehose_test.go:43
- Tests only cover
ConcurrentBlockFlushingvalues 0 and 1; add cases with higher values (e.g., >1) to verify behavior under multiple worker goroutines.
for _, concurrent := range []int{0, 1} {
…f goroutine. All tests passing
# Conflicts: # eth/tracers/firehose.go # eth/tracers/internal/tracetest/firehose/firehose_test.go
f1ff669 to
8eb3d90
Compare
12070e8 to
b105796
Compare
|
Ready for review |
|
One last change I made which isn't showing on Github for some reasonn (Github is saying "prcessing update") |
| // if it's a network for which we must reproduce the legacy bugs. | ||
| applyBackwardCompatibility *bool | ||
| concurrentBlockFlushing bool | ||
| concurrentBlockFlushing int |
There was a problem hiding this comment.
Let's remove and use config block flushing count directly everywehre.
| } | ||
|
|
||
| type ConcurrentFlushQueue struct { | ||
| bufferSize int |
| func NewConcurrentFlushQueue(bufferSize int, printBlockFunc func(*pbeth.Block, *FinalityStatus), outputFunc func([]byte)) *ConcurrentFlushQueue { | ||
| return &ConcurrentFlushQueue{ | ||
| startSignal: make(chan uint64, 1), | ||
| jobQueue: make(chan *blockPrintJob, bufferSize), | ||
| outputQueue: make(chan *outputJob, bufferSize), |
There was a problem hiding this comment.
Buffer size should be the same as number of worker taken in start, might be good to merge Start input with this one, which would mean that we keep the bufferSize struct variable. Maybe with another name though.
Changes Introduced
Implemention of multiple goroutines for concurrent flushing
Benchmarking report
Note