@@ -7,7 +7,7 @@ use crate::{
77} ;
88
99#[ derive( Debug , Deserialize ) ]
10- #[ serde( rename_all = "camelCase" ) ]
10+ #[ serde( rename_all = "camelCase" , deny_unknown_fields ) ]
1111pub struct Config {
1212 amqp : Amqp ,
1313 jobs : Jobs ,
@@ -17,11 +17,15 @@ pub struct Config {
1717
1818 accounts : Accounts ,
1919 instructions : Instructions ,
20+
21+ /// Unused but required by the validator to load the plugin
22+ #[ allow( dead_code) ]
23+ libpath : String ,
2024}
2125
2226#[ serde_with:: serde_as]
2327#[ derive( Debug , Deserialize ) ]
24- #[ serde( rename_all = "camelCase" ) ]
28+ #[ serde( rename_all = "camelCase" , deny_unknown_fields ) ]
2529pub struct Amqp {
2630 pub address : String ,
2731
@@ -30,7 +34,7 @@ pub struct Amqp {
3034}
3135
3236#[ derive( Debug , Deserialize ) ]
33- #[ serde( rename_all = "camelCase" ) ]
37+ #[ serde( rename_all = "camelCase" , deny_unknown_fields ) ]
3438pub struct Jobs {
3539 pub limit : usize ,
3640
@@ -39,22 +43,27 @@ pub struct Jobs {
3943}
4044
4145#[ derive( Debug , Default , Deserialize ) ]
42- #[ serde( rename_all = "camelCase" ) ]
46+ #[ serde( rename_all = "camelCase" , deny_unknown_fields ) ]
4347pub struct Metrics {
4448 pub config : Option < String > ,
4549}
4650
4751#[ derive( Debug , Deserialize ) ]
4852#[ serde( rename_all = "camelCase" , deny_unknown_fields) ]
4953pub struct Accounts {
54+ #[ serde( default ) ]
5055 pub owners : HashSet < String > ,
5156
57+ #[ serde( default ) ]
58+ pub pubkeys : HashSet < String > ,
59+
5260 /// Filter for changing how to interpret the `is_startup` flag.
5361 ///
5462 /// This option has three states:
5563 /// - `None`: Ignore the `is_startup` flag and send all updates.
5664 /// - `Some(true)`: Only send updates when `is_startup` is `true`.
5765 /// - `Some(false)`: Only send updates when `is_startup` is `false`.
66+ #[ serde( default ) ]
5867 pub startup : Option < bool > ,
5968
6069 /// Set to true to disable heuristics to reduce the number of incoming
@@ -67,6 +76,7 @@ pub struct Accounts {
6776#[ derive( Debug , Deserialize ) ]
6877#[ serde( rename_all = "camelCase" , deny_unknown_fields) ]
6978pub struct Instructions {
79+ #[ serde( default ) ]
7080 pub programs : HashSet < String > ,
7181
7282 /// Set to true to disable heuristics to reduce the number of incoming
@@ -93,6 +103,7 @@ impl Config {
93103 metrics,
94104 accounts,
95105 instructions,
106+ libpath : _,
96107 } = self ;
97108
98109 let acct =
0 commit comments