Testnet, InvalidChainFound, height=1779199

Hi Zcash Dev Community!

Syncing with the testnet is not possible for my local node. Running 4.6.0-1 in a docker container.

Log messages:
2022-03-14T17:02:25.807971Z INFO main: InvalidChainFound: invalid block=0022eabf7a4a1dc158979d993cefcd3782e74111fa61e60a49110fa78ed79e88 height=1779200 log2_work=37.256427 date=2022-02-25 00:37:50
2022-03-14T17:02:25.807981Z INFO main: InvalidChainFound: current best=00429cfa6dd8176b287064a524090507eb2592d1050aa941ce19c1c2c823bd27 height=1779199 log2_work=37.256427 date=2022-02-25 00:36:27

This is how the daemon gets started:

zcashd -testnet -datadir=/ -reindex -debuglog=/testnet3/debug.log -paramsdir=/zcash-param [plus some rpc params for testing]

For me, this testnet explorer is working: Zcash Testnet (TAZ) Blocks List . There I see all my transactions from the test faucets. But since my local node is not in sync: I don’t see these txs locally.

What’s your view on that issue?

1 Like

We’re aware of this issue; it is due to a bug in zcashd’s implementation of the NU5 consensus rules, which caused some nodes (depending on what reorgs they saw) to become confused about the Orchard commitment tree state. This has been fixed in the main repository, so you can run the master branch to avoid this issue, but the way this bug affected node state means that it’s hard to sync properly. This will be fixed fully in the upcoming zcashd 4.7.0 release, which will roll back testnet to before NU5 activation to include final changes to the consensus rules (including this bugfix).

4 Likes

Thanks a lot. Do I have to build the binary from the master/main branch myself, or is there some source for the binary (linux, amd64)?

We do not have a binary for the master branch. You’d have to build it yourself. The instructions for all platforms are linked from this page and the specifics for Debian / Ubuntu can be found here.

4 Likes

Sorry, to say, but the build using the master branch is not solving anything. :unamused: - still broken.

This is the resulting version: INFO main: Zcash version v4.6.0-1-3a957618b (2022-03-14 20:32:09 -0700)

This is the docker build script:

FROM debian:stable-slim

RUN apt-get update \
  && apt-get install -y \
  build-essential \
  pkg-config \
  libc6-dev \
  m4 \
  g++-multilib \
  autoconf \
  libtool \
  ncurses-dev \
  unzip \
  git \
  python3 \
  python3-zmq \
  zlib1g-dev \
  curl \
  bsdmainutils \
  automake \
  libtinfo5 \
  && git clone https://github.com/zcash/zcash.git \
  && cd zcash/ \
  && git checkout master \
  && ./zcutil/fetch-params.sh \
  && ./zcutil/clean.sh \
  && ./zcutil/build.sh -j$(nproc) \
  && cd src \
  && strip -s zcashd \
  && strip -s zcash-cli

ENTRYPOINT ["/bin/bash"]

And this is the result in the logs:

2022-03-15T16:24:01.468062Z  INFO ProcessNewBlock: main: InvalidChainFound: invalid block=0022eabf7a4a1dc158979d993cefcd3782e74111fa61e60a49110fa78ed79e88  height=1779200  log2_work=37.256427  date=2022-02-25 00:37:50
2022-03-15T16:24:01.468071Z  INFO ProcessNewBlock: main: InvalidChainFound:  current best=00429cfa6dd8176b287064a524090507eb2592d1050aa941ce19c1c2c823bd27  height=1779199  log2_work=37.256427  date=2022-02-25 00:36:27
2022-03-15T16:24:01.468075Z ERROR ProcessNewBlock: main: ConnectTip(): ConnectBlock 0022eabf7a4a1dc158979d993cefcd3782e74111fa61e60a49110fa78ed79e88 failed

Any other, more successful hints to get a local test node up and running?

1 Like

Sorry if we weren’t clear in our responses. Building from master means you are on a version of Zcashd that doesn’t have the consensus bug in it that caused this situation but that doesn’t alter the existing chain state. As @str4d mentioned, that will be fixed with 4.7.0. Depending on the symptoms you’re seeing like your node pausing at 99% during initial block download (which is common), using the -maxtipage=100000000 might help get you synced past that point. Alternatively, using regtest might be an option if you’re familiar with that setup.

2 Likes

Sorry to say: tested and didn’t work (maxtipage of 1157 days is unrelated anyway and suggesting regtest [no public faucets, AFAIK] is super silly). Fact: zcash testnet is broken for a long while. So - let’s use monero then - that’s working like a charm :).

That’s why it’s called “Testnet” not “Mainnet” to test and break things.

Zcash Mainnet is working just fine.

3 Likes

Doesn’t sound like you’ve ever used regtest. You don’t need a public faucet, you generate blocks yourself and have the block rewards to use as test funds.

In the case where your node is stuck at 99% b/c it can’t get the next block from a peer, maxtipage works just fine.

2 Likes