lastSelectedRound in /redistributionstate API is misleading for unstaked nodes
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start with pkg/storageincentives/agent.go around the IsPlaying() check and SetLastSelectedRound, then inspect openapi/SwarmCommon.yaml for the four round-tracking fields. Determine whether the API should describe participation or track neighborhood selection separately, and check whether the contract exposes that distinction. Done means the field behavior or naming is accurate and the OpenAPI fields explain their meanings and population conditions.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The lastSelectedRound field in the /redistributionstate API endpoint is misleading. It implies "the last round in which the node's neighborhood was selected," but it actually means "the last round in which the node was both selected AND staked." For unstaked nodes, this field is always 0 regardless of whether their neighborhood was selected.
Problem
The field is set in pkg/storageincentives/agent.go at line 410, after the IsPlaying() check at line 401:
isPlaying, err := a.contract.IsPlaying(ctx, committedDepth)
if !isPlaying {
return false, nil // exits before SetLastSelectedRound
}
a.state.SetLastSelectedRound(round + 1) // only reached if staked + selected
IsPlaying() calls the smart contract's isParticipatingInUpcomingRound, which bundles neighborhood selection and stake verification into a single boolean. When a node is not staked, IsPlaying returns false and SetLastSelectedRound is never called.
This means an unstaked operator seeing lastSelectedRound: 0 cannot distinguish between:
- "My neighborhood was never selected" (bad location)
- "My neighborhood was selected but I'm not staked" (worth staking)
This could lead operators to incorrectly conclude their neighborhood is inactive.
Additionally
None of the four round-tracking fields (lastWonRound, lastPlayedRound, lastFrozenRound, lastSelectedRound) have any description in the OpenAPI spec (openapi/SwarmCommon.yaml). They are listed only as type: integer with no explanation of their meaning or the conditions under which they are populated.
Suggested Fix
Either:
- Rename
lastSelectedRoundtolastParticipatingRoundorlastEligibleRoundto accurately reflect that it requires both selection and stake. - Or add a separate field (e.g.,
lastNeighborhoodSelectedRound) that tracks neighborhood selection independently of stake status, if the contract supports it. - Add descriptions to all four fields in the OpenAPI spec explaining what each field means and when it gets populated.
- Lingua principale
- Go
- Stelle
- 1.5k
- Fork
- 390
- Merge medio
- 2g 23h
- PR unite (30g)
- 24
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ethersphere/bee
-
Chequebook deployment uses a fixed 175,000 gas limit; it needs about 630,000 under Glamsterdam (live on Sepolia since 2026-10-06)Forse già presa @sbackend123 l’ha presa 17 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
ethersphere/bee#5650 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
ethersphere/bee#5666 ·
I maintainer di solito rispondono entro 2 giorni
-
Add a transaction inbox for outbound chain transactionsForse già presa @sbackend123 l’ha presa 11 giorni fa. Apertaseen
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
ethersphere/bee#5660 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
ethersphere/bee#5659 · 6 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
accepted seen
Difficoltà 4/5 3-5 giorni Idoneità per principianti 40/100
ethersphere/bee#5648 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di ethersphere/bee
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
SimonWaldherr/golang-examples#109 ·
-
Missing strings in en.tsApertaarea: localization needs-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug ready-for-pr
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
kunchenguid/no-mistakes#1615 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno