Skip to content

feat: reserve-expanding sync eligibility for redistribution game (SWIP-44) - #5568

Open
aloknerurkar wants to merge 1 commit into
masterfrom
swip-44.0
Open

feat: reserve-expanding sync eligibility for redistribution game (SWIP-44)#5568
aloknerurkar wants to merge 1 commit into
masterfrom
swip-44.0

Conversation

@aloknerurkar

@aloknerurkar aloknerurkar commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Implements SWIP-44: Reserve-Expanding Sync Eligibility.

Currently, Bee excludes a node from participating in the redistribution game whenever any historical pullsync is active (SyncRate() > 0). When a node is expanding its reserve into a lower bin ($d-1$) in preparation for a storage radius decrease, this sync can take hours, causing the node to miss rounds despite maintaining a complete and valid reserve at the current storage depth $d$.

Because the reserve digest $H(R_N(d))$ is computed strictly over PO bins $p \geq d$, chunks arriving in bins $p < d$ are disjoint from the reserve and do not influence the digest. This PR amends the eligibility check to allow participation during sub-depth sync:

  1. pkg/puller:
    • Added bin-level active historical sync worker tracking (activeHistSyncs [swarm.MaxBins]int, activeHistSyncsMu sync.RWMutex).
    • Exposed IsBinSyncing(bin uint8) bool and depth-aware IsReserveSynced(depth uint8) bool.
    • Updated mock syncer and added TestIsReserveSynced.
  2. pkg/storageincentives:
    • Updated Agent constructor and sampling handler to evaluate reserveSyncedFunc(committedDepth) instead of blanket global sync state.
    • Added unit tests covering game participation during sub-depth sync vs. reserve-depth sync.
  3. pkg/node:
    • Wired pullerService.IsReserveSynced(depth) into storageincentives.New.

Open API Spec Version Changes (if applicable)
N/A

Motivation and Context (Optional)
Addresses SWIP-44 (ethersphere/SWIPs#92).

Related Issue (Optional)

Screenshots (if appropriate):
N/A

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

@aloknerurkar aloknerurkar changed the title feat: eligibility for incentives during reserve-expanding pullsync feat: reserve-expanding sync eligibility for redistribution game (SWIP-44) Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant