AleoNet / snarkOS

A Decentralized Operating System for ZK Applications
http://snarkos.org
Apache License 2.0
4.1k stars 2.57k forks source link

[Bug] If the number of transactions in the network is low, it may cause the network to stop #3263

Closed elderhammer closed 1 month ago

elderhammer commented 1 month ago

🐛 Bug Report

If the number of transmissions in the network is too small, the validator may not be able to propose normally. If this happens to all validators in the same round, the network will not function properly.

Steps to Reproduce

  1. The primary collects transmissions from workers until the number of transmissions in the worker is empty (snarkOS, node/bft/src/primary.rs:483)
  2. Update lock_guard to the current round (snarkOS, node/bft/src/primary.rs:542)
  3. If the number of transmissions is less than 50, BatchHeader::new() will report an error (snarkVM, ledger/narwhal/batch-header/src/lib.rs:96)
  4. This proposal failed and returned
  5. If proposed again in this round, it will be judged as expired (snarkOS, node/bft/src/primary.rs:535)

Expected Behavior

When the transmission in the network increases enough, the network successfully proposes.

Your Environment

vicsn commented 1 month ago

Thank you for your submission! Before we can review any PRs for this, it would be great if you can:

More pressingly, your step 3 is incorrect. The ensure macro will succeed as long as the number of transmissions is less than or equal to 50. Feel free to close this issue if indeed no longer relevant.