hirosystems / clarinet

Write, test and deploy high-quality smart contracts to the Stacks blockchain and Bitcoin.
https://hiro.so/clarinet
GNU General Public License v3.0
298 stars 130 forks source link

Clarinet devnet panicks after running for a while #1536

Open vicnicius opened 1 month ago

vicnicius commented 1 month ago

Describe the bug Clarinet devnet panicking:

thread 'Chains coordinator' panicked at /private/tmp/clarinet-20240801-9876-lww47q/clarinet-2.8.0/components/stacks-network/src/chains_coordinator.rs:393:25:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It happened on every run when I had an error on the contract that was being deployed. I set the contract to use clarity 3 but it had a block-info call, leading to a syntax error. This is what lead to the error I reported on https://github.com/hirosystems/clarinet/issues/1534.

There were no patterns in terms of block height.

stacks-node was stuck in ~100% CPU usage. I saw many

2024-08-06 13:50:11 Aug  6 11:50:11.822250 INFO Handled StacksHTTPRequest, verb: GET, path: /v2/info, processing_time_ms: 0, latency_ms: 0, conn_id: 8, peer_addr: 172.27.0.1:50804

entries and also this, that looked a bit more suspicious:

2024-08-06 13:50:08 Aug  6 11:50:08.072583 INFO local.80000000://(bind=127.0.0.1:20444)(pub=Some(1.1.1.1:1234)): Failed to load any initial walk neighbors: NoSuchNeighbor

~ After I fixed the contract the issue is gone, leading me to believe there might be a causation. ~

To Reproduce Steps to reproduce the behavior:

  1. Run clarinet devnet start with invalid contract
  2. Wait and see error

Expected behavior No errors, contract just fails to deploy

Environment (please complete the following information):

Update

Right after submitting this issue I saw the error again without an invalid contract. Just took longer ~200 blocks.

hugocaillard commented 1 month ago

Thanks @vicnicius

Clarinet version: 3.28.0 It's 2.8.0 right?

without an invalid contract

yeah I don't think the invalid contract is the cause here.

2024-08-06 13:50:08 Aug 6 11:50:08.072583 INFO local.80000000://(bind=127.0.0.1:20444)(pub=Some(1.1.1.1:1234)): Failed to load any initial walk neighbors: NoSuchNeighbor

I'm not really concerned with this one.

Is it possible for you to share the github link to a project where this happens?

vicnicius commented 1 month ago

Sorry but the project is not public currently. I'll see if I can create a reproducible example in a public repo sometime this week.

hugocaillard commented 1 month ago

Thanks, that would be helpful

hugocaillard commented 2 weeks ago

I see that update @vicnicius

"Right after submitting this issue I saw the error again without an invalid contract. Just took longer ~200 blocks."

Does it mean that you can see the issue in a blank project? So the steps would to reproduce are just

$ clarinet new my-project
$ cd my-project
$ clarinet devnet start

Wait for 200 block and it stops?