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

Undecodable tx fraud proof #2322

Closed
Tracked by #1706
NingLin-P opened this issue Dec 13, 2023 · 2 comments · Fixed by #2363
Closed
Tracked by #1706

Undecodable tx fraud proof #2322

NingLin-P opened this issue Dec 13, 2023 · 2 comments · Fixed by #2363

Comments

@NingLin-P
Copy link
Member

Undecodable tx fraud proof is a variant of the invalid bundle fraud proof.

The fraudulent detection and the generation of the fraud proof is the same as other invalid bundle fraud proof and is already implemented, see:
https://github.com/subspace/subspace/blob/f1ab6832248a015148933f6e8f617a2e9c186e2f/domains/client/domain-operator/src/domain_block_processor.rs#L1008-L1010
https://github.com/subspace/subspace/blob/f1ab6832248a015148933f6e8f617a2e9c186e2f/domains/client/domain-operator/src/fraud_proof.rs#L147

What is left to do is the verification of the undecodable tx fraud proof, namely add a branch here to handle the InvalidBundleType::UndecodableTx:
https://github.com/subspace/subspace/blob/f1ab6832248a015148933f6e8f617a2e9c186e2f/crates/sp-domains-fraud-proof/src/verification.rs#L463-L464

to show that the extrinsic is indeed undecodable as:
https://github.com/subspace/subspace/blob/f1ab6832248a015148933f6e8f617a2e9c186e2f/domains/client/block-preprocessor/src/lib.rs#L266-L267

@rahulksnv
Copy link
Contributor

So when it fails to decode the extrinsic, we can't tell if it is a Call::submit_bundle{..} or Call::submit_fraud_proof{..}. And if we get to the point where we have decoded a Call::submit_fraud_proof{..}, the fraud proof has been decoded successfully at that point.

In other words, I don't see if/how this error is possible. May be I am missing something?

@NingLin-P
Copy link
Member Author

NingLin-P commented Dec 19, 2023

So when it fails to decode the extrinsic, we can't tell if it is a Call::submit_bundle{..} or Call::submit_fraud_proof{..}. And if we get to the point where we have decoded a Call::submit_fraud_proof{..}, the fraud proof has been decoded successfully at that point.

submit_bundle and submit_fraud_proof are extrinsic of the consensus chain while this fraud proof targets undecodable domain extrinsic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants