nearcore
nearcore copied to clipboard
near-o11y crate is too heavy while used in near-primitives and near-chain-configs
Updating near-jsonrpc-client-rs, which uses near-primitives, I saw the following:
![image](https://user-images.githubusercontent.com/304265/230221142-57fdda14-7c81-4eca-bdf3-d87701d1951b.png)
near-primitives from 0.15.0 to 0.16.1 started to transitively depend on actix
(dependency of near-o11y), old clap
3.x (dependency of near-o11y), and old tokio
1.19.0 (pinned in nearcore root Cargo.toml, why?).
It is a bit disappointing to see the previous effort (#7242, #6941) undone.
Solution: avoid near-o11y dependency in near-primitives. It is only used for log_assert!
macro, so just extract it (and log_assert_fail
) into utils/log-assert
standalone crate and drop dependency on o11y
.
Thanks for reporting this! It was not intentional to add these dependencies, just side-effect of various refactoring by engineers who didn't know / think of the fact that the primitives crate has many users and adding heavy dependencies must be avoided.
I will take a look and see how to remove the dependencies.
For whomever who tackles this https://near.zulipchat.com/#narrow/stream/295302-general/topic/publishing.20nearcore.20crates/near/411608655 is some relevant reading.