@@ -553,7 +553,9 @@ void ValidatorSessionImpl::check_generate_slot() {
553553 LOG (WARNING) << print_id << " : failed to generate block candidate: " << R.move_as_error ();
554554 }
555555 });
556- callback_->on_generate_slot (cur_round_, std::move (P));
556+ callback_->on_generate_slot (
557+ BlockSourceInfo{cur_round_, first_block_round_, description ().get_source_public_key (local_idx ()), priority},
558+ std::move (P));
557559 } else {
558560 alarm_timestamp ().relax (t);
559561 }
@@ -631,8 +633,10 @@ void ValidatorSessionImpl::try_approve_block(const SentBlock *block) {
631633 });
632634 pending_approve_.insert (block_id);
633635
634- callback_->on_candidate (cur_round_, description ().get_source_public_key (block->get_src_idx ()), B->root_hash_ ,
635- B->data_ .clone (), B->collated_data_ .clone (), std::move (P));
636+ callback_->on_candidate (
637+ BlockSourceInfo{cur_round_, first_block_round_, description ().get_source_public_key (block->get_src_idx ()),
638+ description ().get_node_priority (block->get_src_idx (), cur_round_)},
639+ B->root_hash_ , B->data_ .clone (), B->collated_data_ .clone (), std::move (P));
636640 } else if (T.is_in_past ()) {
637641 if (!active_requests_.count (block_id)) {
638642 auto v = virtual_state_->get_block_approvers (description (), block_id);
@@ -905,15 +909,19 @@ void ValidatorSessionImpl::on_new_round(td::uint32 round) {
905909 stats.rounds .pop_back ();
906910 }
907911
912+ BlockSourceInfo source_info{cur_round_, first_block_round_,
913+ description ().get_source_public_key (block->get_src_idx ()),
914+ description ().get_node_priority (block->get_src_idx (), cur_round_)};
908915 if (it == blocks_.end ()) {
909- callback_->on_block_committed (cur_round_, description (). get_source_public_key ( block->get_src_idx () ),
910- block-> get_root_hash (), block-> get_file_hash ( ), td::BufferSlice ( ),
911- std::move (export_sigs), std::move (export_approve_sigs), std::move ( stats));
916+ callback_->on_block_committed (std::move (source_info), block-> get_root_hash (), block->get_file_hash ( ),
917+ td::BufferSlice (), std::move (export_sigs ), std::move (export_approve_sigs ),
918+ std::move (stats));
912919 } else {
913- callback_->on_block_committed (cur_round_, description (). get_source_public_key ( block->get_src_idx () ),
914- block-> get_root_hash (), block-> get_file_hash ( ), it-> second -> data_ . clone ( ),
915- std::move (export_sigs), std::move (export_approve_sigs), std::move ( stats));
920+ callback_->on_block_committed (std::move (source_info), block-> get_root_hash (), block->get_file_hash ( ),
921+ it-> second -> data_ . clone (), std::move (export_sigs ), std::move (export_approve_sigs ),
922+ std::move (stats));
916923 }
924+ first_block_round_ = cur_round_ + 1 ;
917925 }
918926 cur_round_++;
919927 if (have_block) {
0 commit comments