Skip to content

core/txpool/legacypool: fix data race of pricedList access #31758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2025

Conversation

mirokuratczyk
Copy link
Contributor

I believe this was missed in #31641 where fixing one data race created another. Should only apply to the simulated backend.

go-ethereum v1.15.10

The race detector flagged this in some automated tests I run against the simulated backend.

==================
WARNING: DATA RACE
Write at 0x00c00177bba8 by goroutine 36573:
  github.com/ethereum/go-ethereum/core/txpool/legacypool.(*LegacyPool).Clear()
      /home/repo/vendor/github.com/ethereum/go-ethereum/core/txpool/legacypool/legacypool.go:1937 +0x44d
  github.com/ethereum/go-ethereum/core/txpool.(*TxPool).Clear()
      /home/repo/vendor/github.com/ethereum/go-ethereum/core/txpool/txpool.go:508 +0x1af
  github.com/ethereum/go-ethereum/eth/catalyst.(*SimulatedBeacon).Rollback()
      /home/repo/vendor/github.com/ethereum/go-ethereum/eth/catalyst/simulated_beacon.go:320 +0xed5
  github.com/ethereum/go-ethereum/ethclient/simulated.(*Backend).Rollback()
      /home/repo/vendor/github.com/ethereum/go-ethereum/ethclient/simulated/backend.go:164 +0xe0b
  ...

Previous read at 0x00c00177bba8 by goroutine 36536:
  github.com/ethereum/go-ethereum/core/txpool/legacypool.(*LegacyPool).loop()
      /home/repo/vendor/github.com/ethereum/go-ethereum/core/txpool/legacypool/legacypool.go:363 +0x93b
  github.com/ethereum/go-ethereum/core/txpool/legacypool.(*LegacyPool).Init.gowrap2()
      /home/repo/vendor/github.com/ethereum/go-ethereum/core/txpool/legacypool/legacypool.go:330 +0x33
  ...
==================

Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

Thank you!

@rjl493456442 rjl493456442 added this to the 1.15.11 milestone May 4, 2025
@rjl493456442 rjl493456442 merged commit 2d86a54 into ethereum:master May 4, 2025
3 of 4 checks passed
@mirokuratczyk mirokuratczyk deleted the simulated_backend_fix branch May 4, 2025 13:14
0g-wh pushed a commit to 0g-wh/0g-geth that referenced this pull request May 8, 2025
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.

2 participants