Skip to content

Commit

Permalink
docs(nns): Updated comment about following pruning batches. (#3772)
Browse files Browse the repository at this point in the history
This addresses follow up issues from [PR 2392].

[PR 2392]: #2392

All changes here are comments.
  • Loading branch information
daniel-wong-dfinity-org authored Feb 7, 2025
1 parent 8ee65b2 commit 0c590b1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions rs/nns/governance/canister/canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,17 @@ const PRUNE_FOLLOWING_INTERVAL: Duration = Duration::from_secs(10);
//
// Why this value seems to make sense:
//
// I think we can conservatively estimate that it takes 2 megainstructions to
// pull a neuron from stable memory. If we assume 200 kiloneurons are in stable
// memory, then 400 gigainstructions are needed to read all neurons in stable
// memory. 400e9 instructions / 25e6 instructions per batch = 16e3 batches. If
// we process 1 batch / s (see PRUNE_FOLLOWING_INTERVAL), then it would take
// less than 4.5 hours to complete a full pass.
// I think we can conservatively estimate that it takes 2e6 instructions to pull
// a neuron from stable memory. If we assume 200e3 neurons are in stable memory,
// then 400e9 instructions are needed to read all neurons in stable memory.
// 400e9 instructions / 50e6 instructions per batch = 8e3 batches. If we process
// 1 batch every 10 s (see PRUNE_FOLLOWING_INTERVAL), then it would take less
// than 23 hours to complete a full pass.
//
// This comes to 5.4 full passes per day. If each full pass uses 400
// gigainstructions, then we use 2.16 terainstructions per day doing
// This comes to 1.08 full passes per day. If each full pass uses 400e9
// instructions, then we use 432e9 instructions per day doing
// prune_some_following. If we assume 1 terainstruction costs 1 XDR,
// prune_some_following uses a couple of bucks worth of instructions each day.
// prune_some_following uses less than half an XDR per day.
const MAX_PRUNE_SOME_FOLLOWING_INSTRUCTIONS: u64 = 50_000_000;

fn schedule_seeding(delay: Duration) {
Expand Down

0 comments on commit 0c590b1

Please sign in to comment.