-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Refactor: extract most aura logic out to standalone module, make use of these #13764
Conversation
The CI pipeline was cancelled due to failure one of the required jobs. |
288f0e8
to
2686d95
Compare
Err(SealVerificationError::Deferred(header, slot)) => | ||
Ok(CheckedHeader::Deferred(header, slot)), | ||
Err(SealVerificationError::Unsealed) => Err(Error::HeaderUnsealed(hash)), | ||
Err(SealVerificationError::BadSeal) => Err(Error::HeaderBadSeal(hash)), | ||
Err(SealVerificationError::BadSignature) => Err(Error::BadSignature(hash)), | ||
Err(SealVerificationError::SlotAuthorNotFound) => Err(Error::SlotAuthorNotFound), | ||
Err(SealVerificationError::InvalidPreDigest(e)) => Err(Error::from(e)), |
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.
Please add SealVerificationError
as variant to Error
.
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 would break the API, so I don't think it's a good idea.
SealVerificationError
is basically just a copy of the Error
variants that could be produced within seal verification.
{ | ||
client | ||
.runtime_api() | ||
.slot_duration(client.usage_info().chain.best_hash) |
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.
Maybe we should pass the bloc hash to the slot_duration
function.
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 agree, but unfortunately, there was already a pub fn slot_duration
with this exact interface exported from the lib.rs
. To maintain backwards compatibility the interface needs to stay the same.
I will add another function which takes a block hash explicitly.
improve docs Co-authored-by: Bastian Köcher <git@kchr.de>
bot merge |
This PR cannot be merged at the moment due to: 11 of 14 required status checks are expected. processbot expects that the problem will be solved automatically later and so the auto-merge process will be started. You can simply wait for now. |
Ci looks stuck, either that or it somehow hasn't run in several hours. mildly blocking |
bot rebase |
Rebased |
bot merge |
Waiting for commit status. |
Merge cancelled due to error. Error: Statuses failed for a18f21e |
bot fmt |
@bkchr https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2625236 was started for your command Comment |
@bkchr Command |
bot merge |
Waiting for commit status. |
Merge cancelled due to error. Error: Statuses failed for b5e4271 |
…of these (#13764) * Extract most aura logic out to standalone module, make use of these * Update client/consensus/aura/src/standalone.rs improve docs Co-authored-by: Bastian Köcher <git@kchr.de> * add slot_duration_at * ".git/.scripts/commands/fmt/fmt.sh" --------- Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: parity-processbot <>
…of these (#13764) * Extract most aura logic out to standalone module, make use of these * Update client/consensus/aura/src/standalone.rs improve docs Co-authored-by: Bastian Köcher <git@kchr.de> * add slot_duration_at * ".git/.scripts/commands/fmt/fmt.sh" --------- Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: parity-processbot <>
…of these (paritytech#13764) * Extract most aura logic out to standalone module, make use of these * Update client/consensus/aura/src/standalone.rs improve docs Co-authored-by: Bastian Köcher <git@kchr.de> * add slot_duration_at * ".git/.scripts/commands/fmt/fmt.sh" --------- Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: parity-processbot <>
Related to paritytech/cumulus#2382
The changeset here is simply to create a
standalone
module insc_consensus_aura
and extract out useful behaviors such as slot claiming, seal generation, header verification to it. Then the parts ofsc_consensus_aura
that use these behaviors have been changed to invoke these functions.This is also an experiment in refactoring Substrate consensus code - as @bkchr and I have discussed in the past, we've introduced abstractions at many of the wrong layers. By breaking up the consensus code into batches of standalone functions (@tomaka may cry tears of joy at this), it makes integration, modification, and customization easier.
The motivation here is to do the same in Cumulus. I am currently breaking out many primitives in Cumulus to make consensus drive the collator, and as per paritytech/cumulus#2301 we may need modifications to the meaning of Aura slots to prepare for asynchronous backing.
This is intended to be fully backwards-compatible in both API and behavior.