Skip to content

Commit ce7be87

Browse files
committed
Deactivate pruning in protocol parameters store
1 parent cb22722 commit ce7be87

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

mithril-aggregator/src/database/provider/epoch_setting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use mithril_common::StdError;
2121
use tokio::sync::Mutex;
2222

2323
/// Delete epoch settings for Epoch older than this.
24-
const EPOCH_SETTING_PRUNE_EPOCH_THRESHOLD: Epoch = Epoch(3);
24+
const EPOCH_SETTING_PRUNE_EPOCH_THRESHOLD: Epoch = Epoch(10);
2525

2626
/// Settings for an epoch, including the protocol parameters.
2727
#[derive(Debug, PartialEq)]

mithril-aggregator/src/store/protocol_parameters_store.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ impl StorePruner for ProtocolParametersStore {
5252
fn get_max_records(&self) -> Option<usize> {
5353
self.retention_len
5454
}
55+
56+
/// Pruning is deactivated on this store.
57+
async fn prune(&self) -> Result<(), StoreError> {
58+
Ok(())
59+
}
5560
}
5661

5762
#[async_trait]
@@ -160,7 +165,11 @@ mod tests {
160165
.save_protocol_parameters(Epoch(3), protocol_parameters[2].1.clone())
161166
.await
162167
.unwrap();
163-
assert_eq!(None, store.get_protocol_parameters(Epoch(1)).await.unwrap());
168+
assert!(store
169+
.get_protocol_parameters(Epoch(1))
170+
.await
171+
.unwrap()
172+
.is_some());
164173
let res = store.get_protocol_parameters(Epoch(2)).await.unwrap();
165174
assert!(res.is_some());
166175
}
@@ -192,11 +201,11 @@ mod tests {
192201
.get_protocol_parameters(Epoch(1))
193202
.await
194203
.unwrap()
195-
.is_none());
204+
.is_some());
196205
assert!(store
197206
.get_protocol_parameters(Epoch(2))
198207
.await
199208
.unwrap()
200-
.is_none());
209+
.is_some());
201210
}
202211
}

0 commit comments

Comments
 (0)