FLO-28: Safe Refund Ordering Can Brick Config Rotation
@holyfuchs ya está trabajando en esto.
Desde el 13/3/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Severity: Low
Files Affected
cadence/contracts/FlowALPRebalancerv1.cdc
Description
A natural fix for the “ Refund destination changes after recurring config updates” issue is to change FlowALPRebalancerv1.Rebalancer.setRecurringConfig(_:) so it cancels existing scheduled transactions first (using the old config/old txFunder), and only then assigns self.recurringConfig = config, ensuring refunds go back to the original payer. The intended flow is to allow operators to rotate configuration safely while cleaning up old schedules. In a scenario where the current txFunder has reached its depositCapacity and cannot accept refunds, cancelScheduledTransaction(id:) will panic because refund.balance > 0.0 remains after attempting txFunder.depositCapacity(from:). The normal operational response is to rotate to a new txFunder with higher capacity so cancellations and scheduling can resume. However, if setRecurringConfig is adjusted to call cancelAllScheduledTransactions() before updating self.recurringConfig (as a fix to ensure refunds go back to the original txFunder that paid for the scheduled transactions), this creates a deadlock: the rebalancer cannot cancel existing scheduled transactions due to the refund-capacity panic, so setRecurringConfig cannot complete and therefore cannot install the new, healthy txFunder. This can leave the rebalancer stuck in a state where it cannot be reconfigured, cleanly canceled, or migrated away from the saturated funder.
Recommendation
Make cancellation non-blocking on refund deposit acceptance so config rotation can always proceed even when the old txFunder is saturated. For example: If a refund cannot be fully deposited, store the remainder as a pending refund and emit an event, instead of panicking.
Parent Issue: #209
- Lenguaje dominante
- Cadence
- Estrellas
- 40
- Forks
- 2
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de onflow/FlowALP
-
Restrict public constructor of PositionSourceQuizá libre de nuevo @liobrasil la tomó hace 213 días y no hay ningún pull request abierto. Abiertobug
-
Port MOET changes from #251 to mainQuizá libre de nuevo @nialexsan la tomó hace 222 días y no hay ningún pull request abierto. Abierto
-
Deposit Capacity AttacksPosiblemente ocupada @mts1715 la tomó hace 228 días. Abierto
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
Immediate deposit+withdrawal saturates deposit rate limit capacityQuizá libre de nuevo @tim-barry la tomó hace 214 días y no hay ningún pull request abierto. Abierto