From 67e6a3106fe3a3dbd7680cb15e12496e4ac01568 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Thu, 13 May 2021 21:33:57 -0600 Subject: [PATCH] rpc: plumb shred_version through RpcContactInfo --- client/src/rpc_response.rs | 2 ++ core/src/rpc.rs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/rpc_response.rs b/client/src/rpc_response.rs index 0b03d400c0..680e018d77 100644 --- a/client/src/rpc_response.rs +++ b/client/src/rpc_response.rs @@ -206,6 +206,8 @@ pub struct RpcContactInfo { pub version: Option, /// First 4 bytes of the FeatureSet identifier pub feature_set: Option, + /// Shred version + pub shred_version: Option, } /// Map of leader base58 identity pubkeys to the slot indices relative to the first epoch slot diff --git a/core/src/rpc.rs b/core/src/rpc.rs index ad0900e22d..a7f83bf1d2 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -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 );