Published on: 2012-07-31T14:39:45+00:00
In a Bitcoin development mailing list discussion on July 30th, 2012, Gavin Andresen expressed the difficulty in testing check*sig functionality due to its reliance on previous unspent transactions and private keys. He welcomed any ideas for a simple data-driven format for testing. Ultraprune, which changes the block validation mechanism to only use a set of coins and the latest block pointer as state, was introduced. This state is represented by an abstract class with multiple implementations. A memory-backed coin set as state can be utilized for a testset run, with the list of coins and blocks loaded from a file.Gavin Andresen expressed interest in porting more tests into a data-driven format, including P2SH, checksig, checkmultisig, block verification, and DoS rules. However, he noted that check*sig tests are challenging because they require specific unspent transactions and private keys for testing. He welcomes brilliant ideas on a simple data-driven format. Block verification tests would be beneficial, with a collection of good and bad block chains starting from a common chain being very useful for regression testing. Andresen is willing to contribute pull requests in that direction.Stefan Thomas expressed his gratitude towards Gavin for adding data-driven test cases, emphasizing their usefulness. Jeff Garzik responded with agreement, stating that these test cases are a useful cross-platform tool. The conversation also touched upon the validity of a script involving OP_WITHIN and the addition of more data-driven test cases to bitcoin scripts.The post discusses the evaluation of a script containing three values, "1 0 1" and "WITHIN NOT". The first value (1) is tested to ensure it falls between the lower (0) and upper (1) values. This evaluates to true, resulting in a single byte of [01] being placed on the stack. The NOT operator then inverses this, resulting in a 0 byte false value of []. However, the context does not provide enough information to determine whether or not the script is valid.Overall, the discussion revolves around Gavin Andresen's interest in porting more tests to a data-driven format and his request for ideas on simplifying check*sig tests. The usefulness of data-driven test cases is acknowledged, and there is a query regarding the validity of a specific script.
Updated on: 2023-08-01T03:51:00.749287+00:00