DeckerSU / zebra

An ongoing Rust implementation of a Zcash node. 🦓
Apache License 2.0
0 stars 0 forks source link

InvalidDifficultyThreshold? #5

Open DeckerSU opened 2 years ago

DeckerSU commented 2 years ago

Error

only called after inserting a block

Metadata

key value
version 1.0.0-alpha.16+968.gd1430fd
Zcash network Mainnet
state version 25
branch komodo
git commit d1430fd
commit timestamp 2022-10-06T14:19:35Z
target triple x86_64-unknown-linux-gnu
build profile debug
location zebra-state/src/service/non_finalized_state.rs:312:14

SpanTrace

``` SpanTrace: 0: zebra_state::service::state at zebra-state/src/service.rs:609 1: zebrad::components::sync::obtain_tips at zebrad/src/components/sync.rs:508 2: zebrad::components::sync::try_to_sync at zebrad/src/components/sync.rs:433 3: zebrad::components::sync::sync at zebrad/src/components/sync.rs:400 4: zebrad::application:: with zebrad="d1430fd" net="Main" at zebrad/src/application.rs:397 ```

Block before:

2022-10-06T23:40:16.895241Z  WARN {zebrad="d1430fd" net="Main"}:sync:try_to_sync: zebrad::components::sync: error downloading and verifying block e=Invalid { error: Block(Commit(CloneError { source: CommitBlockError(InvalidDifficultyThreshold { difficulty_threshold: CompactDifficulty(0x1d01fe5b, Some(ExpandedDifficulty("00000001fe5b0000000000000000000000000000000000000000000000000000"))), expected_difficulty: CompactDifficulty(0x1d017a62, Some(ExpandedDifficulty("000000017a620000000000000000000000000000000000000000000000000000"))) }) })), height: Height(3025602), hash: block::Hash("0000000078426135b855b0fdb62fb8bfb7d2faf801340b79cf0cf1c35b935f3c") }

Block: #3025602 0000000078426135b855b0fdb62fb8bfb7d2faf801340b79cf0cf1c35b935f3c

0000000078426135b855b0fdb62fb8bfb7d2faf801340b79cf0cf1c35b935f3c
00000001fe5b0000000000000000000000000000000000000000000000000000 - difficulty_threshold
000000017a620000000000000000000000000000000000000000000000000000 - expected_difficulty
dimxy commented 2 years ago

The reason for this error is that PRE_BLOSSOM_POW_TARGET_SPACING param currently set for zcash as 150 should be changed to 60 sec for komodo

DeckerSU commented 2 years ago

Also, I reverted difficulty stub commit, will test sync from scratch now.