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

Standard set of test raw blocks and transactions that stress all edge cases #6

Open
AustEcon opened this issue Jul 5, 2020 · 3 comments

Comments

@AustEcon
Copy link
Contributor

AustEcon commented Jul 5, 2020

I have a fair idea of most of the pitfalls that need to be handled wrt indexing the chain.

Things like handling of malformed output scripts (which can legitimately happen where they do not comply with bitcoin script syntax rules). Or coinbase scripts do not get checked so can just find total junk in there... or weird stuff happens like the coinbase can make the txid be non-unique! (but only for coinbases as a special case)

But also the "happy path" of correctly parsing all pushdatas / opcodes.

So I think a set of hand-crafted raw blocks and raw transactions with expected output would be nice (but might be a bit tedious to make...)

I've often found myself wishing that something like this existed for a number of bitcoin-related projects.

For the wallet you really want a set of transactions that systematically map out all of the most common script types to stress all the edge cases too.

@rt121212121
Copy link
Contributor

I wonder if it would be best to generate these and then you can rebuild the set.

@AustEcon
Copy link
Contributor Author

AustEcon commented Jul 6, 2020

Yeah that's probably the easiest way. Just generate a block on RegTest densely packed with all of the trouble-maker transactions perhaps and then gather up all the utxos... the full state of the chain and capture it for testing?

I don't think you can make custom coin bases when mining blocks but for everything else would be ideal.

Or maybe they just get generated anew each test run and can extend the generator over time to be more comprehensive

@rt121212121
Copy link
Contributor

I think we need to be able to make custom coin bases if we want to test miner id, but actually emulating that might be outside the scope of our sdk.

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

No branches or pull requests

2 participants