erigon icon indicating copy to clipboard operation
erigon copied to clipboard

`stage_bor_heimdall` commit partial progress if external `rwtx` is nil

Open AskAlexSharov opened this issue 1 year ago • 3 comments

see example in another stages: useExternalTx := txc.Tx != nil

AskAlexSharov avatar Sep 06 '24 04:09 AskAlexSharov

Hi Sir, I want help fix this issue but have a question: In stage_exec , external rwtx is defined as from kv.chainDB. It can be nil if noCommit==false, and that's why we use useExternalTx := txc.Tx != nil. However, instageBorHeimdall,external rwtx will definitely be created as a non-nil value by db.update() if no error thrown. Is this true? if true, no need to fix this.

stevemilk avatar Sep 23 '24 06:09 stevemilk

There are several places where stages are called. Some pass external rwtx, some are not.

“integration” usually doesn’t.

kv.RwTx and kv.RwDB are 2 different objects.

AskAlexSharov avatar Sep 23 '24 10:09 AskAlexSharov

draft a pr #12097 to enable stage_bor_heimdall to commit partial progress, is this as expected?

stevemilk avatar Sep 26 '24 08:09 stevemilk