nearcore icon indicating copy to clipboard operation
nearcore copied to clipboard

near-o11y crate is too heavy while used in near-primitives and near-chain-configs

Open frol opened this issue 1 year ago • 2 comments

Updating near-jsonrpc-client-rs, which uses near-primitives, I saw the following:

image

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.

frol avatar Apr 05 '23 22:04 frol

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.

jakmeier avatar Apr 06 '23 11:04 jakmeier

For whomever who tackles this https://near.zulipchat.com/#narrow/stream/295302-general/topic/publishing.20nearcore.20crates/near/411608655 is some relevant reading.

nagisa avatar Jan 07 '24 20:01 nagisa