Snapshot manifest block added to prometheus (#232)
Co-authored-by: adria0.eth <5526331+adria0@users.noreply.github.com>
This commit is contained in:
@@ -853,6 +853,13 @@ impl SnapshotService for Service {
|
||||
self.reader.read().as_ref().map(|r| r.manifest().clone())
|
||||
}
|
||||
|
||||
fn manifest_block(&self) -> Option<(u64, H256)> {
|
||||
self.reader.read().as_ref().map(|reader| {
|
||||
let manifest = reader.manifest();
|
||||
(manifest.block_number, manifest.block_hash)
|
||||
})
|
||||
}
|
||||
|
||||
fn supported_versions(&self) -> Option<(u64, u64)> {
|
||||
self.engine
|
||||
.snapshot_components()
|
||||
|
||||
@@ -26,6 +26,9 @@ pub trait SnapshotService: Sync + Send {
|
||||
/// Query the most recent manifest data.
|
||||
fn manifest(&self) -> Option<ManifestData>;
|
||||
|
||||
/// Query the most recent snapshoted block number and hash.
|
||||
fn manifest_block(&self) -> Option<(u64, H256)>;
|
||||
|
||||
/// Get the supported range of snapshot version numbers.
|
||||
/// `None` indicates warp sync isn't supported by the consensus engine.
|
||||
fn supported_versions(&self) -> Option<(u64, u64)>;
|
||||
|
||||
Reference in New Issue
Block a user