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

Remove invalid bundles in the process of compiling bundles to extrinsics #1700

Merged
merged 8 commits into from
Jul 27, 2023

Conversation

liuchengxu
Copy link
Contributor

This PR introduces the invalid bundles in the bundles to extrinsics processing, each invalid bundle will be removed if any problematic tx is found in it. There are a few refactorings down the road, recommended to review commit by commit.

Close #1695

Code contributor checklist:

Rename `should_select_tx()` to `is_within_tx_range()` and handle
the case of unsigned transactions within `is_within_tx_range()`.
This commit is a pure refactoring to make the tx range check reusable in
domain-block-preprocessor later.

The sortition module in domain-operator is now not useful and deleted.
… bundles

- Make compile_own_domain_bundles() as a method of DomainBlockPreprocessor
- Remove invalid bundles in the process of compiling bundles to extrinsics
No logical changes
Copy link
Member

@vedhavyas vedhavyas left a comment

Choose a reason for hiding this comment

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

make sense overall in the first pass. Will look again

Copy link
Member

@NingLin-P NingLin-P left a comment

Choose a reason for hiding this comment

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

Make sense overall! just a few nits.

domains/client/block-preprocessor/src/lib.rs Outdated Show resolved Hide resolved
@@ -331,23 +359,23 @@ where
>,
consensus_block_hash: CBlock::Hash,
at: Block::Hash,
) -> sp_blockchain::Result<bool> {
) -> Result<bool, sp_api::ApiError> {
Copy link
Member

Choose a reason for hiding this comment

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

If we return Option<Vec<Block::Extrinsic>> instead of bool then we won't need to decode the extrinsic a second time, it may hurt readability though, non-blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, thought about avoiding the decoding again, but unsure if it's worth the readability comprise.

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 this pull request may close these issues.

Remove invalid bundles from domain-block-preprocessor
3 participants