Skip to content

Commit

Permalink
Prepare BankingStage to receive transaction indexes from PohRecorder
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyera Eulberg committed Jun 7, 2022
1 parent 708b03e commit ff74b86
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions poh/src/poh_recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ pub struct Record {
pub mixin: Hash,
pub transactions: Vec<VersionedTransaction>,
pub slot: Slot,
pub sender: Sender<Result<()>>,
pub sender: Sender<Result<Vec<usize>>>,
}
impl Record {
pub fn new(
mixin: Hash,
transactions: Vec<VersionedTransaction>,
slot: Slot,
sender: Sender<Result<()>>,
sender: Sender<Result<Vec<usize>>>,
) -> Self {
Self {
mixin,
Expand Down Expand Up @@ -128,7 +128,7 @@ impl TransactionRecorder {
bank_slot: Slot,
mixin: Hash,
transactions: Vec<VersionedTransaction>,
) -> Result<()> {
) -> Result<Vec<usize>> {
// create a new channel so that there is only 1 sender and when it goes out of scope, the receiver fails
let (result_sender, result_receiver) = unbounded();
let res =
Expand Down Expand Up @@ -742,7 +742,7 @@ impl PohRecorder {
bank_slot: Slot,
mixin: Hash,
transactions: Vec<VersionedTransaction>,
) -> Result<()> {
) -> Result<Vec<usize>> {
// Entries without transactions are used to track real-time passing in the ledger and
// cannot be generated by `record()`
assert!(!transactions.is_empty(), "No transactions provided");
Expand Down Expand Up @@ -787,7 +787,8 @@ impl PohRecorder {
"send_poh_entry",
);
self.send_entry_us += send_entry_time.as_us();
return Ok(send_entry_res?);
send_entry_res?;
return Ok(vec![]);
}

// record() might fail if the next PoH hash needs to be a tick. But that's ok, tick()
Expand Down

0 comments on commit ff74b86

Please sign in to comment.