dusk-network / dusk-network/node-installer

Do not assume state list order in download_state

Open Beginner friendly
#188 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:conf&build fix:bug
Dominant language
Shell
Stars
38
Forks
17
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the download_state entry point and trace how the published state list is read and how the default selection reaches confirmation. Exercise it with an unsorted list, including higher states before lower ones. Done means the highest numerical state is selected when no state number is supplied and the selected state is printed before confirmation.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.