Skip to content

Conversation

@lucca30
Copy link
Contributor

@lucca30 lucca30 commented Feb 27, 2025

Description

While syncing a node using the develop branch we found the following fatal error:

fatal error: concurrent map writes
goroutine 81880 [running]:
github.com/ethereum/go-ethereum/core/state.(*trieReader).Account(0xc063173ce0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
        /home/krishangshah/bor/core/state/reader.go:185 +0xac
github.com/ethereum/go-ethereum/core/state.(*multiReader).Account(0x0?, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
        /home/krishangshah/bor/core/state/reader.go:279 +0x96
github.com/ethereum/go-ethereum/core/state.(*StateDB).getStateObject.func1(0xc031573340)
        /home/krishangshah/bor/core/state/statedb.go:976 +0xd7
github.com/ethereum/go-ethereum/core/state.MVRead[...](0xc031573340?, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...)
        /home/krishangshah/bor/core/state/statedb.go:313 +0x4ea
github.com/ethereum/go-ethereum/core/state.(*StateDB).getStateObject(0xc031573340, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
        /home/krishangshah/bor/core/state/statedb.go:964 +0x1c9
github.com/ethereum/go-ethereum/core/state.(*StateDB).GetBalance.func1(0x26e9f40?)
        /home/krishangshah/bor/core/state/statedb.go:636 +0x25
github.com/ethereum/go-ethereum/core/state.MVRead[...](0xc031573340?, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...)
        /home/krishangshah/bor/core/state/statedb.go:313 +0x4ea
github.com/ethereum/go-ethereum/core/state.(*StateDB).GetBalance(0xc031573340, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
        /home/krishangshah/bor/core/state/statedb.go:635 +0x1cf
github.com/ethereum/go-ethereum/core/state.(*StateDB).ApplyMVWriteSet(0xc04256c540, {0xc06dbde008, 0x5e, 0xc04256c540?})
        /home/krishangshah/bor/core/state/statedb.go:420 +0x29a
github.com/ethereum/go-ethereum/core.(*ExecutionTask).Settle(0xc061d01688)
        /home/krishangshah/bor/core/parallel_state_processor.go:184 +0x305
github.com/ethereum/go-ethereum/core/blockstm.(*ParallelExecutor).Prepare.func2()
        /home/krishangshah/bor/core/blockstm/executor.go:383 +0x3c
created by github.com/ethereum/go-ethereum/core/blockstm.(*ParallelExecutor).Prepare in goroutine 80488
        /home/krishangshah/bor/core/blockstm/executor.go:381 +0x3c7
goroutine 1 [chan receive]:

It happened due to geth's PR-2971, that came with upstream merge v1.14.10. In this PR it created the trieReader struct which has some maps to store some data. The problem was on these maps that were not prepared to our parallel nature on BlockSTM.

https://github.com/rjl493456442/go-ethereum/blob/6d79e5ace6ef8b5a6f68b760cbd7acabb919e300/core/state/reader.go#L139-L148

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on mumbai/amoy
  • I have created new e2e tests into express-cli

@lucca30 lucca30 requested review from a team and manav2401 February 27, 2025 11:21
@lucca30 lucca30 added the bug Something isn't working label Feb 27, 2025
@lucca30 lucca30 merged commit 08f81df into develop Feb 28, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants