snarkOS
snarkOS copied to clipboard
[Bug] producing the latest block template takes too long
🐛 Bug Report
the template update in the operator takes a too long time, at least 20s in my test. If this is the case, machines with low computing power will always be in the updating state, and they will not be able to mine the latest template at all.
https://github.com/AleoHQ/snarkOS/blob/testnet3/network/src/operator.rs#L124-L137
let result = tokio::task::spawn_blocking(move || {
E::thread_pool().install(move || {
match ledger_reader.get_block_template(
recipient,
E::COINBASE_IS_PUBLIC,
&transactions,
&mut rand::thread_rng(),
) {
Ok(block_template) => Ok(block_template),
Err(error) => Err(format!("Failed to produce a new block template: {}", error)),
}
})
})
.await;
My Environment
- SnarkOS testnet3 branch, release binary
- Rust 1.61.0
- Mac Pro with Apple M1 Max
#1827 #1472