diff --git a/collator/src/collator/do_collate.rs b/collator/src/collator/do_collate.rs index 1f196a95d..53aeada49 100644 --- a/collator/src/collator/do_collate.rs +++ b/collator/src/collator/do_collate.rs @@ -73,11 +73,20 @@ impl CollatorStdImpl { .get_last_imported_anchor_ct_and_author() .unwrap(); - // TODO: need to generate unique for each block - // generate seed from the chain_time from the anchor - let hash_bytes = sha2::Sha256::digest(next_chain_time.to_be_bytes()); + // Generate unique rand seed from the anchor chain_time and the next block seqno + let hash_bytes = sha2::Sha256::digest( + [ + next_chain_time.to_be_bytes().as_slice(), + working_state + .next_block_id_short + .seqno + .to_be_bytes() + .as_slice(), + ] + .concat(), + ); let rand_seed = HashBytes::from_slice(hash_bytes.as_slice()); - tracing::trace!(target: tracing_targets::COLLATOR, "rand_seed from chain time: {}", rand_seed); + tracing::trace!(target: tracing_targets::COLLATOR, "rand_seed from chain time and block seqno: {}", rand_seed); let is_masterchain = self.shard_id.is_masterchain();