Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh 1967 cleanup checkpoint schedules #1488

Merged
merged 12 commits into from
Jul 3, 2023

Conversation

Neopallium
Copy link
Contributor

@Neopallium Neopallium commented Jun 29, 2023

changelog

new features

  • Simplify Checkpoint schedules. Schedules are now just a list of pending Moment checkpoints, instead of complex calendar basic repeating values.

modified API

  • Checkpoint.create_schedule now take a ScheduleCheckpoints (holds a BTreeSet of Moment values) instead of ScheduleSpec.
  • Events ScheduleCreated and ScheduleRemoved changed to have ScheduleId and ScheduleCheckpoints instead of StoredSchedule.
  • Storage map Schedules replaced with double map ScheduledCheckpoints. Schedules are no longer stored in a Vec.
  • Storage map CachedNextCheckpoints is used to quickly check if a ticker has any checkpoints that need to be created.

modified logic

  • No longer supports recurring schedules. All scheduled checkpoints timestamps (Moment) need to be calculated off-chain.

data migration

  • Non-empty schedules from Checkpoint.Schedules are migrated to new structure, only a maximum of the next 10 checkpoints are kept for each schedule.

@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #1488 (9ac117c) into develop (0fadd64) will decrease coverage by 0.23%.
The diff coverage is 67.04%.

@@             Coverage Diff             @@
##           develop    #1488      +/-   ##
===========================================
- Coverage    54.43%   54.21%   -0.23%     
===========================================
  Files          151      151              
  Lines        32960    32988      +28     
===========================================
- Hits         17942    17884      -58     
- Misses       15018    15104      +86     
Impacted Files Coverage Δ
pallets/asset/src/lib.rs 81.78% <ø> (+0.04%) ⬆️
pallets/runtime/common/src/runtime.rs 1.81% <ø> (ø)
pallets/weights/src/pallet_checkpoint.rs 0.00% <0.00%> (ø)
primitives/src/calendar.rs 36.30% <ø> (-37.36%) ⬇️
pallets/asset/src/checkpoint/mod.rs 45.47% <58.37%> (-12.42%) ⬇️
pallets/corporate-actions/src/lib.rs 39.14% <84.21%> (+0.39%) ⬆️
pallets/common/src/traits/checkpoint.rs 74.82% <85.24%> (+61.03%) ⬆️
primitives/src/asset.rs 49.05% <100.00%> (+3.05%) ⬆️

... and 3 files with indirect coverage changes

@Neopallium Neopallium changed the title [WIP] Mesh 1967 cleanup checkpoint schedules Mesh 1967 cleanup checkpoint schedules Jun 30, 2023
@Neopallium Neopallium requested review from HenriqueNogara and adamdossa and removed request for HenriqueNogara June 30, 2023 13:32
@Neopallium Neopallium merged commit a2f8cb2 into develop Jul 3, 2023
13 checks passed
@Neopallium Neopallium deleted the MESH-1967-cleanup-checkpoint-schedules branch July 3, 2023 13:09
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.

None yet

3 participants