Skip to content

fix: avoid concurrent map writes in ProcessResult#60

Open
mmsqe wants to merge 2 commits intoskip-mev:mainfrom
mmsqe:fix_process
Open

fix: avoid concurrent map writes in ProcessResult#60
mmsqe wants to merge 2 commits intoskip-mev:mainfrom
mmsqe:fix_process

Conversation

@mmsqe
Copy link

@mmsqe mmsqe commented Mar 11, 2026

loadtest sometimes fails due to fatal error: concurrent map writes from ProcessResult


Note

Medium Risk
Touches concurrent metrics collection logic and adds synchronization/closure fixes; low functional surface area but mistakes could still skew load test results or reintroduce data races under high concurrency.

Overview
Prevents fatal error: concurrent map writes in ProcessResults by guarding shared receipts map writes with a mutex and by passing per-iteration values (blockNum, precomputed index) into goroutines to avoid loop-variable capture issues.

Fixes a similar goroutine capture bug in concurrent receipt fetching (getReceiptsForBlockTxs) and adds a stress-style test (TestProcessResultsConcurrent) using a simulated Ethereum backend to exercise concurrent receipt collection repeatedly. Updates module deps to include golang.org/x/sync directly and refreshes indirect dependency versions.

Written by Cursor Bugbot for commit 9cb4279. This will update automatically on new commits. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant