charon
charon copied to clipboard
Refactor vmock with optimisation
🎯 Problem to be solved
Currently vmock queries duties every slot and if there are any then it performs those duties. Vmock also schedules duties for all the slots in an epoch which results in unnecessary goroutines for each duty in each slot.
🛠️ Proposed solution
This can be solved by:
- Querying duties at the start of each epoch and caching those duties to be performed when slot ticks.
- Only scheduling duties for slots that are cached at the start of epoch and NOT all of them.
- Align with the VC terminology of lookahead as current and next epoch rather than previous and current epoch. This would further simplify the duties workflow.
🧪 Tests
- [ ] Tested by new automated unit/integration/smoke tests
- [ ] Manually tested on core team/canary/test clusters
- [ ] Manually tested on local compose simnet