Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Addressed
Anchor depends on some parts of Lighthouse. Due to certain dependencies between crates, it pulled in far more crates than necessary, causing longer builds.
Proposed Changes
remove ensure_dir_exists:
account_utils
andvalidator_dir
used thedirectory
crate for a single function:ensure_dir_exists
. This function had questionable value, ascreate_dir_all
is a no-op if the directory exists anyway. Removeensure_dir_exists
and the two dependencies ondirectory
, which is potentially expensive to depend on due to its dependency onclap_utils
.group UNHANDLED_ERRORs into a generic:
warp_utils
depends onbeacon_chain
to providebeacon_chain_error
. This causesvalidator_client
to depend onbeacon_chain
transitively, which is not nice.Remove
beacon_chain_error
and similar functions and provide a genericunhandled_error
instead, which behaves exactly the same.Introduce separate
health_metrics
crate by Sayan: Thewarp_utils
crate contained facilities for capturing health metrics. Anchor wants those metrics, but also wants to avoid pulling inwarp
, as we areaxum
-only, so we introduce a new crate calledhealth_metrics
. We use the opportunity to also move the logic for capturing this data frometh2
to that new crate.Additional Info
Lighthouse also benefits from this, as the build can run more parallelized.