stacks-network / stacks-network/stacks-core
Add extensive test cases for possible "invalid" blocks
Open
@ASuciuX is already working on this.
Since Sep 18, 2024.
3.0-Testing
- Dominant language
- Rust
- Stars
- 3.1k
- Forks
- 762
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 76
Description
Not all possible reasons for not being valid are tested currently. e.g. https://github.com/stacks-network/stacks-core/blob/2be69cbf744ac339476362a3fb281257c9e1bebc/testnet/stacks-node/src/tests/signer/v0.rs#L39
Create more tests.
Possible errors for ValidateRejectCode:
- BadBlockHash = 0 -> build on top of this function
- BadTransaction = 1 -> build on top of the same
validatefunction as BadBlockHash - InvalidBlock = 2 - unit test and integration test
- ChainstateError = 3 - integration test
- UnknownParent = 4 - integration test
- NonCanonicalTenure = 5 - integration test
- NoSuchTenure = 6 -> same integration test as NonCanonicalTenure
All functions that aren't yet tested are part of theimpl NakamotoBlockProposal.
To do: Construct bad block proposal and submit to the signers. See how the signers deal with it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.