Summary
download_state uses the last line of the published state list as the latest state.
The state list is not guaranteed to be sorted by block height. During the recent mainnet recovery, the list contained higher states before lower states, causing the default download_state flow to select a state that was not actually the latest published state.
Possible solution design or implementation
When no state number is provided, parse the state list numerically and select the highest available state instead of using tail -n 1.
The script should also print which state was selected before asking for confirmation.
Summary
download_stateuses the last line of the published state list as the latest state.The state list is not guaranteed to be sorted by block height. During the recent mainnet recovery, the list contained higher states before lower states, causing the default
download_stateflow to select a state that was not actually the latest published state.Possible solution design or implementation
When no state number is provided, parse the state list numerically and select the highest available state instead of using
tail -n 1.The script should also print which state was selected before asking for confirmation.