Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that mainnet test doesn't call the internet #76

Open
wants to merge 16 commits into
base: 2024/12/gettarget
Choose a base branch
from

Conversation

Sjors
Copy link
Owner

@Sjors Sjors commented Jan 13, 2025

This tests the combination of bitcoin#31583 and bitcoin#31349.

@Sjors
Copy link
Owner Author

Sjors commented Jan 13, 2025

[12:31:33.726] 100% tests passed, 0 tests failed out of 138
[12:31:33.726] 
[12:31:33.726] Total Test time (real) = 384.95 sec
[12:31:33.738] + traffic_monitor_end unitparallel
[12:31:33.738] + test_name=unitparallel
[12:31:33.740] ++ get_interfaces
[12:31:33.740] ++ set -o pipefail
[12:31:33.741] ++ ifconfig
[12:31:33.742] ++ awk -F ':| ' '/^[^[:space:]]/ { if (!match($1, /^lo/)) { print $1 } }'
[12:31:33.763] ++ set +o pipefail
[12:31:33.765] + for ifname in $(get_interfaces)
[12:31:33.766] ++ tcpdump_file unitparallel eth0
[12:31:33.767] ++ echo /tmp/tcpdump_unitparallel_eth0
[12:31:33.769] + f=/tmp/tcpdump_unitparallel_eth0
[12:31:33.769] + '[' '!' -e /tmp/tcpdump_unitparallel_eth0 ']'
[12:31:33.769] + '[' '' = 1 ']'
[12:31:33.769] + chown root:root /tmp/tcpdump_unitparallel_eth0
[12:31:33.786] chown: /tmp/tcpdump_unitparallel_eth0: No such file or directory

cc @vasild
https://cirrus-ci.com/task/6013424313827328?logs=ci#L4616

The ARM test runs in qemu on my x86_64 machine, perhaps that's related?

@Sjors Sjors force-pushed the 2024/12/gettarget branch 2 times, most recently from 0f0cec9 to 8502e6e Compare January 14, 2025 09:00
@Sjors Sjors force-pushed the 2025/01/gettarget-tcpdump branch from b57a5ce to 815b2f0 Compare January 15, 2025 08:49
@Sjors Sjors changed the base branch from 2024/12/gettarget to master January 15, 2025 08:50
@Sjors
Copy link
Owner Author

Sjors commented Jan 15, 2025

I pushed a rebased version of bitcoin#31583 to account for the merged tests in bitcoin#31646.

@Sjors Sjors force-pushed the 2025/01/gettarget-tcpdump branch 2 times, most recently from 292ff86 to bb8a470 Compare January 15, 2025 08:52
Sjors and others added 15 commits January 15, 2025 09:58
Split CheckProofOfWorkImpl() to introduce a helper function
DeriveTarget() which converts the nBits value to the target.

The function takes pow_limit as an argument so later commits can
avoid having to pass ChainstateManager through the call stack.

Co-authored-by: Ryan Ofsky <[email protected]>
The next commit needs pow.cpp in rpc/util.cpp.
Also expands nBits test coverage.
Obtain the difficulty / target for the next block without having to call getblocktemplate.
For blocks 1 through 15 the script_BIP34_coinbase_height appends OP_1
to comply with BIP34 and avoid bad-cb-length.

This is inconsistent with BlockAssembler::CreateNewBlock() which adds
OP_0 instead.

The utxo_total_supply fuzzer and MinerTestingSetup::Block also use OP_0.

Changing it is required to import the test vectors in the next commit.

It also ensures the test vectors can be regenerated using the CPU miner
at https://github.com/pooler/cpuminer without patches (it uses OP_0).

The same helper is used by the signet miner, so this will impact newly
bootstrapped signets.
@Sjors Sjors changed the base branch from master to 2024/12/gettarget January 15, 2025 09:03
@Sjors Sjors force-pushed the 2025/01/gettarget-tcpdump branch from bb8a470 to 757e4ff Compare January 15, 2025 09:04
@vasild
Copy link

vasild commented Jan 15, 2025

Before the tests:

[12:25:08.705] + tcpdump -nU -i eth0 -w /tmp/tcpdump_unitparallel_eth0
[12:25:08.722] tcpdump: eth0: SIOCETHTOOL(ETHTOOL_GET_TS_INFO) ioctl failed: Inappropriate ioctl for device

and that VM is not flagged as CI_TCPDUMP_OK_TO_FAIL, thus the failure. I guess ci/test/00_setup_env_arm.sh warrants this patch:

--- i/ci/test/00_setup_env_arm.sh
+++ w/ci/test/00_setup_env_arm.sh
@@ -15,6 +15,8 @@ export USE_BUSY_BOX=true
 export RUN_UNIT_TESTS=true
 export RUN_FUNCTIONAL_TESTS=false
 export GOAL="install"
 # -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1"
 # This could be removed once the ABI change warning does not show up by default
 export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DCMAKE_CXX_FLAGS='-Wno-psabi -Wno-error=maybe-uninitialized'"
+# Can't run tcpdump: tcpdump: eth0: SIOCETHTOOL(ETHTOOL_GET_TS_INFO) ioctl failed: Inappropriate ioctl for device
+export CI_TCPDUMP_OK_TO_FAIL=1

but only in this environment (qemu), not on master which runs on Cirrus... hmm...

@Sjors
Copy link
Owner Author

Sjors commented Jan 15, 2025

I'll try setting CI_TCPDUMP_OK_TO_FAIL=1 as an env variable on my CI and run again. It should be enough to have instruction for that in the .cirrus.yml, where it suggests using qemu.

https://cirrus-ci.com/task/6101745434099712

Update: that worked.

@Sjors Sjors force-pushed the 2024/12/gettarget branch from 712e3ff to 39eabfa Compare January 16, 2025 09:22
@Sjors Sjors force-pushed the 2024/12/gettarget branch 3 times, most recently from d4fe21c to a4df123 Compare January 22, 2025 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants