Delete outdated deposits handling in operation pool (#719)

This commit is contained in:
pscott
2019-12-17 00:37:12 +01:00
committed by Michael Sproul
parent 34f003adb8
commit e7de1b3339
4 changed files with 297 additions and 539 deletions

View File

@@ -14,7 +14,6 @@ pub struct PersistedOperationPool<T: EthSpec> {
// We could save space by not storing the attestation ID, but it might
// be difficult to make that roundtrip due to eager aggregation.
attestations: Vec<(AttestationId, Vec<Attestation<T>>)>,
deposits: Vec<(u64, Deposit)>,
/// Attester slashings.
attester_slashings: Vec<AttesterSlashing<T>>,
/// Proposer slashings.
@@ -33,13 +32,6 @@ impl<T: EthSpec> PersistedOperationPool<T> {
.map(|(att_id, att)| (att_id.clone(), att.clone()))
.collect();
let deposits = operation_pool
.deposits
.read()
.iter()
.map(|(index, d)| (*index, d.clone()))
.collect();
let attester_slashings = operation_pool
.attester_slashings
.read()
@@ -63,7 +55,6 @@ impl<T: EthSpec> PersistedOperationPool<T> {
Self {
attestations,
deposits,
attester_slashings,
proposer_slashings,
voluntary_exits,
@@ -73,7 +64,6 @@ impl<T: EthSpec> PersistedOperationPool<T> {
/// Reconstruct an `OperationPool`.
pub fn into_operation_pool(self, state: &BeaconState<T>, spec: &ChainSpec) -> OperationPool<T> {
let attestations = RwLock::new(self.attestations.into_iter().collect());
let deposits = RwLock::new(self.deposits.into_iter().collect());
let attester_slashings = RwLock::new(
self.attester_slashings
.into_iter()
@@ -100,7 +90,6 @@ impl<T: EthSpec> PersistedOperationPool<T> {
OperationPool {
attestations,
deposits,
attester_slashings,
proposer_slashings,
voluntary_exits,