rpc: plumb shred_version through RpcContactInfo

This commit is contained in:
Trent Nelson 2021-05-13 21:33:57 -06:00 committed by mergify[bot]
parent 26afc7620b
commit 67e6a3106f
2 changed files with 4 additions and 1 deletions

View File

@ -206,6 +206,8 @@ pub struct RpcContactInfo {
pub version: Option<String>,
/// First 4 bytes of the FeatureSet identifier
pub feature_set: Option<u32>,
/// Shred version
pub shred_version: Option<u16>,
}
/// Map of leader base58 identity pubkeys to the slot indices relative to the first epoch slot

View File

@ -2789,6 +2789,7 @@ pub mod rpc_full {
rpc: valid_address_or_none(&contact_info.rpc),
version,
feature_set,
shred_version: Some(my_shred_version),
})
} else {
None // Exclude spy nodes
@ -4074,7 +4075,7 @@ pub mod tests {
.expect("actual response deserialization");
let expected = format!(
r#"{{"jsonrpc":"2.0","result":[{{"pubkey": "{}", "gossip": "127.0.0.1:1235", "tpu": "127.0.0.1:1234", "rpc": "127.0.0.1:{}", "version": null, "featureSet": null}}],"id":1}}"#,
r#"{{"jsonrpc":"2.0","result":[{{"pubkey": "{}", "gossip": "127.0.0.1:1235", "shredVersion": 0, "tpu": "127.0.0.1:1234", "rpc": "127.0.0.1:{}", "version": null, "featureSet": null}}],"id":1}}"#,
leader_pubkey,
rpc_port::DEFAULT_RPC_PORT
);