Skip to content

Commit f684a9f

Browse files
authored
chore: resolve stale TODOs in epoch processing (#285)
Resolves two stale TODOs in epoch processing: 1. **`process_pending_deposits.zig`**: Removed false-alarm TODO questioning whether `withdrawal_credentials` matches the spec — it does. `PendingDeposit.withdrawal_credentials` is `Bytes32`, exactly matching the consensus spec. 2. **`process_randao_mixes_reset.zig`**: Replaced mystery `TODO inspect why this clone was needed` with an explanation. The clone is necessary because `set()` at a different gindex may CoW-rebranch the persistent merkle tree, invalidating the node reference returned by `get()`. 🤖 Generated with AI assistance Co-authored-by: lodekeeper-z <lodekeeper-z@users.noreply.github.com>
1 parent 1060251 commit f684a9f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/state_transition/epoch/process_pending_deposits.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn applyPendingDeposit(
129129
) !void {
130130
const validator_index = epoch_cache.getValidatorIndex(&deposit.pubkey) orelse null;
131131
const pubkey = &deposit.pubkey;
132-
// TODO: is this withdrawal_credential(s) the same to spec?
132+
133133
const withdrawal_credentials = &deposit.withdrawal_credentials;
134134
const amount = deposit.amount;
135135
const signature = deposit.signature;

src/state_transition/epoch/process_randao_mixes_reset.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ pub fn processRandaoMixesReset(
1515
var old = try randao_mixes.get(current_epoch % preset.EPOCHS_PER_HISTORICAL_VECTOR);
1616
try randao_mixes.set(
1717
next_epoch % preset.EPOCHS_PER_HISTORICAL_VECTOR,
18-
// TODO inspect why this clone was needed
18+
// Clone needed: set() at a different gindex may CoW-rebranch the
19+
// tree, invalidating the node reference returned by get().
1920
try old.clone(.{}),
2021
);
2122
}

0 commit comments

Comments
 (0)