Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
Signed-off-by: Naohiro Yoshida <[email protected]>
  • Loading branch information
Naohiro Yoshida committed Nov 26, 2024
1 parent 7b9c901 commit 72d6c36
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions light-client/src/header/eth_headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl ETHHeaders {
) -> Result<Option<&Epoch>, Error> {
let hs: Vec<&ETHHeader> = self.all.iter().filter(|h| h.number >= checkpoint).collect();
match current_epoch {
// ex) t=200 then 200 <= h < 411 (c_val(200) can be borrowed by p_val)
// ex) t=200 then 200 <= h < 411 (at least 1 honest c_val(200)' can be in p_val)
Untrusted(_) => {
// Ensure headers are before the next_checkpoint
if hs.iter().any(|h| h.number >= next_checkpoint) {
Expand All @@ -137,7 +137,7 @@ impl ETHHeaders {
}
Ok(None)
}
// ex) t=201 then 201 <= h < 611 (n_val(400) can be borrowed by c_val(200))
// ex) t=201 then 201 <= h < 611 (at least 1 honest n_val(400) can be in c_val(200))
Trusted(_) => {
// Get next_epoch if epoch after checkpoint ex) 400
let next_epoch = match hs.iter().find(|h| h.is_epoch()) {
Expand All @@ -155,7 +155,6 @@ impl ETHHeaders {
return Ok(None);
}

// Ensure n_val(400) can be borrowed by c_val(200)
let next_next_checkpoint = (epoch + 2) * BLOCKS_PER_EPOCH + next_epoch.checkpoint();

// Ensure headers are before the next_next_checkpoint
Expand Down

0 comments on commit 72d6c36

Please sign in to comment.