@@ -181,6 +181,9 @@ pub struct ValidatorSlotData {
181181 /// (Bloxroute) Collection of regional endpoints validator is connected to.
182182 #[ serde( default ) ]
183183 pub regional_endpoints : Vec < BloxrouteRegionalEndpoint > ,
184+ /// (Titan) Validator preferences.
185+ #[ serde( default ) ]
186+ pub preferences : Option < TitanValidatorPreferences > ,
184187}
185188
186189/// Bloxroute validator RProxy details.
@@ -198,6 +201,13 @@ pub struct BloxrouteRegionalEndpoint {
198201 pub websocket_endpoint : String ,
199202}
200203
204+ /// Titan validator preferences.
205+ #[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize , Hash ) ]
206+ pub struct TitanValidatorPreferences {
207+ /// Flag indicating whether the validator is censoring.
208+ pub censoring : bool ,
209+ }
210+
201211#[ derive( Clone , Debug ) ]
202212pub struct BidMetadata {
203213 pub sequence : u64 ,
@@ -217,3 +227,74 @@ pub struct SubmitBlockRequestWithMetadata {
217227 pub submission : SubmitBlockRequest ,
218228 pub metadata : BidMetadata ,
219229}
230+
231+ #[ cfg( test) ]
232+ mod tests {
233+ use super :: * ;
234+
235+ #[ test]
236+ fn validator_slot_data_ser_deser ( ) {
237+ let registrations = [
238+ r#"
239+ {
240+ "slot": "123",
241+ "validator_index": "123",
242+ "entry": {
243+ "message": {
244+ "fee_recipient": "0x0000000000000000000000000000000000000000",
245+ "gas_limit": "60000000",
246+ "timestamp": "123",
247+ "pubkey": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
248+ },
249+ "signature": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
250+ }
251+ }
252+ "# ,
253+ r#"
254+ {
255+ "slot": "123",
256+ "validator_index": "123",
257+ "entry": {
258+ "message": {
259+ "fee_recipient": "0x0000000000000000000000000000000000000000",
260+ "gas_limit": "60000000",
261+ "timestamp": "123",
262+ "pubkey": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
263+ },
264+ "signature": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
265+ },
266+ "regional_endpoints": [
267+ {
268+ "name": "",
269+ "region": "",
270+ "http_endpoint": "http://0.0.0.0",
271+ "grpc_endpoint": "grpc://0.0.0.0",
272+ "websocket_endpoint": "ws://0.0.0.0"
273+ }
274+ ]
275+ }
276+ "# ,
277+ r#"
278+ {
279+ "slot": "123",
280+ "validator_index": "123",
281+ "entry": {
282+ "message": {
283+ "fee_recipient": "0x0000000000000000000000000000000000000000",
284+ "gas_limit": "60000000",
285+ "timestamp": "123",
286+ "pubkey": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
287+ },
288+ "signature": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
289+ },
290+ "preferences": {
291+ "censoring": false
292+ }
293+ }
294+ "# ,
295+ ] ;
296+ for raw in registrations {
297+ assert ! ( serde_json:: from_str:: <ValidatorSlotData >( raw) . is_ok( ) ) ;
298+ }
299+ }
300+ }
0 commit comments