Skip to content

Commit

Permalink
Revert "add a clock to validator windows (part 3 of solana-labs#309) (s…
Browse files Browse the repository at this point in the history
…olana-labs#448)"

This reverts commit 1919ec2.
  • Loading branch information
mvines committed Jun 26, 2018
1 parent 35e275f commit 8a52a1c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 28 deletions.
10 changes: 5 additions & 5 deletions ci/upload_ci_artifact.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# |source| me

upload_ci_artifact() {
echo --- artifact: $1
if [[ -r $1 ]]; then
ls -l $1
echo "--- artifact: $1"
if [[ -r "$1" ]]; then
ls -l "$1"
if ${BUILDKITE:-false}; then
(
set -x
buildkite-agent artifact upload $1
buildkite-agent artifact upload "$1"
)
fi
else
echo ^^^ +++
echo $1 not found
echo "$1 not found"
fi
}

15 changes: 2 additions & 13 deletions src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ pub struct Bank {
/// The number of transactions the bank has processed without error since the
/// start of the ledger.
transaction_count: AtomicUsize,

/// The number of Entries the bank has processed without error since start
/// of the ledger, i.e. poor-man's network synchronization
/// TODO: upgrade to U64 when stable?
entry_count: AtomicUsize,
}

impl Bank {
Expand All @@ -105,7 +100,6 @@ impl Bank {
time_sources: RwLock::new(HashSet::new()),
last_time: RwLock::new(Utc.timestamp(0, 0)),
transaction_count: AtomicUsize::new(0),
entry_count: AtomicUsize::new(0),
};
bank.apply_payment(deposit, &mut bank.balances.write().unwrap());
bank
Expand Down Expand Up @@ -302,21 +296,19 @@ impl Bank {
}

/// Process an ordered list of entries.
pub fn process_entries<I>(&self, entries: I) -> Result<usize>
pub fn process_entries<I>(&self, entries: I) -> Result<()>
where
I: IntoIterator<Item = Entry>,
{
for entry in entries {
self.entry_count.fetch_add(1, Ordering::Relaxed);

if !entry.transactions.is_empty() {
for result in self.process_transactions(entry.transactions) {
result?;
}
}
self.register_entry_id(&entry.id);
}
Ok(self.entry_count())
Ok(())
}

/// Process a Witness Signature. Any payment plans waiting on this signature
Expand Down Expand Up @@ -430,9 +422,6 @@ impl Bank {
pub fn transaction_count(&self) -> usize {
self.transaction_count.load(Ordering::Relaxed)
}
pub fn entry_count(&self) -> usize {
self.entry_count.load(Ordering::Relaxed)
}
}

#[cfg(test)]
Expand Down
3 changes: 1 addition & 2 deletions src/bin/fullnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ fn main() {
bank.register_entry_id(&entry1.id);

eprintln!("processing entries...");
let num_entries = bank.process_entries(entries).expect("process_entries");
eprintln!("processed {} entries...", num_entries);
bank.process_entries(entries).expect("process_entries");

eprintln!("creating networking stack...");

Expand Down
8 changes: 3 additions & 5 deletions src/streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,13 @@ pub fn window(
r: BlobReceiver,
s: BlobSender,
retransmit: BlobSender,
entry_count: usize,
) -> JoinHandle<()> {
Builder::new()
.name("solana-window".to_string())
.spawn(move || {
let mut consumed = entry_count;
let mut received = entry_count;
let mut last = entry_count;
let mut consumed = 0;
let mut received = 0;
let mut last = 0;
let mut times = 0;
loop {
if exit.load(Ordering::Relaxed) {
Expand Down Expand Up @@ -822,7 +821,6 @@ mod test {
r_reader,
s_window,
s_retransmit,
0,
);
let (s_responder, r_responder) = channel();
let t_responder = responder(
Expand Down
1 change: 0 additions & 1 deletion src/tvu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ impl Tvu {
exit.clone(),
blob_recycler.clone(),
fetch_stage.blob_receiver,
bank.entry_count(),
);

let replicate_stage =
Expand Down
2 changes: 0 additions & 2 deletions src/window_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ impl WindowStage {
exit: Arc<AtomicBool>,
blob_recycler: packet::BlobRecycler,
fetch_stage_receiver: streamer::BlobReceiver,
entry_count: usize,
) -> Self {
let (retransmit_sender, retransmit_receiver) = channel();

Expand All @@ -42,7 +41,6 @@ impl WindowStage {
fetch_stage_receiver,
blob_sender,
retransmit_sender,
entry_count,
);
let thread_hdls = vec![t_retransmit, t_window];

Expand Down

0 comments on commit 8a52a1c

Please sign in to comment.