paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.81k stars 659 forks source link

Rename all Polkadot node crates #984

Open rphmeier opened 3 years ago

rphmeier commented 3 years ago

The names are really long and inconsistent.

Every crate in node/ should be categorized as Core, Network, or Utility. polkadot-node-core will become pnc, polkadot-node-network will become pnn, and we'll have pnu for utility.

Examples: pnc-candidate-backing pnc-candidate-validation pnn-availability-distribution pnn-approval-distribution pnu-subsystem pnu-jobs pnu-subsystem-test pnu-overseer

rphmeier commented 3 years ago

pnu-subsystem-util is kind of ugly so I thought we might split it out into pnu-jobs and other crates. fairly ambivalent about that, open to suggestions.

coriolinus commented 3 years ago

Every crate in node/ should be categorized as Core, Network, or Utility.

My preference would be to not categorize them: I'd have to look up which category each appears in most times anyway. I'm not aware of any namespace conflicts that the categories resolve, either. This implies that we could get away with pn-candidate-backing, pn-availability-distribution, pn-subsystem.

pnu-subsystem-util is kind of ugly

Agree. I've heard it said that util packages are a sign that you haven't finished thinking through your design yet. Now that we're a lot closer to a fully-thought-out design, a refactor there into independent modules with distinct purposes could be good.

ordian commented 3 years ago

pnu-subsystem-util is kind of ugly so I thought we might split it out into pnu-jobs and other crates. fairly ambivalent about that, open to suggestions.

:+1: I'd extract pnu-validator-discovery too

rphmeier commented 3 years ago

I've heard it said that util packages are a sign that you haven't finished thinking through your design yet. Now that we're a lot closer to a fully-thought-out design, a refactor there into independent modules with distinct purposes could be good.

Some light-touch refactoring could be good. I think we've been to eager with e.g. the jobs thing and that's going to cause us some pain later.

We should have the categories and alternate prefixes based on category because it'll better mirror the folder structure that way. It'll generally be obvious from context what's what.