This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cumulative fixes to make working with consensus-pow easier #3617
Cumulative fixes to make working with consensus-pow easier #3617
Changes from 24 commits
0f894f0
debbb5b
62fb99a
fcb81d7
74b3634
a1b49b1
9775ece
526b860
912c032
4beec1a
ff7a3f8
a484830
58395dc
f431d63
53e8bea
e417b3f
547112b
f9b76ec
fb71f77
8888f16
23bbb53
b8745ba
bf26edf
d94fe48
1719905
96d6a7e
bf76102
dd428de
7229cd0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we need to add this? Do we have to deal with any existing deployment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this parameter because runtime upgrades may break older inherent data check. For example, when the inherent data format is changed completely or an old inherent module is removed. In those cases, some chains might want to completely skip the check, because the older the block is, the more "finalized" it is because of PoW built on top of it.
This branch can be disabled by simply setting
check_inherents_after
to 0.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this changed from a
saturating_add()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the
add
function fromTotalDifficulty
trait. The idea here is that someDifficulty
definitions may want to use its own customized method for calculating the total difficulty from current difficulty. Most of the timeTotalDifficulty::add
will still be implemented assaturating_add
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small nit: my brain treats
add
as a function which takes&self
and returnsSelf
. For this case, it seemsincrease(&mut self, other: Self) → ()
would be more appropriate, don't you think so?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the finality proof provider is optional when creating the service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to provide a reproducible test case, but I think what I had trouble with is that if I remove
.with_finality_proof_provider
for the service builder, the whole type resolution will fail. But maybe we should fix that instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I see, it will fail to infer the generic type of the optional finality proof provider.