Closed as duplicate of#2274
Description
Currently ApplyBlock
, SaveBlock
, Commit
, SaveBlockResponses
and SetHeight
are executed as completely separate operations - this potentially leads to inconsistencies in database.
https://github.com/celestiaorg/optimint/blob/b1df4346508c124d59504555f34210773a4e5b50/block/manager.go#L216-L247
https://github.com/celestiaorg/optimint/blob/b1df4346508c124d59504555f34210773a4e5b50/block/manager.go#L392-L433
Ideally all those operations should use single KV batch to ensure atomicity.