Closed dwasse closed 2 weeks ago
The recent modifications implement enhanced concurrency control to prevent race conditions during state transitions in the chainindexer.go
and statushandler.go
files. The changes involve introducing mutex locks for transaction IDs to ensure thread-safe handling of events and state transitions. This update aims to improve the robustness and reliability of the system when processing simultaneous operations.
Files | Change Summary |
---|---|
services/rfq/relayer/service/chainindexer.go | Added an import for hexutil from the github.com/ethereum/go-ethereum/common package and implemented a blocking lock on the transaction ID mutex in the runChainIndexer function. |
services/rfq/relayer/service/statushandler.go | Added an import for mapmutex from github.com/synapsecns/sanguine/core/mapmutex , introduced a relayMtx field in QuoteRequestHandler , and added lock-checking logic in the Forward method. |
sequenceDiagram
participant Client
participant QuoteRequestHandler
participant ChainIndexer
Client->>QuoteRequestHandler: Send Transaction Request
QuoteRequestHandler->>QuoteRequestHandler: Check if lock acquired
alt Lock acquired
QuoteRequestHandler->>Client: Reject request
else No Lock
QuoteRequestHandler->>ChainIndexer: Forward request
ChainIndexer->>ChainIndexer: Acquire Mutex Lock
ChainIndexer->>ChainIndexer: Process transaction events
ChainIndexer->>ChainIndexer: Release Mutex Lock
ChainIndexer->>QuoteRequestHandler: Acknowledge receipt
QuoteRequestHandler->>Client: Confirm transaction
end
In the code where bytes align,
Mutexes guard, transactions refine.
Locks acquired, no state to clash,
Concurrency tamed in a hash.
Chainindexer's new stride,
Safe states now abide. 🌟
Hippity hop, no race ignored,
In Rabbit's realm, errors floored!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 0%
with 16 lines
in your changes missing coverage. Please review.
Project coverage is 25.70202%. Comparing base (
99ec69f
) to head (777f4c8
).
Files | Patch % | Lines |
---|---|---|
services/rfq/relayer/service/chainindexer.go | 0.00000% | 10 Missing :warning: |
services/rfq/relayer/service/statushandler.go | 0.00000% | 6 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Latest commit: |
777f4c8
|
Status: | ✅ Deploy successful! |
Preview URL: | https://c70538c6.sanguine-fe.pages.dev |
Branch Preview URL: | https://feat-rfq-listener-mux.sanguine-fe.pages.dev |
Summary by CodeRabbit
Bug Fixes
Improvements