Skip to content

Extract aggregate_work_info function - #1908

Merged
remagpie merged 1 commit into
CodeChain-io:masterfrom
remagpie:aggregate-work-info
Dec 9, 2019
Merged

Extract aggregate_work_info function#1908
remagpie merged 1 commit into
CodeChain-io:masterfrom
remagpie:aggregate-work-info

Conversation

@remagpie

@remagpieremagpie commented Dec 3, 2019

Copy link
Copy Markdown
Contributor

Depends: #1916


let start_of_the_current_term = {
let end_of_the_last_term =
chain.last_term_finished_block_num((start_of_the_next_term_header.number() - 2).into()).unwrap();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is - 2 right?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, it's right.
End of the current term = block@(Start of the next term - 1)
End of the last term = block@((End of the current term - 1).metadata.lastTermFinished)

It becomes a bit different if the current term has only one block, but surprisingly, the final formula remains the same.

Comment threadcore/src/consensus/tendermint/engine.rs Outdated
@remagpie
remagpie changed the base branch from era to masterDecember 5, 2019 09:16
@remagpie

Copy link
Copy Markdown
ContributorAuthor

I rebased the PR to @foriequal0 's refactoring branch.
Only the last commit is the new commit.

@remagpieremagpie added the do-not-merge Do not merge (for mergify.io) label Dec 5, 2019
@sgkim126

Copy link
Copy Markdown
Contributor

@foriequal0 It looks good to me, but would you double-check?

foriequal0
foriequal0 previously approved these changes Dec 6, 2019
@remagpieremagpie removed the do-not-merge Do not merge (for mergify.io) label Dec 9, 2019
@remagpie
remagpie merged commit 79322e1 into CodeChain-io:masterDec 9, 2019
@remagpie
remagpie deleted the aggregate-work-info branch December 9, 2019 07:42
Sign up for freeto 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.

3 participants

@remagpie@sgkim126@foriequal0