EspressoSystems / espresso-sequencer

93 stars 65 forks source link

Replace `Header` "validaiton helpers" with "update helpers". #1109

Open tbro opened 6 months ago

tbro commented 6 months ago

Rework the validation helper functions in state.rs so they just update the state but don't validate it against the proposed header. The caller then can just update the state and check against the proposed header at the end. This will allow us to reuse the state update functions in Header::new, which would reduce the risk of bugs where Header::new and validate_and_apply_header are inconsistent.

tbro commented 6 months ago

Original comment this ticket was derived from: https://github.com/EspressoSystems/espresso-sequencer/pull/1064#issuecomment-1954626497