stacks-network / stacks-core

The Stacks blockchain implementation
https://docs.stacks.co
GNU General Public License v3.0
3k stars 661 forks source link

[Nakamoto]No PoX anchor block known yet for cycle 8 #4953

Open JavHou opened 2 weeks ago

JavHou commented 2 weeks ago

Describe the bug

when i sync node using genesis sync in official docker image(ver:2.5.0.0.5, nakamoto testnet), i stuck in Missing canonical anchor block infinity loop, and stop sync burn block.

Environment

Additional context

./manage.sh -n testnet -a logs


stacks-blockchain      | INFO [1720520453.690092] [stackslib/src/chainstate/nakamoto/coordinator/mod.rs:309] [chains-coordinator-0.0.0.0:20443] No PoX anchor block known yet for cycle 8
stacks-blockchain      | ERRO [1720520453.694082] [stackslib/src/chainstate/nakamoto/coordinator/mod.rs:546] [chains-coordinator-0.0.0.0:20443] Missing canonical anchor block
stacks-blockchain      | INFO [1720520454.692084] [stackslib/src/chainstate/nakamoto/coordinator/mod.rs:840] [chains-coordinator-0.0.0.0:20443] Process burn block 7431 reward cycle 8 in /root/stacks-blockchain/data/krypton/burnchain, in_prepare_phase: false, is_rc_start: true, is_prior_in_prepare_phase: true
stacks-blockchain      | INFO [1720520454.705046] [stackslib/src/chainstate/nakamoto/coordinator/mod.rs:309] [chains-coordinator-0.0.0.0:20443] No PoX anchor block known yet for cycle 8
stacks-blockchain      | ERRO [1720520454.706845] [stackslib/src/chainstate/nakamoto/coordinator/mod.rs:546] [chains-coordinator-0.0.0.0:20443] Missing canonical anchor block
stacks-blockchain      | INFO [1720520455.653667] [stackslib/src/chainstate/nakamoto/coordinator/mod.rs:840] [chains-coordinator-0.0.0.0:20443] Process burn block 7431 reward cycle 8 in /root/stacks-blockchain/data/krypton/burnchain, in_prepare_phase: false, is_rc_start: true, is_prior_in_prepare_phase: true

Config.toml


[node]
# Set this based on where you downloaded
# the chain state archive as described in the How to Run a Signer guide:
working_dir = "/root/stacks-blockchain/data"
rpc_bind = "0.0.0.0:20443"
p2p_bind = "0.0.0.0:20444"
# This is the node that your node will use to begin syncing chain state
bootstrap_node = "0341b2ff35b545d8e5c5d2fc8821484610ef85ce8e276214caf23d53be16fdcd65@seed.nakamoto.regtest.hiro.so:50444"
wait_time_for_microblocks = 0
mine_microblocks = false

[burnchain]
chain = "bitcoin"
mode = "krypton"
magic_bytes = "N3"
poll_time_secs = 30
pox_prepare_length = 100
pox_reward_length = 900
peer_host = "bitcoin.nakamoto.regtest.hiro.so"
username = "hirosystems"
password = "hirosystems"
burnchain_op_tx_fee = 5500
commit_anchor_block_within = 300000
rpc_port = 18543
peer_port = 18544
#satoshis_per_byte = 20
first_burn_block_height = 230
first_burn_block_timestamp = 1714513150
first_burn_block_hash = "654e1e9f66701d4f8a138b46d4cf0cc26665688175bcbb1700729efbf759e57d"
wileyj commented 2 weeks ago

@CharlieC3 can you check on this? seems related to bitcoin regtest

CharlieC3 commented 2 weeks ago

@JavHou The value you're using for the bootstrap_node property seems off.

Instead of bootstrap_node = "0341b2ff35b545d8e5c5d2fc8821484610ef85ce8e276214caf23d53be16fdcd65@seed.nakamoto.regtest.hiro.so:50444"

Try bootstrap_node = "0341b2ff35b545d8e5c5d2fc8821484610ef85ce8e276214caf23d53be16fdcd65@seed.nakamoto.testnet.hiro.so:50444"

JavHou commented 2 weeks ago

@CharlieC3 Should burnchain peer host also be modified? Or can you offer a completely config about nakamoto testnet.

CharlieC3 commented 2 weeks ago

@JavHou This sample config file for Nakamoto testnet may be what you're looking for: https://docs.stacks.co/nakamoto-upgrade/signing-and-stacking/sample-configuration-files#nakamoto-testnet-config

The bootstrap_node needs to be updated in it too though to what I posted above. @cuevasm or @wileyj Is that something you're able to update?

cuevasm commented 2 weeks ago

Anyone can submit a PR 😁 cc @kenrogers

https://github.com/stacks-network/docs

CharlieC3 commented 2 weeks ago

Oh nice, didn't even realize it was available through a GH repo!

kenrogers commented 2 weeks ago

This has been updated, thanks @CharlieC3! Does the peer_host value in that same example config also need to be updated?

CharlieC3 commented 2 weeks ago

Nope, peer_host is correct. I can see how the regtest vs testnet may be misleading, but it's a stacks testnet node using bitcoin regtest, so it needs to be configured like this.