In gossip, the header overhead we get from: https://github.com/solana-labs/solana/blob/de9ac43eb/core/src/cluster_info.rs#L434-L435 https://github.com/solana-labs/solana/blob/de9ac43eb/core/src/crds_value.rs#L31-L36 https://github.com/solana-labs/solana/blob/de9ac43eb/core/src/crds_value.rs#L73 already exceeds SIZE_OF_NONCE in shreds. We also need aditional meta-data (wallclock, source pubkey, ...). Which means that given the SHRED_PAYLOAD_SIZE, we cannot fit all these in PACKET_DATA_SIZE: https://github.com/solana-labs/solana/blob/de9ac43eb/ledger/src/shred.rs#L80 On top of that, we need 2 shred payloads as the proof of duplicate. So each DuplicateShred crds value includes only a chunk of the payload, along with the meta-data to reconstruct the full payload from the chunks on the receiving end.
		
			
				
	
	
		
			28 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Rust
		
	
	
	
	
	
| extern crate rustc_version;
 | |
| use rustc_version::{version_meta, Channel};
 | |
| 
 | |
| fn main() {
 | |
|     // Copied and adapted from
 | |
|     // https://github.com/Kimundi/rustc-version-rs/blob/1d692a965f4e48a8cb72e82cda953107c0d22f47/README.md#example
 | |
|     // Licensed under Apache-2.0 + MIT
 | |
|     match version_meta().unwrap().channel {
 | |
|         Channel::Stable => {
 | |
|             println!("cargo:rustc-cfg=RUSTC_WITHOUT_SPECIALIZATION");
 | |
|         }
 | |
|         Channel::Beta => {
 | |
|             println!("cargo:rustc-cfg=RUSTC_WITHOUT_SPECIALIZATION");
 | |
|         }
 | |
|         Channel::Nightly => {
 | |
|             println!("cargo:rustc-cfg=RUSTC_WITH_SPECIALIZATION");
 | |
|         }
 | |
|         Channel::Dev => {
 | |
|             println!("cargo:rustc-cfg=RUSTC_WITH_SPECIALIZATION");
 | |
|             // See https://github.com/solana-labs/solana/issues/11055
 | |
|             // We may be running the custom `rust-bpf-builder` toolchain,
 | |
|             // which currently needs `#![feature(proc_macro_hygiene)]` to
 | |
|             // be applied.
 | |
|             println!("cargo:rustc-cfg=RUSTC_NEEDS_PROC_MACRO_HYGIENE");
 | |
|         }
 | |
|     }
 | |
| }
 |