Skip to content

Commit

Permalink
Remove Blobs and switch to Packets (solana-labs#6937)
Browse files Browse the repository at this point in the history
* Remove Blobs and switch to Packets

* Fix some gossip messages not respecting MTU size

* Failure to serialize is not fatal

* Add log macros

* Remove unused extern

* Apparently macro use is required

* Explicitly scope macro

* Fix test compile
  • Loading branch information
sagar-solana authored Nov 14, 2019
1 parent d6cbb02 commit f108f48
Show file tree
Hide file tree
Showing 14 changed files with 279 additions and 712 deletions.
3 changes: 1 addition & 2 deletions bench-streamer/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use clap::{crate_description, crate_name, App, Arg};
use solana_core::blob::BLOB_SIZE;
use solana_core::packet::{Packet, Packets, PacketsRecycler, PACKET_DATA_SIZE};
use solana_core::result::Result;
use solana_core::streamer::{receiver, PacketReceiver};
Expand Down Expand Up @@ -29,7 +28,7 @@ fn producer(addr: &SocketAddr, exit: Arc<AtomicBool>) -> JoinHandle<()> {
let mut num = 0;
for p in &msgs.packets {
let a = p.meta.addr();
assert!(p.meta.size < BLOB_SIZE);
assert!(p.meta.size < PACKET_DATA_SIZE);
send.send_to(&p.data[..p.meta.size], &a).unwrap();
num += 1;
}
Expand Down
8 changes: 4 additions & 4 deletions core/src/archiver.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{
blob::to_shared_blob,
chacha::{chacha_cbc_encrypt_ledger, CHACHA_BLOCK_SIZE},
cluster_info::{ClusterInfo, Node, VALIDATOR_PORT_RANGE},
contact_info::ContactInfo,
Expand All @@ -23,7 +22,9 @@ use solana_ledger::{
blocktree::Blocktree, leader_schedule_cache::LeaderScheduleCache, shred::Shred,
};
use solana_net_utils::bind_in_range;
use solana_perf::packet::Packets;
use solana_perf::recycler::Recycler;
use solana_sdk::packet::Packet;
use solana_sdk::{
account_utils::State,
client::{AsyncClient, SyncClient},
Expand Down Expand Up @@ -165,9 +166,8 @@ fn create_request_processor(
limited_deserialize(&packet.data[..packet.meta.size]);
match req {
Ok(ArchiverRequest::GetSlotHeight(from)) => {
if let Ok(blob) = to_shared_blob(slot, from) {
let _ = s_responder.send(vec![blob]);
}
let packet = Packet::from_data(&from, slot);
let _ = s_responder.send(Packets::new(vec![packet]));
}
Err(e) => {
info!("invalid request: {:?}", e);
Expand Down
Loading

0 comments on commit f108f48

Please sign in to comment.