Skip to content

Conversation

@syjn99
Copy link
Member

@syjn99 syjn99 commented Aug 14, 2025

What was wrong?

Checkpoint container is missing, which is likely to be included in the spec.

How was it fixed?

This PR adds Checkpoint container and matches with the current (draft) spec. (leanEthereum/leanSpec#8)

To-Do

Comment on lines +199 to +210
while let Some(children) = children_map.get(&current_root) {
current_root = *children
.iter()
.max_by_key(|child_hash| {
let vote_weight = vote_weights.get(*child_hash).unwrap_or(&0);
let slot = blocks.get(*child_hash).map(|block| block.slot).unwrap_or(0);
(*vote_weight, slot, *(*child_hash))
})
.ok_or_else(|| anyhow!("No children found for current root: {current_root}"))?;
}

Ok(current_root)
Copy link
Member Author

@syjn99 syjn99 Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I found my linter keeps complaining for this part, so I rewrite this more idiomatically

@syjn99 syjn99 requested a review from unnawut August 14, 2025 02:37
Copy link
Contributor

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: looks good

@KolbyML KolbyML added this pull request to the merge queue Aug 14, 2025
Merged via the queue into ReamLabs:master with commit 2f8f924 Aug 14, 2025
14 checks passed
allnil pushed a commit to loadnetwork/ream that referenced this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants