refactor(runtime): hardcode accounts_lt_hash #1600
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
because this can no longer return a null LtHash we should update the return type
A related cleanup we should consider, whether it's in this PR or a followup one, is tightening SlotState.accounts_lt_hash from Mux(?LtHash) to Mux(LtHash). With hashSlot always producing a real value, every production initializer of this field is provably non-null: SlotState.GENESIS uses .IDENTITY; fromBankFields is fed manifest.bank_extra.accounts_lt_hash, which is typed non-optional in ExtraFields and whose bincode reader either returns a real hash, defaults to .IDENTITY on EOF, or fails with error.DeltaLtNotPresent; and fromFrozenParent inherits the parent's value. The only remaining null is in one test call at src/consensus/progress_map.zig:1255, and the sole reader (src/replay/service.zig:710) already unwraps with .?. So this should reduce to: changing the field type and the lt_hash: ?LtHash parameter on the two fromBankFields* constructors, swapping that one test to .IDENTITY, and dropping the .? in service.zig.
also worth noting that the sibling field SlotConstants.parent_lt_hash (and HashSlotParams.parent_lt_hash) must stay ?LtHash, fromBankFields legitimately sets it to null for the snapshot-loaded root slot, which is short-circuited by the already-frozen check in freezeSlot before hashSlot runs, which is the invariant error.UnknownParentLtHash exists to protect
unrelated to this PR, but same as above
because of the changes mentioned below, this would no longer be null nor would it need a null check
Requested changes.
I think we have nothing to change here
Approved these changes.
Approved these changes.
yewman
hamza-syndica
Hardcode
accounts_lt_hashfeature (SIMD-0215) - confirmed hardcoded in both:Closes #1585