-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(chain): expunge rocksdb
from near-jsonrpc-primitives
dependency tree
#4651
Merged
near-bulldozer
merged 12 commits into
near:master
from
miraclx:sherlock/deps/jsonrpc-primitives
Aug 20, 2021
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ba5e4b1
extract Error type from near_chunks to avoid depending on the whole c…
miraclx f34ea89
Merge branch 'master' into sherlock/deps/jsonrpc-primitives
miraclx 2de8dc5
extract structures from near-network into -primitives
miraclx be74434
second pass: refine refactor
miraclx e76b1a2
move near_network_primitives::metrics back into near_network
miraclx 7674f3c
Merge branch 'master' into sherlock/deps/jsonrpc-primitives
miraclx 87e20ec
Merge branch 'master' into sherlock/deps/jsonrpc-primitives
miraclx 981670c
remove metric_recorder
miraclx 8e347ae
Merge branch 'master' into sherlock/deps/jsonrpc-primitives
miraclx b32999b
cleanup artifacts of metric_recorder
miraclx 6eb6206
move routing.rs and all dependent types back into near_network
miraclx b424a0a
Merge branch 'master' into sherlock/deps/jsonrpc-primitives
miraclx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <hello@nearprotocol.com>"] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "near-network-primitives" | ||
version = "0.1.0" | ||
authors = ["Near Inc <hello@nearprotocol.com>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
actix = "=0.11.0-beta.2" | ||
tokio = { version = "1.1", features = ["full"] } | ||
futures = "0.3" | ||
chrono = { version = "0.4.4", features = ["serde"] } | ||
borsh = "0.8.1" | ||
serde = { version = "1", features = [ "derive" ] } | ||
serde_json = "1" | ||
strum = { version = "0.20", features = ["derive"] } | ||
tracing = "0.1.13" | ||
conqueue = "0.4.0" | ||
byteorder = "1.2" | ||
lazy_static = "1.4" | ||
|
||
near-crypto = { path = "../../core/crypto" } | ||
near-primitives = { path = "../../core/primitives" } | ||
near-metrics = { path = "../../core/metrics" } | ||
|
||
[features] | ||
adversarial = [] | ||
metric_recorder = [] | ||
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,6 @@ | ||
#[cfg(feature = "metric_recorder")] | ||
pub mod recorder; | ||
|
||
pub mod metrics; | ||
pub mod routing; | ||
pub mod types; |
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
File renamed without changes.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for moving this file to network-primitives? It feels to me that those counters should be defined in the network crate itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Nice catch!
In this case, we just initialize the crate and move whatever's necessary to liberate
near-client-primitives
from the excess dependencies.Going forward, we can incrementally move whatever's appropriate into their equivalent
-primitives
crates.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does the dependency on
Edge
come from? I don't think it is used outside of the network crateThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, while
near-client-primitives
only required;In the case of
near_network::types
, I believed it was safe to extract as much as was possible since that module name typically encapsulates reusable primitives. And that worked fine with the only exception beingConsolidate
which is retained innear_network::types
.Following that logic,
routing::Edge
has a number of dependents innear_network_primitives::types
. So, naturally, it's extracted alongside it.That aside,
recorder::MetricRecorder
depends ontypes::PeerMessage
which depends ontypes::Edge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that is exactly my concern.
Edge
should not be used outside of the network crate. Why do we needMetricRecorder
innear-client-primitives
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. @miraclx please remove metric_recorder from
NetworkInfoResponse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfornet @bowenwang1996 should the whole feature be removed altogether or just drop the field from the
NetworkInfoResponse
? Is the feature still useful without the exposed data?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the feature should be removed altogether, but my point is that we can now revert the change that extracts network primitives since I don't think they should be in a separate crate to begin with @miraclx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MetricRecorder
was removed, which freed up the dependency onPeerMessage
which, in-turn, freed up the dependency onEdge
. This means::routing
and a number of structures in::types
we're returned tonear-network
.But we (
near_client_primitives
) still neednear_network_primitives::types::{AccountOrPeerIdOrHash, KnownProducer, PeerInfo}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bowenwang1996 @mfornet Could you review the PR after the update?