Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send AdvertiseTransactionIds to peers #2823

Merged
merged 28 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1823b27
bradcast transactions to peers after they get inserted into mempool
oxarbitrage Oct 1, 2021
26e9569
Merge remote-tracking branch 'origin/main' into issue2758
oxarbitrage Oct 1, 2021
954c573
remove network argument from mempool init
oxarbitrage Oct 5, 2021
48f7ac8
remove dbg left
oxarbitrage Oct 5, 2021
cef5b04
remove return value in mempool enable call
oxarbitrage Oct 5, 2021
9a3d3a6
Merge remote-tracking branch 'origin/main' into issue2758
oxarbitrage Oct 5, 2021
ac7e32e
rename channel sender and receiver vars
oxarbitrage Oct 6, 2021
a8022e1
change unwrap() to expect()
oxarbitrage Oct 6, 2021
41b0c00
change the channel to a hashset
oxarbitrage Oct 6, 2021
058feea
Merge branch 'main' into issue2758
oxarbitrage Oct 6, 2021
88c363a
fix build
oxarbitrage Oct 7, 2021
b22462f
Merge remote-tracking branch 'zebra/main' into issue2758
oxarbitrage Oct 7, 2021
c544ae6
fix tests
oxarbitrage Oct 7, 2021
0a7a383
rustfmt
oxarbitrage Oct 7, 2021
1083ae0
Merge remote-tracking branch 'zebra/main' into issue2758
oxarbitrage Oct 7, 2021
788f799
fix tiny space issue inside macro
oxarbitrage Oct 7, 2021
836a61a
Merge branch 'main' into issue2758
oxarbitrage Oct 7, 2021
2ec6733
Merge remote-tracking branch 'zebra/main' into issue2758
oxarbitrage Oct 7, 2021
3478ae7
check errors/panics in transaction gossip tests
oxarbitrage Oct 7, 2021
e94e9ad
Merge remote-tracking branch 'origin/issue2758' into issue2758
oxarbitrage Oct 7, 2021
582d06e
Merge remote-tracking branch 'zebra/main' into issue2758
oxarbitrage Oct 7, 2021
982b500
fix build of newly added tests
oxarbitrage Oct 7, 2021
bbd4d8c
Merge remote-tracking branch 'zebra/main' into issue2758
oxarbitrage Oct 7, 2021
d268b95
Stop dropping the inbound service and mempool in a test
teor2345 Oct 8, 2021
81ad754
Tweak variable names and add comments
teor2345 Oct 8, 2021
c186fa8
Avoid unexpected drops by returning a mempool guard in tests
teor2345 Oct 8, 2021
06e283e
Use BoxError to simplify service types in tests
teor2345 Oct 8, 2021
8a9971e
Make all returned service types consistent in tests
teor2345 Oct 8, 2021
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
19 changes: 17 additions & 2 deletions zebrad/src/commands/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use abscissa_core::{config, Command, FrameworkError, Options, Runnable};
use color_eyre::eyre::{eyre, Report};
use futures::{select, FutureExt};
use std::collections::HashSet;
use tokio::sync::oneshot;
use tower::builder::ServiceBuilder;
use tower::util::BoxService;
Expand Down Expand Up @@ -91,14 +92,18 @@ impl StartCmd {
ChainSync::new(&config, peer_set.clone(), state.clone(), chain_verifier);

info!("initializing mempool");

let (mempool_transaction_sender, mempool_transaction_receiver) =
tokio::sync::watch::channel(HashSet::new());

let mempool_service = BoxService::new(Mempool::new(
config.network.network,
peer_set.clone(),
state,
tx_verifier,
sync_status.clone(),
latest_chain_tip,
chain_tip_change.clone(),
mempool_transaction_sender,
));
let mempool = ServiceBuilder::new().buffer(20).service(mempool_service);

Expand All @@ -114,7 +119,13 @@ impl StartCmd {
peer_set.clone(),
));

let mempool_crawler_task_handle = mempool::Crawler::spawn(peer_set, mempool, sync_status);
let mempool_crawler_task_handle =
mempool::Crawler::spawn(peer_set.clone(), mempool, sync_status);

let tx_gossip_task_handle = tokio::spawn(mempool::gossip_mempool_transaction_id(
mempool_transaction_receiver,
peer_set,
));

select! {
sync_result = syncer_error_future.fuse() => sync_result,
Expand All @@ -126,6 +137,10 @@ impl StartCmd {
mempool_crawl_result = mempool_crawler_task_handle.fuse() => mempool_crawl_result
.expect("unexpected panic in the mempool crawler")
.map_err(|e| eyre!(e)),

tx_gossip_result = tx_gossip_task_handle.fuse() => tx_gossip_result
.expect("unexpected panic in the transaction gossip task")
.map_err(|e| eyre!(e)),
}
}
}
Expand Down
Loading