Repository navigation
Conversation
added 3 commits
September 25, 2012 16:40
…nd OP_XOR. Due to a bug in the implementation of MakeSameSize(), using OP_AND, OP_OR, or OP_XOR with signed values of unequal size will result in the sign-value becoming part of the smaller integer, with nonsensical results. This patch documents the unexpected behavior and provides the basis of a solution should decision be made to fix the bug in the future.
…meSize(), which was only used by the disabled opcodes).
…aken and the previously disabled, now unused opcodes are executed.
Contributor
|
NACK. Changing the behavior of VerifyScript in any detectable way is unacceptable, because of the risk of a blockchain fork. |
Contributor
Author
|
This can't lead to a blockchain fork. These opcodes aren't on mainnet, and wouldn't be accepted on mainnet anyway by any existing client. They would be illegal before the change, and they would be illegal after the change. It only changes the behavior of a hypothetical client that relaxes IsStandard() script restrictions. |
Contributor
|
IsStandard() is not relevant to this discussion. Transactions may appear in the blockchain, even if they fail IsStandard(). The set of acceptable behaviors is much larger than the set of relay-able IsStandard() behaviors. |
Contributor
Author
|
Ok understood. |
KolbyML
pushed a commit
to KolbyML/bitcoin
that referenced
this pull request
Dec 5, 2020
7723a0a CI: Check scripted diffs in Travis (Fuzzbawls) b401d55 Fix outliers not covered by the scripted diff (Fuzzbawls) 92c8273 scripted-diff: Use UniValue.pushKV instead of push_back(Pair()) (Fuzzbawls) 3d9f028 Squashed 'src/univalue/' changes from dac5296759..98261b1e7b (Fuzzbawls) Pull request description: The pervious usage of `push_back(Pair())` was needed for compatibility with the old json spirit library, which we transitioned away from quite a while ago in favor of Univalue. Univalue provides a more convenient method for pushing key/value pairs into a JSON object or array in the form of `pushKV()`, which is easier to read and leads to shorter code segments. This PR first updates our univalue subtree with upstream, which has removed the now-unneeded declaration methods for `push_back(Pair())`, as well as patch a bug with `pushKV()` being supplied with a boolean instead of an integer argument. 92c8273 handles the majority of the work to replace usages of `push_back(Pair())` with `pushKV()` with a reproducible shell command. b401d55 takes care of 3 instances that were not picked up in the previous commit due to multiline code 7723a0a finally, this commit adds the scripted-diff verification linter to TravisCI for future use. Note: Depending on merge order, existing open PRs may "leak" new or conflicting introductions of `push_back(Pair())` ACKs for top commit: random-zebra: rebase ut-ACK 7723a0a furszy: utACK 7723a0a Tree-SHA512: c8e738ced0f561fc9d79f22179553e19fd9a5271e22d3d4885032098b90e08053f7030146f40fdd9a6477106561ba728093b986b09a7cd0b7aceabf305ed7ec4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch removes the disabled opcodes and the one dependent utility function that is orphaned.
Interestingly there appears to be a slight difference in behavior between explicitly disabled opcodes and reserved/unused opcodes. Previously VerifyScript() would fail any script containing a disabled opcode as soon as it is encountered, whereas reserved/unused opcodes would fail when they are executed. This is a subtle difference, but detectable. Take the following script from the invalid-script unit tests:
This previously failed even though the INVERT is never executed. But now that the disabled opcodes are removed entirely, INVERT becomes 0x83 and is treated like any other unused opcode, meaning that script now passes validation. To fail, the IF-branch of the conditional would have to be taken:
The last commit of this pull request simply switches the branch taken in this and other unit tests such that the opcode is executed and fails.
However the construction of the unit test clearly indicates that failure even if the opcode is not executed was the desired result. A decision still needs to be made as to whether this behavior should be extended to all reserved/unused opcodes.