Skip to content

Commit de3a623

Browse files
fix: fix memory leak by clearing verified map after new block (#154)
fix: fix memory leak by clearing verified map after new block (#153) release verified map after new block Co-authored-by: FletcherMan <[email protected]>
1 parent bfaac8b commit de3a623

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

eth/catalyst/l2_api.go

+6
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@ func (api *l2ConsensusAPI) NewL2Block(params ExecutableL2Data, batchHash *common
222222
return err
223223
}
224224

225+
defer func() {
226+
if err == nil {
227+
api.verified = make(map[common.Hash]executionResult) // clear cached pending block
228+
}
229+
}()
230+
225231
bas, verified := api.isVerified(block.Hash())
226232
if verified {
227233
api.eth.BlockChain().UpdateBlockProcessMetrics(bas.state, bas.procTime)

0 commit comments

Comments
 (0)