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

[Log] Changes to epoch hash. #2420

Merged
merged 6 commits into from
Apr 3, 2024
Merged

[Log] Changes to epoch hash. #2420

merged 6 commits into from
Apr 3, 2024

Conversation

d0cd
Copy link
Contributor

@d0cd d0cd commented Apr 3, 2024

This PR logs changes to the current_epoch_hash in the Ledger.

ledger/src/advance.rs Outdated Show resolved Hide resolved
ledger/src/advance.rs Outdated Show resolved Hide resolved
ledger/src/advance.rs Outdated Show resolved Hide resolved
ledger/src/advance.rs Outdated Show resolved Hide resolved
d0cd and others added 3 commits April 3, 2024 14:18
Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com>
Signed-off-by: d0cd <23022326+d0cd@users.noreply.github.com>
Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com>
Signed-off-by: d0cd <23022326+d0cd@users.noreply.github.com>
@howardwu
Copy link
Contributor

howardwu commented Apr 3, 2024

^CI is failing

Comment on lines 107 to 110
// Get the height of the block.
let height = block.height();
// Get the epoch hash for the block.
let epoch_hash = &self.get_epoch_hash(height).ok();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you one-line this?

// Update the current epoch hash.
self.current_epoch_hash.write().clone_from(&self.get_epoch_hash(block.height()).ok());
self.current_epoch_hash.write().clone_from(epoch_hash);
Copy link
Contributor

Choose a reason for hiding this comment

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

You can move this into L114

// Get the epoch hash for the block.
let epoch_hash = &self.get_epoch_hash(height).ok();
// Log the update of the current epoch hash.
match epoch_hash {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can move the one-line to this match statement

@howardwu howardwu merged commit 39282a1 into mainnet-staging Apr 3, 2024
44 of 76 checks passed
@howardwu howardwu deleted the log/solution branch April 3, 2024 22:43
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.

3 participants