BL-26: Batch-assignment pool-reshaping gap — unstake between seed lock and autoCreateTier1AndTier2 re-rolls all assignments

Aberta
#243 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@robertocarlous já está trabalhando nisso.

Desde 15/10/2026.

  • #253 de @robertocarlous — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
solidity
Domínio
blockchain, security

Direção de pesquisa

Read DINTaskCoordinator.sol around autoCreateTier1AndTier2 (L714–780), createAuditorsBatches (L820–880), and the existing _assignFreshSubgroup pattern. Check the relevant tests for batch creation and validator activity. Done when assignments use the fixed per-GI registration list and locked seed, skipping inactive entries so an unstake only forfeits that validator’s seat.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Approved bug

Summary

DINTaskCoordinator.autoCreateTier1AndTier2 and createAuditorsBatches build the validator pool from _activeAggregatorPool / _activeAuditorPool at call time, after the seed is already public. A validator can unstake between the seed lock and the batch-creation call to change the active pool size, which causes Fisher-Yates to re-roll the entire batch assignment for everyone else. The cost to the attacker is real but modest: their own Sybils sit out the GI and enter unbonding.

This is a distinct gap from BL-11's re-roll-by-declining-to-lock residual (partially mitigated by the validator-side lock added in PR #191). A validator doesn't need to decline locking anything — they just wait until the seed is locked, then unstake, then the batch draw re-rolls when the model owner eventually calls autoCreateTier1AndTier2.

Reachability

  • Seed is locked (permissionlessly, by any validator online) once block.number >= seedBlock.
  • autoCreateTier1AndTier2 / createAuditorsBatches can be called by the model owner any time after the seed is locked — no deadline enforced.
  • Between lock and create, _activeAggregatorPool / _activeAuditorPool read the live staking contract. Any change in the active-validator count between those two calls shifts the Fisher-Yates index mapping.
  • Verified against develop @ aa76ce18: autoCreateTier1AndTier2 L714–780, createAuditorsBatches L820–880 (DINTaskCoordinator.sol).

Ready-made fix

Adopt _assignFreshSubgroup's existing pattern (the dispute re-eval draw, merged in PR #171):

  1. Shuffle the fixed per-GI registration list (dinAggregators[_GI] / the auditor equivalent) with the locked seed, not the live active pool.
  2. Walk the shuffled list and skip inactive entries when filling seats.

Under this scheme an unstake only forfeits the leaver's own seat; everyone else's assignment is already determined by the fixed list + locked seed and cannot be changed.

Out of scope here

The contract-side re-anchor cap (bounding how many times the seed can expire and re-anchor) was considered in PR #191 and deferred pending a GI-abort design (issue #222): without an abort path, a capped-out GI is stuck forever. That is a separate issue. This issue covers only the pool-reshaping gap.

References

  • Developer/BACK_LOG.md BL-26
  • PR #191 review — pool-reshaping gap documented as residual in DINTaskCoordinator.md §6.3
  • Issue #222 (GI-abort design, prerequisite for the re-anchor cap)
  • Issue #178 (sequencer-trust residual, separate track)
Linguagem predominante
Python
Estrelas
4
Forks
7
Merge médio
3d 7h
PRs com merge (30d)
33

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de InfiniteZeroFoundation/DevNet

Todas as issues de InfiniteZeroFoundation/DevNet

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.