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

Allow justifications on non-finalized blocks #1159

Closed
nazar-pc opened this issue Aug 25, 2023 · 3 comments · Fixed by #1211
Closed

Allow justifications on non-finalized blocks #1159

nazar-pc opened this issue Aug 25, 2023 · 3 comments · Fixed by #1211

Comments

@nazar-pc
Copy link
Contributor

nazar-pc commented Aug 25, 2023

Currently Substrate enforces that blocks must not have justifications unless they are finalized:

assert!(justifications.is_some() && finalized || justifications.is_none() || gap_block);

It is useful, however, for other purposes as well, for instance I would like to use justifications to make nodes send extra data alongside blocks that are not strictly required, but do help with block verification.

Grandpa already has a check that finalized blocks must have justifications (with redundant assertion afterwards) if I understand it correctly, so should not be an issue to remove this requirement (I think):

if block.justifications.is_none() {
return Err(ConsensusError::ClientImport(
"Justification required when importing \
an old block with authority set change."
.into(),
))
}
assert!(block.justifications.is_some());

Any concerns if I send a PR removing this restriction?

@bkchr
Copy link
Member

bkchr commented Aug 25, 2023

CC @arkpar

@arkpar
Copy link
Member

arkpar commented Aug 25, 2023

No objections from my side.
CC @andresilva

@bkchr
Copy link
Member

bkchr commented Aug 25, 2023

Okay perfect :) @andresilva is on holidays. @nazar-pc let's create a pr :)

bkchr added a commit that referenced this issue Sep 12, 2023
One assertion was unnecessary because of the check right above it,
second assertion resolves
#1159

---------

Co-authored-by: Bastian Köcher <[email protected]>
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this issue Mar 25, 2024
One assertion was unnecessary because of the check right above it,
second assertion resolves
paritytech#1159

---------

Co-authored-by: Bastian Köcher <[email protected]>
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 a pull request may close this issue.

3 participants