Revertron / Alfis

Alternative Free Identity System
https://alfis.name
GNU Affero General Public License v3.0
307 stars 27 forks source link

Test blockchain::chain::tests::load_and_check fails, unless using Cargo #312

Open emixa-d opened 2 years ago

emixa-d commented 2 years ago

I'm getting a test failure when building without Cargo:

running 23 tests
test blockchain::hash_utils::tests::test_hash ... ignored
test blockchain::hash_utils::tests::test_hash_is_good ... ignored
test bytes::tests::test_deref ... ok
08:04:36.456 [TRACE] alfis::dns::client: Using bootstraps: []
test bytes::tests::test_tail_bytes ... ok
test commons::test::test_check_domain ... ok
test dns::hosts::tests::load_hosts ... ignored
test commons::test::test_is_yggdrasil ... ok
08:04:36.457 [TRACE] alfis::dns::client: Using bootstraps: []
test dns::buffer::tests::test_write_qname ... ok
test dns::buffer::tests::test_qname ... ok
test dns::protocol::tests::test_packet ... ok
test crypto::chacha::tests::test_chacha ... ok
08:04:36.457 [TRACE] alfis::dns::client: Using bootstraps: []
08:04:36.457 [TRACE] alfis::dns::client: Using bootstraps: []
08:04:36.457 [TRACE] alfis::dns::client: Using bootstraps: []
08:04:36.457 [TRACE] alfis::dns::client: Using bootstraps: []
08:04:36.457 [TRACE] alfis::dns::server: Resolving: google.com, type A
test dns::resolve::tests::test_recursive_resolver_with_no_nameserver ... ok
08:04:36.457 [TRACE] alfis::dns::server: Resolving: www.facebook.com, type CNAME
08:04:36.457 [TRACE] alfis::dns::server: Resolving: www.microsoft.com, type CNAME
test dns::resolve::tests::test_forwarding_resolver ... ok
test dns::resolve::tests::test_recursive_resolver_with_missing_a_record ... ok
test dns::resolve::tests::test_recursive_resolver_match_order ... ok
test dns::resolve::tests::test_recursive_resolver_successfully ... ok
test keystore::tests::test_signature ... ok
08:04:36.457 [TRACE] alfis::dns::server: Resolving: yahoo.com, type A
08:04:36.457 [TRACE] alfis::dns::client: Using bootstraps: []
08:04:36.457 [TRACE] alfis::dns::server: Resolving: yahoo.com, type A
08:04:36.457 [ERROR] alfis::dns::server: Failed to resolve A yahoo.com: Client(Io(Custom { kind: NotFound, error: "Fail" }))
test dns::server::tests::test_execute_query ... ok
08:04:36.457 [DEBUG] alfis::blockchain::chain: Loaded last block: Block { index: 149, timestamp: 1620995471, version: 1, difficulty: 16, random: 1463594028, nonce: 721, hash: 099AC3782DCDC7969576DD23051A65C302BD13E762D0DE9BDD37AAF904E6A000, prev_block_hash: 4D43074D808A68AB43316E2FC890F3BBAF7BF67198076B63DB1B41A9EEEF0000, pub_key: 268E47DD5268A2EA8BC36668D2E00594E76ACD5CACA7CBBAB9F6E63BF75C4A82, signature: 3A841A49FD0E94FA6FC35978347577FEBE54766A388C6194AE48F3E8F7EEE864585E4F6D11A7A67D883C49C83CF178D2CFA683F7073B38956E5F795569C06A05, transaction: None, hash_good: RefCell { value: false } }
08:04:36.457 [INFO ] alfis::blockchain::chain: Local blockchain height is 149, starting full blockchain check...
08:04:36.457 [DEBUG] alfis::blockchain::chain: Checking block 1
test crypto::crypto_box::tests::hide_reveal ... ok
08:04:36.457 [DEBUG] alfis::blockchain::chain: Block 1 with hash 0000001D2A77D63477172678502E51DE7F346061FF7EB188A2445ECA3FC0780E is good!
08:04:36.457 [DEBUG] alfis::blockchain::chain: Checking block 2
08:04:36.457 [DEBUG] alfis::blockchain::chain: Loaded last block: Block { index: 149, timestamp: 1620995471, version: 1, difficulty: 16, random: 1463594028, nonce: 721, hash: 099AC3782DCDC7969576DD23051A65C302BD13E762D0DE9BDD37AAF904E6A000, prev_block_hash: 4D43074D808A68AB43316E2FC890F3BBAF7BF67198076B63DB1B41A9EEEF0000, pub_key: 268E47DD5268A2EA8BC36668D2E00594E76ACD5CACA7CBBAB9F6E63BF75C4A82, signature: 3A841A49FD0E94FA6FC35978347577FEBE54766A388C6194AE48F3E8F7EEE864585E4F6D11A7A67D883C49C83CF178D2CFA683F7073B38956E5F795569C06A05, transaction: None, hash_good: RefCell { value: false } }
08:04:36.457 [WARN ] alfis::blockchain::chain: Error parsing DomainData from Transaction { class: "domain", identity: A2F01B73E289FFDA8418E2C48CDA12E5B08BF71D692C6793E52E158B44C73149, confirmation: FF08256BD9FC21F87FFA1CB594F63233A46289096E063F86D2B8B4CE5649BFDD, signing: 6E2482A41083C1F4A29EC8126AFAD4EC2F9E8390826DA4523E7783AA5B3464FF, encryption: 3137525B480FD3F6A5724B777C2D4EA5871CEEE4A2DD4D380EC366E58708E60E, data: "{\"encrypted\":\"BB4F313D7365142A43A1573F3638C28BD2D3BF8061375C379A2FC93647184265CD5E7B52688657C03350EC0AF99A31638C316F968FE9AF1741C6A1676842FC8F8758A73A\",\"zone\":\"ygg\",\"records\":[{\"type\":\"AAAA\",\"domain\":\"@\",\"addr\":\"301:2923::1\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"*\",\"addr\":\"301:2923::1\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"test1\",\"addr\":\"300::1\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"test2\",\"addr\":\"300::2\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"test3\",\"addr\":\"300::3\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"test4\",\"addr\":\"300::4\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"test5\",\"addr\":\"300::5\",\"ttl\":3600}]}" }
08:04:36.457 [WARN ] alfis::blockchain::chain: Block difficulty is lower than needed: 24 < 4294967295
08:04:36.457 [ERROR] alfis::blockchain::chain: Block 2 is bad:
Block { index: 2, timestamp: 1620520297, version: 1, difficulty: 24, random: 326969696, nonce: 104109, hash: 8713EB989FF526ADEE0EEC744B8BC72CA41815D6AD9627135372CD9E91000000, prev_block_hash: 0000001D2A77D63477172678502E51DE7F346061FF7EB188A2445ECA3FC0780E, pub_key: 6E2482A41083C1F4A29EC8126AFAD4EC2F9E8390826DA4523E7783AA5B3464FF, signature: C70D7CBDEDF387A90947840C9A3AF89CB1C7C58C4B1BCE1D6784C4879DA250969E27E85CF60232CE10BA8C5CEF1E262A8CB4147F11B38BC9CBC45CCAE3F0E809, transaction: Some(Transaction { class: "domain", identity: A2F01B73E289FFDA8418E2C48CDA12E5B08BF71D692C6793E52E158B44C73149, confirmation: FF08256BD9FC21F87FFA1CB594F63233A46289096E063F86D2B8B4CE5649BFDD, signing: 6E2482A41083C1F4A29EC8126AFAD4EC2F9E8390826DA4523E7783AA5B3464FF, encryption: 3137525B480FD3F6A5724B777C2D4EA5871CEEE4A2DD4D380EC366E58708E60E, data: "{\"encrypted\":\"BB4F313D7365142A43A1573F3638C28BD2D3BF8061375C379A2FC93647184265CD5E7B52688657C03350EC0AF99A31638C316F968FE9AF1741C6A1676842FC8F8758A73A\",\"zone\":\"ygg\",\"records\":[{\"type\":\"AAAA\",\"domain\":\"@\",\"addr\":\"301:2923::1\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"*\",\"addr\":\"301:2923::1\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"test1\",\"addr\":\"300::1\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"test2\",\"addr\":\"300::2\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"test3\",\"addr\":\"300::3\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"test4\",\"addr\":\"300::4\",\"ttl\":3600},{\"type\":\"AAAA\",\"domain\":\"test5\",\"addr\":\"300::5\",\"ttl\":3600}]}" }), hash_good: RefCell { value: false } }
08:04:36.457 [INFO ] alfis::blockchain::chain: Truncating database from block 2...
test blockchain::chain::tests::check_serde ... ok
08:04:36.485 [DEBUG] alfis::blockchain::chain: Loaded last block: Block { index: 1, timestamp: 1620509674, version: 1, difficulty: 28, random: 3044569081, nonce: 58784, hash: 0000001D2A77D63477172678502E51DE7F346061FF7EB188A2445ECA3FC0780E, prev_block_hash: , pub_key: 9B890FBB8B862CCC12EA18E2F93D5D43103BE217D90FA1B296351C9C27B1BDA3, signature: CC4C06DA2F174A6CE2556C5B4D1539218EFB396F8BBBE0FE3B2D4332E1E1C4BB48AC92D70BC16AF1E55E74900AFD53B79A4BC45377665FB434AE9610168D2409, transaction: Some(Transaction { class: "origin", identity: , confirmation: , signing: 9B890FBB8B862CCC12EA18E2F93D5D43103BE217D90FA1B296351C9C27B1BDA3, encryption: 61899D093FBA4D2F0A5F4E523B26C597ACACEFE4BA41F9CA73DB652598433097, data: "{\"zones\":\"C995CDCE7000ECC89FB9B942E78CC7C5F0D8B03B35B0E835B510D756356CAD12\"}" }), hash_good: RefCell { value: false } }
08:04:36.485 [DEBUG] alfis::blockchain::chain: Last block after chain check: Some(Block { index: 1, timestamp: 1620509674, version: 1, difficulty: 28, random: 3044569081, nonce: 58784, hash: 0000001D2A77D63477172678502E51DE7F346061FF7EB188A2445ECA3FC0780E, prev_block_hash: , pub_key: 9B890FBB8B862CCC12EA18E2F93D5D43103BE217D90FA1B296351C9C27B1BDA3, signature: CC4C06DA2F174A6CE2556C5B4D1539218EFB396F8BBBE0FE3B2D4332E1E1C4BB48AC92D70BC16AF1E55E74900AFD53B79A4BC45377665FB434AE9610168D2409, transaction: Some(Transaction { class: "origin", identity: , confirmation: , signing: 9B890FBB8B862CCC12EA18E2F93D5D43103BE217D90FA1B296351C9C27B1BDA3, encryption: 61899D093FBA4D2F0A5F4E523B26C597ACACEFE4BA41F9CA73DB652598433097, data: "{\"zones\":\"C995CDCE7000ECC89FB9B942E78CC7C5F0D8B03B35B0E835B510D756356CAD12\"}" }), hash_good: RefCell { value: false } })
test blockchain::chain::tests::load_and_check ... FAILED
test commons::simplebus::tests::test1 ... ok
test dns::cache::tests::test_cache ... ok

failures:

---- blockchain::chain::tests::load_and_check stdout ----
thread 'blockchain::chain::tests::load_and_check' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `149`', src/blockchain/chain.rs:1136:9
stack backtrace:
   0:     0x7ffff7cff95b - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h190bc4e71a974fd5
   1:     0x7ffff7d5acfc - core::fmt::write::h5ab597cdd0c00db2
   2:     0x7ffff7cb8701 - <unknown>
   3:     0x7ffff7cdbc6e - <unknown>
   4:     0x7ffff7cdb952 - std::panicking::default_hook::hcffd5d909668cc52
   5:     0x7ffff7cdc2ae - std::panicking::rust_panic_with_hook::h67db5ff340e389bf
   6:     0x7ffff7d00277 - <unknown>
   7:     0x7ffff7cffa74 - <unknown>
   8:     0x7ffff7cdbdb2 - rust_begin_unwind
   9:     0x7ffff7cadff3 - core::panicking::panic_fmt::h4b9cfd185dab4fab
  10:     0x7ffff7d5e098 - core::panicking::assert_failed_inner::h93b1d9d94cf5a7fc
  11:     0x55555559e1db - core::panicking::assert_failed::h1264aa6a673ae4fc
                               at /tmp/guix-build-rust-1.60.0.drv-0/rustc-1.60.0-src/library/core/src/panicking.rs:182:5
  12:     0x5555555c6b7d - alfis::blockchain::chain::tests::load_and_check::hf6bc399ca7bc5fcf
                               at /tmp/guix-build-antioxidated-alfis-0.8.2.drv-0/source/src/blockchain/chain.rs:1136:9
  13:     0x7ffff7e20723 - <unknown>
  14:     0x7ffff7e208e4 - <unknown>
  15:     0x7ffff7e1380d - <unknown>
  16:     0x7ffff7e34d2f - <unknown>
  17:     0x7ffff7cd4233 - <unknown>
  18:     0x7ffff79b93aa - start_thread
  19:     0x7ffff7a39f7c - clone3
  20:                0x0 - <unknown>

failures:
    blockchain::chain::tests::load_and_check

test result: FAILED. 19 passed; 1 failed; 3 ignored; 0 measured; 2 filtered out; finished in 1.00s

For another test failure I encountered, downgrading the dependencies to what's in the Cargo.toml solved things, but not for this one.

emixa-d commented 2 years ago

(When building with Cargo, the test failure disappears)