erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.14k stars 1.12k forks source link

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

Open AskAlexSharov opened 2 months ago

AskAlexSharov commented 2 months ago

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

stevemilk commented 1 month ago

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.

AskAlexSharov commented 1 month ago

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.

stevemilk commented 1 month ago

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