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

Add invalid_bundles_undecodeable_tx tests #3258

Merged
merged 2 commits into from
Nov 27, 2024
Merged

Add invalid_bundles_undecodeable_tx tests #3258

merged 2 commits into from
Nov 27, 2024

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Nov 26, 2024

This PR adds fraud proof tests for undecodable transactions.

I made slightly different changes to the advice in the ticket:

  • all 3 instances of InvalidBundleType::InherentExtrinsic got replaced
  • I used a fixed extrinsic code that is currently unused, and added a comment saying we only use it in tests

Some extrinsic codes accept any random data after the code, so we can't reliably trigger an undecodable error if we pick those codes at random. The length is usually not correct in random data, but to fail encoding we need to read too many bytes. That gets complicated with compact encoding.

Close #3253.

Code contributor checklist:

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, just a few nits

crates/subspace-runtime/src/lib.rs Outdated Show resolved Hide resolved
domains/client/domain-operator/src/tests.rs Outdated Show resolved Hide resolved
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!

@teor2345 teor2345 added this pull request to the merge queue Nov 27, 2024
Merged via the queue into main with commit 13b01b5 Nov 27, 2024
8 checks passed
@teor2345 teor2345 deleted the test-undec-tx branch November 27, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execution Subspace execution fraud-proof
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add integration test for the undecodable transaction fraud proof
3 participants