erigontech / erigontech/erigon
inMemoryExecution: don't create new StagedSync for each block
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 1.5k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 463
Description
in backend.go we have function with:
`stateSync := stages2.NewInMemoryExecution`
this function called on every block
means we re-create `stagedsync.Sync` object on each block - means loosing some caches (like `D_LRU` cache which binded to `ExecuteBlockCfg.applyWorker` object)
We do this way: because `Notifications` object seems passed from outside - but i'm not sure why/where do we need it.
Need somehow simplify it and create `stagedsync.Sync` object once at startup (same as `notification` object dedicated for inMemoryExecution).
Contributor guide
Research direction
Start in backend.go at the function calling stages2.NewInMemoryExecution and trace how it is invoked for each block. Read the stagedsync.Sync construction, ExecuteBlockCfg.applyWorker, and Notifications flow to determine the startup lifetime. Done means the Sync object is created once for inMemoryExecution while preserving the required notification behavior and caches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100