Merged
Conversation
…`BundleValidator` into `TxPreValidator` This commits introduces a trait `PreValidateTransaction` which is invoked before calling the normal `validate_transaction` function. `FraudProofVerifierAndBundleValidator` is separated out temperoarily, it's now used by both the primary chain and the system domain. However, the system domain does not need the bundle validator at all, which will be removed later, making it more explicit and easier to figure out the ingredients of the custom tx-pre-validator for primary_chain/system_domain/core_domain.
…to service crates This commit introduces `PrimaryChainTxPreValidator` and `SystemDomainTxPreValidator`, moving the implementations of `PreValidateTransaction` from `subspace-transaction-pool` to the service crates where the transaction pool was constructed. - PrimaryChainTxPreValidator: FraudProofVerifierAndBundleValidator - SystemDomainTxPreValidator: only BundleValidator (xdm verifier will be integrated in later commits)
…saction-pool `subspace-transaction-pool` is now pretty flexible, all kinds of pre-validation requiremnts are actually handled by the `TxPreValidator`.
Replace `subspace_transaction_pool::new_full_with_verifier` with `subspace_transaction_pool::new_full` using the core domain specific tx pre-validator. The only requirement of pre-validation on the core domain is the xdm verification.
Integrate the xdm verification in the system domain tx pre-validator and also replace `subspace_transaction_pool::new_full_with_verifier` with `subspace_transaction_pool::new_full`.
… transaction pool deps from domain-executor
… remove `subspace-fraud-proof` dep from `subspace-transaction-pool`
vedhavyas
reviewed
Mar 28, 2023
Contributor
vedhavyas
left a comment
There was a problem hiding this comment.
make sense overall but still not sure if tx_pre_validator needs to in service crate.
Contributor
Author
Any suggestions? |
Contributor
|
So my PR brings the xdm verification already under |
Contributor
Author
|
These pre_tx_validators are not only for the domain block but also for the primary block, hence I don't think that's perfect. |
vedhavyas
previously approved these changes
Mar 28, 2023
…ctor-subspace-transaction-pool
…ctor-subspace-transaction-pool
vedhavyas
approved these changes
Mar 29, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some background: the sole purpose of
subspace-transaction-poolis to perform some pre-validation before doing the normal extrinsic validation, primary chain/system domain/core domain all have their custom pre-validation logic.Why this PR
domain_block_preprocessorintroduced in Abstract out domain_block_preprocessor module #1294 to be a reusable component to be used both on the executor and fraud proof verifier side. While working on it, I founddomain_block_preprocessorrequiresxdm_verifierin domain-executor which relies on thesubspace-transaction-pool, causing a cyclic dependency (domain_block_preprocessorrelies onsubspace_transaction_pool,subspace_transaction_poolrelies onsubspace-fraud-proof, and we wantsubspace-fraud-proofto rely ondomain_block_preprocessorto reuse it).Changes in this PR
subspace-transaction-poolgeneric over theTxPreValidator, now we havePrimaryChainTxPreValidator,SystemDomainTxPreValidatorandCoreDomainTxPreValidator.subspace-fraud-proofdependency fromsubspace-transaction-pool.subspace-transaction-pooldependency fromdomain-executor.Should be no logical changes in this PR, it's a pure refactoring.
Code contributor checklist: