Closed mattsse closed 18 hours ago
currently we do:
https://github.com/paradigmxyz/reth/blob/3408059393bcf03f6727f790ec52f28114e25d02/crates/node/metrics/src/hooks.rs#L24-L26
which makes the metrics crate depend on
https://github.com/paradigmxyz/reth/blob/3408059393bcf03f6727f790ec52f28114e25d02/crates/node/metrics/src/hooks.rs#L4-L4
we can improve this api with a builder API
HooksBuilder { Vec<Box<dyn Hook<Output = ()>>> }
and replace the new function
https://github.com/paradigmxyz/reth/blob/3408059393bcf03f6727f790ec52f28114e25d02/crates/node/metrics/src/hooks.rs#L30-L30
with something like
fn with(mut self, hook: impl Hook)
then we need to change how this type is instantiated and effectively push these:
https://github.com/paradigmxyz/reth/blob/3408059393bcf03f6727f790ec52f28114e25d02/crates/node/metrics/src/hooks.rs#L36-L41
to the callsite
No response
May I take this?
Describe the feature
currently we do:
https://github.com/paradigmxyz/reth/blob/3408059393bcf03f6727f790ec52f28114e25d02/crates/node/metrics/src/hooks.rs#L24-L26
which makes the metrics crate depend on
https://github.com/paradigmxyz/reth/blob/3408059393bcf03f6727f790ec52f28114e25d02/crates/node/metrics/src/hooks.rs#L4-L4
we can improve this api with a builder API
and replace the new function
https://github.com/paradigmxyz/reth/blob/3408059393bcf03f6727f790ec52f28114e25d02/crates/node/metrics/src/hooks.rs#L30-L30
with something like
then we need to change how this type is instantiated and effectively push these:
https://github.com/paradigmxyz/reth/blob/3408059393bcf03f6727f790ec52f28114e25d02/crates/node/metrics/src/hooks.rs#L36-L41
to the callsite
Additional context
No response