Implementation of OP_REVERSEBYTES is very straightforward. T707.
Previously named OP_REVERSE, then OP_BSWAP, then OP_ENDIAN_REVERSE.
Differential D4871
Added OP_REVERSEBYTES+implementation, added (always disabled) activation flag tobias_ruck on Jan 8 2020, 19:19. Authored by
Details
Implementation of OP_REVERSEBYTES is very straightforward. T707. Previously named OP_REVERSE, then OP_BSWAP, then OP_ENDIAN_REVERSE. Tests listed in the OP_REVERSEBYTES PR: https://github.com/EyeOfPython/bitcoincash.org/blob/master/spec/2020-05-15-op_reversebytes.md
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes
Comment Actions I'm not a fan of the new name... "Endian" to me seems hardware specific, and usually implies some power-of-2 number of bytes.... If you're worried about confusion, using the word "Endian" to me seems more confusing. It's possible people may use for things other than endian conversion, since it can reverse the byte order for any arbitrary-length string. How about "OP_REVERSE_BYTES", or "OP_BYTE_SWAP"? In any case, I guess this is a bit bike-sheddy, so not super-important either way. Comment Actions https://github.com/bitcoincashorg/bitcoincash.org/pull/358 As BigBlockIfTrue pointed out, we should use a name that follows the same scheme existing opcodes use. I think OP_REVERSEBYTES might be the best choice here. Your argument about endianess makes sense Comment Actions Yeah the same thing was bugging me, but I couldn't quite explain what it was. (Also remember that technically there are things besides big-endian and little-endian. ;-P ) OP_REVERSEBYTES does sound nice. Comment Actions Renamed opcode to OP_REVERSEBYTES (which is the final name now), refactored & amended tests. Comment Actions Build Bitcoin-ABC / Diffs / Diff Testing failed.
Snippet of first build failure: [17:32:02] : [Update checkout directory (/home/teamcity/buildAgent/work/c4a5708f2bae7929)] /usr/bin/git config core.sparseCheckout true [17:32:02] : [Update checkout directory (/home/teamcity/buildAgent/work/c4a5708f2bae7929)] /usr/bin/git config http.sslCAInfo [17:32:02] : [Update checkout directory (/home/teamcity/buildAgent/work/c4a5708f2bae7929)] /usr/bin/git show-ref [17:32:02] : [Update checkout directory (/home/teamcity/buildAgent/work/c4a5708f2bae7929)] /usr/bin/git show-ref refs/tags/phabricator/diff/15459 [17:32:02] : [Update checkout directory (/home/teamcity/buildAgent/work/c4a5708f2bae7929)] /usr/bin/git log -n1 --pretty=format:%H%x20%s 9dc27d55a40e7fe6acb5ff7b28bdb6d54423860b -- [17:32:02] : [Update checkout directory (/home/teamcity/buildAgent/work/c4a5708f2bae7929)] /usr/bin/git -c credential.helper= checkout -q -f phabricator/diff/15459 [17:32:02] : [Update checkout directory (/home/teamcity/buildAgent/work/c4a5708f2bae7929)] /usr/bin/git show-ref refs/tags/phabricator/diff/15459 [17:32:02] : [Update checkout directory (/home/teamcity/buildAgent/work/c4a5708f2bae7929)] Cleaning Bitcoin ABC Staging in /home/teamcity/buildAgent/work/c4a5708f2bae7929 the file set ALL_UNTRACKED [17:32:02] : [Update checkout directory (/home/teamcity/buildAgent/work/c4a5708f2bae7929)] /usr/bin/git clean -f -d -x [17:32:02] : Build preparation done [17:32:02]E: Step 1/1: Command Line [17:32:02] : [Step 1/1] Ant JUnit report watcher [17:32:02] : [Ant JUnit report watcher] Watching paths: [17:32:02] : [Ant JUnit report watcher] +:build/test_bitcoin.xml [17:32:02] : [Ant JUnit report watcher] +:test/functional/junit_results.xml [17:32:02] : [Ant JUnit report watcher] +:build/junit_results*.xml [17:32:02] : [Step 1/1] Starting: /home/teamcity/buildAgent/temp/agentTmp/custom_script135283986362505923 [17:32:02] : [Step 1/1] in directory: /home/teamcity/buildAgent/work/c4a5708f2bae7929 [17:32:02] : [Step 1/1] Running build configuration 'build-diff'... [17:32:02]W: [Step 1/1] + : build-diff [17:32:02]W: [Step 1/1] + '[' -z build-diff ']' [17:32:02]W: [Step 1/1] + echo 'Running build configuration '\''build-diff'\''...' [17:32:02]W: [Step 1/1] ++ git rev-parse --show-toplevel [17:32:02]W: [Step 1/1] + TOPLEVEL=/home/teamcity/buildAgent/work/c4a5708f2bae7929 [17:32:02]W: [Step 1/1] + export TOPLEVEL [17:32:02]W: [Step 1/1] + trap print_sanitizers_log ERR [17:32:02]W: [Step 1/1] +++ dirname ./contrib/teamcity/build-configurations.sh [17:32:02]W: [Step 1/1] ++ cd ./contrib/teamcity [17:32:02]W: [Step 1/1] ++ pwd [17:32:02]W: [Step 1/1] + CI_SCRIPTS_DIR=/home/teamcity/buildAgent/work/c4a5708f2bae7929/contrib/teamcity [17:32:02]W: [Step 1/1] + setup [17:32:02]W: [Step 1/1] + : /home/teamcity/buildAgent/work/c4a5708f2bae7929/build [17:32:02]W: [Step 1/1] + mkdir -p /home/teamcity/buildAgent/work/c4a5708f2bae7929/build/output [17:32:02]W: [Step 1/1] ++ cd /home/teamcity/buildAgent/work/c4a5708f2bae7929/build [17:32:02]W: [Step 1/1] ++ pwd [17:32:02]W: [Step 1/1] + BUILD_DIR=/home/teamcity/buildAgent/work/c4a5708f2bae7929/build [17:32:02]W: [Step 1/1] + export BUILD_DIR [17:32:02]W: [Step 1/1] + TEST_RUNNER_FLAGS=--tmpdirprefix=output [17:32:02]W: [Step 1/1] + cd /home/teamcity/buildAgent/work/c4a5708f2bae7929/build [17:32:02]W: [Step 1/1] ++ nproc [17:32:02]W: [Step 1/1] + THREADS=4 [17:32:02]W: [Step 1/1] + export THREADS [17:32:02]W: [Step 1/1] + SAN_SUPP_DIR=/home/teamcity/buildAgent/work/c4a5708f2bae7929/test/sanitizer_suppressions [17:32:02]W: [Step 1/1] + SAN_LOG_DIR=/tmp/sanitizer_logs [17:32:02]W: [Step 1/1] + mkdir -p /tmp/sanitizer_logs [17:32:02]W: [Step 1/1] + rm -rf '/tmp/sanitizer_logs/*' [17:32:02]W: [Step 1/1] + export ASAN_OPTIONS=malloc_context_size=0:log_path=/tmp/sanitizer_logs/asan.log [17:32:02]W: [Step 1/1] + ASAN_OPTIONS=malloc_context_size=0:log_path=/tmp/sanitizer_logs/asan.log [17:32:02]W: [Step 1/1] + export LSAN_OPTIONS=suppressions=/home/teamcity/buildAgent/work/c4a5708f2bae7929/test/sanitizer_suppressions/lsan:log_path=/tmp/sanitizer_logs/lsan.log [17:32:02]W: [Step 1/1] + LSAN_OPTIONS=suppressions=/home/teamcity/buildAgent/work/c4a5708f2bae7929/test/sanitizer_suppressions/lsan:log_path=/tmp/sanitizer_logs/lsan.log [17:32:02]W: [Step 1/1] + export TSAN_OPTIONS=suppressions=/home/teamcity/buildAgent/work/c4a5708f2bae7929/test/sanitizer_suppressions/tsan:log_path=/tmp/sanitizer_logs/tsan.log [17:32:02]W: [Step 1/1] + TSAN_OPTIONS=suppressions=/home/teamcity/buildAgent/work/c4a5708f2bae7929/test/sanitizer_suppressions/tsan:log_path=/tmp/sanitizer_logs/tsan.log [17:32:02]W: [Step 1/1] + export UBSAN_OPTIONS=suppressions=/home/teamcity/buildAgent/work/c4a5708f2bae7929/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:log_path=/tmp/sanitizer_logs/ubsan.log [17:32:02]W: [Step 1/1] + UBSAN_OPTIONS=suppressions=/home/teamcity/buildAgent/work/c4a5708f2bae7929/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:log_path=/tmp/sanitizer_logs/ubsan.log [17:32:02]W: [Step 1/1] + case "$ABC_BUILD_NAME" in [17:32:02] : [Step 1/1] Error: Invalid build name 'build-diff' [17:32:02]W: [Step 1/1] + echo 'Error: Invalid build name '\''build-diff'\''' [17:32:02]W: [Step 1/1] + exit 2 [17:32:02]W: [Step 1/1] Process exited with code 2 [17:32:02]E: [Step 1/1] Process exited with code 2 (Step: Command Line)
Comment Actions Hey, I think @jasonbcox tweaked something in the CI, so pull the latest master and rebase your commit on that. Comment Actions Tiny quibble but otherwise good.
Comment Actions A few minor improvement, but it's getting there. You should consider starting to work on activation logic and tests.
Comment Actions @tobias_ruck Could you change the name to OP_REVERSEBYTES in the Diff title? (Also, it's not really necessary to mention tests in the title..... it should be a given that every Diff contains the appropriate tests) Comment Actions Removed empty line in interpreter.cpp. Fused loops in op_reversebytes_test.cpp and other refactorings, expanded palindromes test vector. Comment Actions One small change, but I think this is pretty much good to go.
|