dymension
dymension copied to clipboard
Change finalization logic to calculate finalization from the end and not the beginning
Currently the state finalization logic determines the finalization at the time the state update arrives. This creates a problematic situation as if the finalization period will change (i.e decrease), some state updates which were sent earlier may be finalized only after state updates which were sent later.
We need to calculate the finalized of state updates based on the current height (i.e get all states updates where their height <= current_height - finalization_blocks)