You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: improve p2p sensor transaction writing consistency
- Change handleNewPooledTransactionHashes condition from || to && so
transactions are requested when either --write-txs or --write-tx-events
is enabled (previously required both)
- Preserve earliest TimeFirstSeen for transactions by checking existing
records before writing, matching block behavior
- Skip writing transactions that already exist with earlier timestamp
- Add --write-first-tx-event flag for write-first-event-only behavior
- Add SensorFirstSeen field to DatastoreTransaction for sensor attribution
* feat: add worker pool for transaction writes and cache-first deduplication
- Add fixed worker pool (default 100 workers) for transaction and
transaction event writes using unbounded linked list queue
- Check transaction cache before writing to deduplicate across peers
- Add Close() method to Database interface for graceful shutdown
- Add --write-workers flag to configure worker count
- Keep semaphore pattern for block writes (lower volume)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: revert to semaphore pattern for transaction writes
Remove the worker pool implementation and revert to the original semaphore
pattern for database writes. The cache-first transaction deduplication
(added in previous commit) should significantly reduce write volume,
making the simpler semaphore pattern sufficient.
Changes:
- Remove worker pool types, queue, and worker goroutines from datastore.go
- Remove WriteWorkers from DatastoreOptions
- Remove --write-workers flag from sensor command
- Keep using runAsync() semaphore pattern for all database writes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: go fmt
* fix: reduce indexes
* refactor: remove unused Close() method from Database interface
The Close() method was added for the worker pool implementation but is
no longer needed after reverting to the semaphore pattern. With the
semaphore pattern, in-flight goroutines complete on their own without
needing explicit shutdown coordination.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: extract processTransactions helper to reduce duplication
- Extract common transaction processing logic into processTransactions()
- Consolidates duplicate code from handleTransactions and handlePooledTransactions
- Remove orphaned comment about Close() method
- Remove duplicate WriteTransactions comment
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments