Since fad2991ba073de0bd1f12e42bf0fbaca4a265508, uint256S
has been deprecated because it is less robust than the base_blob::FromHex()
introduced in the same PR. Specifically, it tries to recover from length-mismatches, recover from untrimmed whitespace, 0x-prefix and garbage at the end, instead of simply requiring exactly 64 hex-only characters. (see also #30532)
This PR carves out the few uint256S
callsites that may potentially prove a bit more controversial to change because they deal with user input and backwards incompatible behaviour change.
The main behaviour change introduced in this PR is:
-minimumchainwork
will raise an error when input is longer than 64 hex digits-assumevalid
will raise an error when input contains invalid hex characters, or when it is longer than 64 hex digits- test: the optional RANDOM_CTX_SEED env var will now cause tests to abort when it contains invalid hex characters, or when it is longer than 64 hex digits
After this PR, the remaining work to remove uint256S
completely is almost entirely mechanical and/or test related. I will open that PR once #30560 is merged because it builds on that.