-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(chain): expunge
rocksdb
from near-jsonrpc-primitives
dep…
…endency tree (#4651) Under the initiative to build `near-api-rs`, we need to ensure its dependencies from within `nearcore` are as lightweight as possible. On initial inspection, `near-jsonrpc-primitives`, which should be lightweight enough to be used across the ecosystem, actually isn't, as it's dependency tree currently includes `rocksdb`. To remedy this, we extract useful structures from `near-chunks` and `near-network` into their own `-primitives` counterpart crates and depend on those instead. ### New Crates - `near-chunks-primitives` from `near-chunks` - `near-network-primitives` from `near-network` ### Analysis Dump of `cargo tree -p near-jsonrpc-primitives | wc -l`: ```console 624 master (before this refactor) 610 after introducing `near-chunks-primitives` (`rocksdb` still present) 494 after introducing `near-network-primitives` (bye, bye, rocksdb) 459 after refining `near-network{,-primitives}` 457 after moving metrics back to `near-network` (thanks, @bowenwang1996) 417 after removing `metric_recorder` and moving it's dependent back to `near-network` ``` #### Test Plan - [X] Ensure unit tests pass <sub> <i> An unfortunate consequence of this kind of code movearound is that git looses track of blame, but for reference, modules in either of the new crates that git thinks of as a "new file", was extracted from their original counterparts. </i> </sub>
- Loading branch information
Showing
27 changed files
with
1,213 additions
and
1,466 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "near-chunks-primitives" | ||
version = "0.1.0" | ||
authors = ["Near Inc <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
near-chain-primitives = { path = "../chain-primitives" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod error; | ||
|
||
pub use error::Error; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "near-network-primitives" | ||
version = "0.1.0" | ||
authors = ["Near Inc <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
actix = "=0.11.0-beta.2" | ||
tokio = { version = "1.1", features = ["full"] } | ||
chrono = { version = "0.4.4", features = ["serde"] } | ||
borsh = "0.8.1" | ||
serde = { version = "1", features = [ "derive" ] } | ||
strum = { version = "0.20", features = ["derive"] } | ||
tracing = "0.1.13" | ||
|
||
near-crypto = { path = "../../core/crypto" } | ||
near-primitives = { path = "../../core/primitives" } | ||
|
||
[features] | ||
adversarial = [] | ||
sandbox = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod types; |
Oops, something went wrong.