Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@andresilva
Copy link
Contributor

Add a trait for reporting how late the current block is and implement it for BABE.

@andresilva andresilva added A0-please_review Pull request needs code review. M4-core B0-silent Changes should not be mentioned in any release notes labels Apr 3, 2020
@andresilva andresilva requested a review from gavofyork April 3, 2020 14:34
let lateness = current_slot.saturating_sub(CurrentSlot::get() + 1);
let lateness = T::BlockNumber::from(lateness as u32);

Lateness::<T>::put(lateness);
Copy link
Member

Choose a reason for hiding this comment

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

We're trying to cut down on extra DB I/O as it's pretty slow. Could we get this merged into CurrentSlot?

Copy link
Contributor Author

@andresilva andresilva Apr 3, 2020

Choose a reason for hiding this comment

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

This is always killed in on_finalize and should never reach the DB. Added some comments on this.

@bkchr
Copy link
Member

bkchr commented Apr 3, 2020

You need to merge master to make the polkadot build green :)

@bkchr bkchr merged commit 0c7f8b2 into master Apr 4, 2020
@bkchr bkchr deleted the andre/add-lateness-trait branch April 4, 2020 07:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants