Page MenuHomePhabricator

Revert "refactor: Treat CDataStream bytes as uint8_t"
AbandonedPublic

Authored by Fabien on Nov 28 2023, 14:11.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

This reverts commit 5e862abc23cca1f0f82feb6f174abda0d52db4e5.

Unfortunately this doesn't play nicely with the seeder and needs further investigation. Let's revert in the meantime.

This is not 100% a clean revert:

  • We need a few casts in the script_tests to accomodate for the pointer type being reverted.
  • The CDataStream constructor from a const uint8_t Span is kept for compatibility with the new code.
Test Plan
ninja all check-all

Diff Detail

Event Timeline

Fabien requested review of this revision.Nov 28 2023, 14:11

Tail of the build log:

[431/489] bitcoin: testing fs_tests
[432/489] bitcoin: testing inv_tests
[433/489] bitcoin: testing checkpoints_tests
[434/489] Running utility command for check-bitcoin-fs_tests
[435/489] Running utility command for check-bitcoin-inv_tests
[436/489] Running utility command for check-bitcoin-checkpoints_tests
[437/489] bitcoin: testing blockfilter_tests
[438/489] bitcoin: testing key_io_tests
[439/489] Running utility command for check-bitcoin-blockfilter_tests
[440/489] bitcoin: testing sigencoding_tests
[441/489] Running utility command for check-bitcoin-key_io_tests
[442/489] bitcoin: testing scheduler_tests
[443/489] Running utility command for check-bitcoin-sigencoding_tests
[444/489] Running utility command for check-bitcoin-scheduler_tests
[445/489] bitcoin: testing script_tests
[446/489] bitcoin: testing scriptpubkeyman_tests
[447/489] Running utility command for check-bitcoin-script_tests
[448/489] Running utility command for check-bitcoin-scriptpubkeyman_tests
[449/489] bitcoin: testing walletdb_tests
[450/489] bitcoin: testing intmath_tests
[451/489] Running utility command for check-bitcoin-walletdb_tests
[452/489] bitcoin: testing txvalidationcache_tests
[453/489] Running utility command for check-bitcoin-intmath_tests
[454/489] Running utility command for check-bitcoin-txvalidationcache_tests
[455/489] bitcoin: testing logging_tests
[456/489] Running utility command for check-bitcoin-logging_tests
[457/489] bitcoin: testing psbt_wallet_tests
[458/489] Running utility command for check-bitcoin-psbt_wallet_tests
[459/489] bitcoin: testing denialofservice_tests
[460/489] Running utility command for check-bitcoin-denialofservice_tests
[461/489] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[462/489] bitcoin: testing crypto_tests
[463/489] bitcoin: testing merkle_tests
[464/489] bitcoin: testing init_tests
[465/489] Running utility command for check-bitcoin-crypto_tests
[466/489] Running utility command for check-bitcoin-merkle_tests
[467/489] Running utility command for check-bitcoin-init_tests
[468/489] bitcoin: testing cuckoocache_tests
[469/489] bitcoin: testing rcu_tests
[470/489] Running utility command for check-bitcoin-cuckoocache_tests
[471/489] Running utility command for check-bitcoin-rcu_tests
[472/489] bitcoin: testing coinstatsindex_tests
[473/489] Running utility command for check-bitcoin-coinstatsindex_tests
[474/489] bitcoin: testing wallet_crypto_tests
[475/489] Running utility command for check-bitcoin-wallet_crypto_tests
[476/489] bitcoin: testing txrequest_tests
[477/489] Running utility command for check-bitcoin-txrequest_tests
[478/489] bitcoin: testing blockcheck_tests
[479/489] Running utility command for check-bitcoin-blockcheck_tests
[480/489] bitcoin: testing coinselector_tests
[481/489] Running utility command for check-bitcoin-coinselector_tests
[482/489] bitcoin: testing wallet_tests
[483/489] Running utility command for check-bitcoin-wallet_tests
[484/489] bitcoin: testing transaction_tests
[485/489] Running utility command for check-bitcoin-transaction_tests
[486/489] bitcoin: testing coins_tests
[487/489] Running utility command for check-bitcoin-coins_tests
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1

Tail of the build log:

[424/482] Running utility command for check-bitcoin-script_tests
[425/482] bitcoin: testing fs_tests
[426/482] bitcoin: testing checkpoints_tests
[427/482] bitcoin: testing txvalidationcache_tests
[428/482] Running utility command for check-bitcoin-fs_tests
[429/482] Running utility command for check-bitcoin-checkpoints_tests
[430/482] Running utility command for check-bitcoin-txvalidationcache_tests
[431/482] bitcoin: testing crypto_tests
[432/482] bitcoin: testing cuckoocache_tests
[433/482] Running utility command for check-bitcoin-crypto_tests
[434/482] bitcoin: testing blockfilter_tests
[435/482] bitcoin: testing key_io_tests
[436/482] Running utility command for check-bitcoin-cuckoocache_tests
[437/482] Running utility command for check-bitcoin-blockfilter_tests
[438/482] Running utility command for check-bitcoin-key_io_tests
[439/482] bitcoin: testing scheduler_tests
[440/482] Running utility command for check-bitcoin-scheduler_tests
[441/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/paymentservertests.cpp.o
[442/482] bitcoin: testing scriptpubkeyman_tests
[443/482] Running utility command for check-bitcoin-scriptpubkeyman_tests
[444/482] bitcoin: testing walletdb_tests
[445/482] Running utility command for check-bitcoin-walletdb_tests
[446/482] bitcoin: testing merkle_tests
[447/482] Running utility command for check-bitcoin-merkle_tests
[448/482] bitcoin: testing psbt_wallet_tests
[449/482] Running utility command for check-bitcoin-psbt_wallet_tests
[450/482] bitcoin: testing coinstatsindex_tests
[451/482] bitcoin: testing logging_tests
[452/482] Running utility command for check-bitcoin-coinstatsindex_tests
[453/482] Running utility command for check-bitcoin-logging_tests
[454/482] bitcoin: testing miner_tests
[455/482] Running utility command for check-bitcoin-miner_tests
[456/482] bitcoin: testing denialofservice_tests
[457/482] Running utility command for check-bitcoin-denialofservice_tests
[458/482] bitcoin: testing init_tests
[459/482] Running utility command for check-bitcoin-init_tests
[460/482] bitcoin: testing rcu_tests
[461/482] Running utility command for check-bitcoin-rcu_tests
[462/482] bitcoin: testing wallet_crypto_tests
[463/482] Running utility command for check-bitcoin-wallet_crypto_tests
[464/482] bitcoin: testing txrequest_tests
[465/482] Running utility command for check-bitcoin-txrequest_tests
[466/482] bitcoin: testing blockcheck_tests
[467/482] Running utility command for check-bitcoin-blockcheck_tests
[468/482] bitcoin: testing coinselector_tests
[469/482] Running utility command for check-bitcoin-coinselector_tests
[470/482] bitcoin: testing wallet_tests
[471/482] Running utility command for check-bitcoin-wallet_tests
[472/482] bitcoin: testing transaction_tests
[473/482] Running utility command for check-bitcoin-transaction_tests
[474/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/addressbooktests.cpp.o
[475/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/wallettests.cpp.o
[476/482] Linking CXX executable src/qt/test/test_bitcoin-qt
[477/482] bitcoin: testing coins_tests
[478/482] Running utility command for check-bitcoin-coins_tests
[479/482] bitcoin-qt: testing test_bitcoin-qt
[480/482] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Tail of the build log:

chronik_block_info.py                      | ○ Skipped | 0 s
chronik_block_txs.py                       | ○ Skipped | 0 s
chronik_blockchain_info.py                 | ○ Skipped | 0 s
chronik_blocks.py                          | ○ Skipped | 0 s
chronik_chronik_info.py                    | ○ Skipped | 0 s
chronik_disallow_prune.py                  | ○ Skipped | 0 s
chronik_pause.py                           | ○ Skipped | 0 s
chronik_raw_tx.py                          | ○ Skipped | 0 s
chronik_resync.py                          | ○ Skipped | 0 s
chronik_script_confirmed_txs.py            | ○ Skipped | 0 s
chronik_script_history.py                  | ○ Skipped | 0 s
chronik_script_unconfirmed_txs.py          | ○ Skipped | 0 s
chronik_script_utxos.py                    | ○ Skipped | 0 s
chronik_serve.py                           | ○ Skipped | 0 s
chronik_spent_by.py                        | ○ Skipped | 0 s
chronik_tx.py                              | ○ Skipped | 0 s
chronik_ws.py                              | ○ Skipped | 0 s
chronik_ws_script.py                       | ○ Skipped | 0 s
feature_bind_port_discover.py              | ○ Skipped | 0 s
feature_bind_port_externalip.py            | ○ Skipped | 0 s
interface_usdt_net.py                      | ○ Skipped | 0 s
interface_usdt_utxocache.py                | ○ Skipped | 0 s
interface_usdt_validation.py               | ○ Skipped | 0 s

ALL                                        | ✓ Passed  | 2198 s (accumulated) 
Runtime: 440 s

[163/490] Test Bitcoin RPC authentication...
...
----------------------------------------------------------------------
Ran 3 tests in 0.005s

OK
[253/490] bitcoin: testing net_tests
FAILED: src/test/CMakeFiles/check-bitcoin-net_tests 
cd /work/abc-ci-builds/build-debug/src/test && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-debug/test/junit && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-debug/test/log && /usr/bin/cmake -E env /work/cmake/utils/log-and-print-on-failure.sh /work/abc-ci-builds/build-debug/test/log/bitcoin-net_tests.log /work/abc-ci-builds/build-debug/src/test/test_bitcoin --run_test=net_tests --logger=HRF,message:JUNIT,message,bitcoin-net_tests.xml --catch_system_errors=no
Running 18 test cases...
unknown location(0): fatal error: in "net_tests/initial_advertise_from_version_message": std::ios_base::failure[abi:cxx11]: CDataStream::read(): end of data: iostream error
../../src/test/net_tests.cpp(1261): last checkpoint: "initial_advertise_from_version_message" test entry

*** 1 failure is detected in the test module "Bitcoin ABC unit tests"
[380/490] Running secp256k1 test suite
PASSED: secp256k1 test suite
[446/490] Running pow test suite
PASSED: pow test suite
[459/490] Running seeder test suite
PASSED: seeder test suite
[460/490] cd /work/contrib/devtools/chainparams && /usr/bin/python3.9 ./test_make_chainparams.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK
[467/490] Running avalanche test suite
PASSED: avalanche test suite
[479/490] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[487/490] Running utility command for check-bitcoin-coins_tests
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1
Fabien planned changes to this revision.Nov 28 2023, 14:56

I found a proper fix