Skip to content

Conversation

pgherveou
Copy link
Contributor

@pgherveou pgherveou commented Oct 14, 2025

Adds a new --instant-seal CLI flag to enable instant seal mode in omni-node.

fixes #9996

@pgherveou pgherveou marked this pull request as ready for review October 14, 2025 06:43
@pgherveou
Copy link
Contributor Author

Open to add a new option as well if you think that make more sense

@pgherveou
Copy link
Contributor Author

/cmd prdoc --audience runtime_dev --bump patch

@pgherveou pgherveou added T7-smart_contracts This PR/Issue is related to smart contracts. T0-node This PR/Issue is related to the topic “node”. and removed T7-smart_contracts This PR/Issue is related to smart contracts. labels Oct 14, 2025
@pgherveou
Copy link
Contributor Author

/cmd fmt

Copy link
Contributor

@iulianbarbu iulianbarbu left a comment

Choose a reason for hiding this comment

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

LGTM! Just a few nits

@bkchr bkchr enabled auto-merge October 14, 2025 20:16
@pgherveou
Copy link
Contributor Author

/cmd fmt

/// By default this is retrieved from `SharedParams`.
fn is_dev(&self) -> Result<bool> {
Ok(self.shared_params().is_dev())
fn is_dev(&self) -> bool {
Copy link
Member

Choose a reason for hiding this comment

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

Please revert this unrequired change.

Copy link
Contributor Author

@pgherveou pgherveou Oct 15, 2025

Choose a reason for hiding this comment

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

I use is_dev() in this commit, this didnt make any sense, why does it have to return a result?

Copy link
Contributor

@iulianbarbu iulianbarbu Oct 21, 2025

Choose a reason for hiding this comment

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

We can probably unwrap_or(false) there instead to avoid doing changes here. I don't have a good example for why to return Result<bool> - the only thing that comes to mind is that some nodes might work in a development setup where nodes query memory or IO to find whether they should run in development (however convoluted this might seem), and a third state like Err could represent an internal error happened during the query, which is not equivalent with true or false (which represent the query result). Also, changing it could break users (in an unnecessary way IMO) and would be simpler (from a case perspective) to pack it with a bigger breaking change that's needed (if any).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am happy to rollback 7f73cfb if you can give me an explanation of why something that is always returning Ok(bool) should not instead just return bool

Copy link
Contributor

@iulianbarbu iulianbarbu Oct 21, 2025

Choose a reason for hiding this comment

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

It is true that "always returning Ok(bool)" is equivalent to just returning bool, but the method can be overridden to return also Err - given it is a trait fn. However, I also find it very unlikely that node developers would need the Err to be returned by is_dev - whatever they need to do based on that error can still happen inside is_dev override (mostly panicing). Returning the error though will give the flexibility to handle it outside is_dev too, which might be needed in case some outer scope variables that can not be passed to is_dev are needed (but the logic can also have this context on self, and made available in is_dev, but that enforces some constraints on implementations). I would personally not touch this for this PR, since it raises unrelated concerns, and maybe attack it via a different PR, but if we do it here, the prdoc should be updated accordingly.

This reverts commit 7f73cfb.
@bkchr bkchr added this pull request to the merge queue Oct 21, 2025
@iulianbarbu iulianbarbu removed this pull request from the merge queue due to a manual request Oct 21, 2025
Co-authored-by: Iulian Barbu <[email protected]>
Co-authored-by: Iulian Barbu <[email protected]>
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/18694569205
Failed job name: test-linux-stable-runtime-benchmarks

@pgherveou pgherveou enabled auto-merge October 22, 2025 07:29
@pgherveou pgherveou added this pull request to the merge queue Oct 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T0-node This PR/Issue is related to the topic “node”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add InstantSeal feature to Omninode

3 participants