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

node: author the first block unconditionally #186

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sugondat/chain/node/src/proposer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! non-inherent extrinsics and avoid authoring empty blocks.
//! 2. There is an incoming downward message from the relay chain.
//! 3. There is a go-ahead signal for a parachain code upgrade.
//! 4. The block is the first block of the parachain. Useful for testing.
//!
//! If any of these conditions are met, then the block is authored.

Expand Down Expand Up @@ -83,8 +84,13 @@ impl<P: ProposerInterface<Block> + Send> ProposerInterface<Block> for BlockLimit
Ok(None) => false,
}
};
let first_block = {
// allow creating the first block without the above conditions. This is useful for
// testing for detection of healthiness.
parent_header.number == 0
};

if has_downward_message || has_go_ahead || has_transactions {
if has_downward_message || has_go_ahead || has_transactions || first_block {
self.inner
.propose(
parent_header,
Expand Down