Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b21d51c
Switch GrandPa to new futures
tomaka Aug 5, 2019
a25be8e
Merge remote-tracking branch 'upstream/master' into HEAD
tomaka Oct 24, 2019
513704d
Merge remote-tracking branch 'upstream/master' into HEAD
tomaka Oct 28, 2019
6007c2b
Work on making tests work
tomaka Oct 28, 2019
46f3728
until_imported tests working again
tomaka Oct 28, 2019
6f6849a
Work on switching tests to stable futures
tomaka Oct 28, 2019
7c4f79b
Merge remote-tracking branch 'parity/master' into HEAD
expenses Jan 10, 2020
c1dd9e5
Modifications
expenses Jan 13, 2020
6737632
Merge remote-tracking branch 'parity/master' into ashley-grandpa-futures
expenses Jan 13, 2020
46a6822
Re-add test as #[ignore]
expenses Jan 13, 2020
f05c301
Don't ignore
expenses Jan 13, 2020
53fb151
Add manual unpins
expenses Jan 13, 2020
6fdc0b8
Remove Header import
expenses Jan 14, 2020
a52f255
Merge remote-tracking branch 'parity/master' into ashley-grandpa-futures
expenses Jan 14, 2020
14d8afb
Return concrete Sink type
expenses Jan 15, 2020
b1264db
Switch to crates.io finality-grandpa version
expenses Jan 16, 2020
5afd086
Merge remote-tracking branch 'parity/master' into ashley-grandpa-futures
expenses Jan 16, 2020
ba62dd5
Remove use statement that slipped in
expenses Jan 16, 2020
daf41a3
Fix some nitpicks
expenses Jan 16, 2020
828af5e
Remove unpin from i
expenses Jan 16, 2020
c7d2b24
Fixed typo
expenses Jan 16, 2020
e1a89d7
Merge remote-tracking branch 'parity/master' into ashley-grandpa-futures
expenses Jan 17, 2020
7fcf87b
Move futures01 to dev-deps
expenses Jan 17, 2020
65724be
Merge remote-tracking branch 'parity/master' into ashley-grandpa-futures
expenses Jan 20, 2020
8589985
Merge remote-tracking branch 'parity/master' into ashley-grandpa-futures
expenses Jan 22, 2020
6053e88
Merge remote-tracking branch 'parity/master' into ashley-grandpa-futures
expenses Jan 23, 2020
a6097b3
Fix nitpicks
expenses Jan 23, 2020
6226ed4
Update client/finality-grandpa/src/communication/mod.rs
expenses Jan 23, 2020
d6b89c4
nitpicking
expenses Jan 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix nitpicks
  • Loading branch information
expenses committed Jan 23, 2020
commit a6097b3b96d8181396f13ab6687ea2277b9010da
3 changes: 1 addition & 2 deletions client/finality-grandpa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,7 @@ pub fn run_grandpa_voter<B, E, Block: BlockT, N, RA, SC, VR, X, Sp>(
}
);
future::ready(())
})
.then(|_| { future::ready(()) });
});
future::Either::Left(events)
} else {
future::Either::Right(future::pending())
Expand Down
4 changes: 1 addition & 3 deletions client/finality-grandpa/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1342,9 +1342,7 @@ fn voter_persists_its_votes() {
// by `Sink::poll_complete` to make sure items are being flushed. Given that
// we send in a loop including a delay until items are received, this can be
// ignored for the sake of reduced complexity.
Pin::new(&mut *round_tx.lock())
.start_send(finality_grandpa::Message::Prevote(prevote))
.unwrap();
Pin::new(&mut *round_tx.lock()).start_send(finality_grandpa::Message::Prevote(prevote)).unwrap();
Copy link
Contributor

@mxinden mxinden Jan 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One should first call poll_ready before start_send on Sink. As a convenience function, given that we are within an async block, one can call SinkExt::send.

(I don't think this was introduced through this pull request, but the pull request enables the easy fix via SinkExt::send. Let me know if you want me to do this as a follow up.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually can't use SinkExt::send, because that's that'd mean awaiting a function that borrows a mutex and ends up with: *mut () cannot be sent between threads safely.

} else if state.compare_and_swap(1, 2, Ordering::SeqCst) == 1 {
// the next message we receive should be our own prevote
let prevote = match signed.message {
Expand Down
2 changes: 1 addition & 1 deletion client/finality-grandpa/src/until_imported.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl<Block, BStatus, BSyncRequester, I, M> Stream for UntilImported<Block, BStat
}

let mut update_interval = false;
while let Poll::Ready(Some(Ok(()))) = Stream::poll_next(Pin::new(&mut this.check_pending), cx) {
while let Poll::Ready(Some(Ok(()))) = this.check_pending.poll_next_unpin(cx) {
update_interval = true;
}

Expand Down