and soon afterwards the mined block retrieved via dfx canister call 6lnhz-oaaaa-aaaas-aabkq-cai get_latest_blocks --update --ic was
record {
to = principal "5cd6g-sncvx-lfobl-xyuhz-ubkbi-x3tyu-qmxof-6zxo7-3xehm-h7i4j-lqe";
miner = opt principal "7qvvt-eaaaa-aaaas-aj7ua-cai";
miner_cycles_burned = opt (67_222_222_222_080 : nat64);
total_cycles_burned = opt (337_273_888_869_522 : nat64);
timestamp = 1_735_131_421_517_753_586 : nat64;
rewards = 30_000_000_000 : nat64;
miner_count = opt (172 : nat64);
};
Given that both calls were (replicated) update calls with the latter update call submitted after receiving the response of the former one, they were executed in this order. Consequently, the number of burnt cycles is not supposed to decrease. (The difference in miner count is due to the dedicated pool miner whose contribution is burnt just before mining a block and thus not a accounted for in the pending block stats.)
The above behavior is easily reproducible by fetching the pending block stats shortly before a block is mined.
Given the published source code, I could not figure out a reason for this behavior. Hence, I would like to ask BoB developers if they could please publish the latest deployed code and/or look into the issue themselves.
We’re implementing reproducible builds aligned with the guidance at this link. Any insights or contributions to our progress would be invaluable: GitHub - bob-robert-ai/bob.
To speed up the build, I’d further recommend downloading ic-wasm as a binary from its release page instead of building it from sources.
Moreover, I’d add a line
ic-wasm target/wasm32-unknown-unknown/release/bob_miner_v2.wasm -o target/wasm32-unknown-unknown/release/bob_miner_v2.wasm metadata candid:service -f miner-v2/miner.did -v public
after building the miner and before building the minter.
Last but not least, I’d recommend adding a unit test (with a corresponding GitHub action to run it on CI) for the did file:
#[cfg(test)]
mod tests {
use super::*;
use candid_parser::utils::{service_equal, CandidSource};
#[test]
fn test_implemented_interface_matches_declared_interface_exactly() {
let declared_interface = include_str!("../miner.did");
let declared_interface = CandidSource::Text(declared_interface);
// The line below generates did types and service definition from the
// methods annotated with Rust CDK macros above. The definition is then
// obtained with `__export_service()`.
candid::export_service!();
let implemented_interface_str = __export_service();
let implemented_interface = CandidSource::Text(&implemented_interface_str);
let result = service_equal(declared_interface, implemented_interface);
assert!(result.is_ok(), "{:?}\n\n", result.unwrap_err());
}
}
using candid_parser = "0.2.0-beta.4" and analogously for the minter.