mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 21:38:31 +00:00
Persist/load DHT on shutdown/startup (#659)
* Store dht enrs on shutdown * Load enrs on startup and add tests * Remove enr_entries from behavior * Move all dht persisting logic to `NetworkService` * Move `PersistedDht` from eth2-libp2p to network crate * Add test to confirm dht persistence * Add logging * Remove extra call to beacon_chain persist * Expose only mutable `add_enr` method from behaviour * Fix tests * Fix merge errors
This commit is contained in:
committed by
Age Manning
parent
89f05e4a4f
commit
23a35c3767
@@ -11,6 +11,7 @@ pub enum Error {
|
||||
PartialBeaconStateError,
|
||||
HotColdDBError(HotColdDBError),
|
||||
DBError { message: String },
|
||||
RlpError(String),
|
||||
}
|
||||
|
||||
impl From<DecodeError> for Error {
|
||||
|
||||
@@ -171,6 +171,7 @@ pub enum DBColumn {
|
||||
BeaconStateRoots,
|
||||
BeaconHistoricalRoots,
|
||||
BeaconRandaoMixes,
|
||||
DhtEnrs,
|
||||
}
|
||||
|
||||
impl Into<&'static str> for DBColumn {
|
||||
@@ -187,6 +188,7 @@ impl Into<&'static str> for DBColumn {
|
||||
DBColumn::BeaconStateRoots => "bsr",
|
||||
DBColumn::BeaconHistoricalRoots => "bhr",
|
||||
DBColumn::BeaconRandaoMixes => "brm",
|
||||
DBColumn::DhtEnrs => "dht",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user