Skip to content

Commit 9165b82

Browse files
authored
Update to cargo-sort v2 (#3026)
## Description A new cargo sort version, 2.0, was released yesterday. This PR applies the new formatting to `Cargo.toml` files. Since the new version of `cargo sort` also formats the toml files, `npx prettier` is removed. Moreover, the `cargo binstall` version in our CI isn't working, and errors out with: ``` /home/runner/.cargo/bin/cargo-sort: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /home/runner/.cargo/bin/cargo-sort) ``` So this PR also changes the CI to use `cargo install` until this issue has been resolved. ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog ### Before requesting review - [x] I have reviewed the code myself - [x] I have created follow-up issues caused by this PR and linked them here
1 parent bf260a6 commit 9165b82

File tree

32 files changed

+458
-503
lines changed

32 files changed

+458
-503
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,10 @@ jobs:
7676
- uses: dtolnay/rust-toolchain@master
7777
with:
7878
toolchain: ${{ env.RUST_VERSION }}
79-
- name: setup binstall
80-
uses: taiki-e/install-action@cargo-binstall
8179
- name: Install Cargo.toml linter
82-
run: cargo binstall --no-confirm cargo-sort
80+
run: cargo install cargo-sort
8381
- name: Run Cargo.toml sort check
8482
run: cargo sort -w --check
85-
- name: Install Prettier and TOML Plugin
86-
run: |
87-
# prettier has issues with global installation and plugin discovery. The temporary `package.json` created by `npm init -y` is a workaround.
88-
npm init -y > /dev/null 2>&1
89-
npm install prettier prettier-plugin-toml
90-
- name: Check format of Cargo.toml files
91-
run: |
92-
if ! npx prettier --check "**/Cargo.toml"; then
93-
npx prettier --write "**/Cargo.toml" > /dev/null 2>&1
94-
echo "Changes required:"
95-
git --no-pager diff
96-
exit 1
97-
fi
9883
- uses: FuelLabs/.github/.github/actions/slack-notify-template@master
9984
if: always() && github.ref == 'refs/heads/master'
10085
with:

Cargo.toml

Lines changed: 115 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,47 @@
11
[workspace]
22
# Use the new resolver to prevent dev-deps and build-deps from enabling debugging or test features in production.
33
members = [
4-
"benches",
5-
"bin/e2e-test-client",
6-
"bin/fuel-core",
7-
"bin/fuel-core-client",
8-
"bin/keygen",
9-
"crates/chain-config",
10-
"crates/client",
11-
"crates/compression",
12-
"crates/database",
13-
"crates/fuel-core",
14-
"crates/fuel-gas-price-algorithm",
15-
"crates/keygen",
16-
"crates/metrics",
17-
"crates/services",
18-
"crates/services/compression",
19-
"crates/services/consensus_module",
20-
"crates/services/consensus_module/bft",
21-
"crates/services/consensus_module/poa",
22-
"crates/services/executor",
23-
"crates/services/gas_price_service",
24-
"crates/services/importer",
25-
"crates/services/p2p",
26-
"crates/services/parallel-executor",
27-
"crates/services/producer",
28-
"crates/services/relayer",
29-
"crates/services/shared-sequencer",
30-
"crates/services/sync",
31-
"crates/services/tx_status_manager",
32-
"crates/services/txpool_v2",
33-
"crates/services/upgradable-executor",
34-
"crates/services/upgradable-executor/wasm-executor",
35-
"crates/storage",
36-
"crates/trace",
37-
"crates/types",
38-
"tests",
39-
"xtask",
4+
"benches",
5+
"bin/e2e-test-client",
6+
"bin/fuel-core",
7+
"bin/fuel-core-client",
8+
"bin/keygen",
9+
"crates/chain-config",
10+
"crates/client",
11+
"crates/compression",
12+
"crates/database",
13+
"crates/fuel-core",
14+
"crates/fuel-gas-price-algorithm",
15+
"crates/keygen",
16+
"crates/metrics",
17+
"crates/services",
18+
"crates/services/compression",
19+
"crates/services/consensus_module",
20+
"crates/services/consensus_module/bft",
21+
"crates/services/consensus_module/poa",
22+
"crates/services/executor",
23+
"crates/services/gas_price_service",
24+
"crates/services/importer",
25+
"crates/services/p2p",
26+
"crates/services/parallel-executor",
27+
"crates/services/producer",
28+
"crates/services/relayer",
29+
"crates/services/shared-sequencer",
30+
"crates/services/sync",
31+
"crates/services/tx_status_manager",
32+
"crates/services/txpool_v2",
33+
"crates/services/upgradable-executor",
34+
"crates/services/upgradable-executor/wasm-executor",
35+
"crates/storage",
36+
"crates/trace",
37+
"crates/types",
38+
"tests",
39+
"xtask",
4040
]
4141
resolver = "2"
4242

4343
exclude = ["version-compatibility"]
4444

45-
[profile.release]
46-
codegen-units = 1
47-
lto = "fat"
48-
# The difference in performance for "fat" and "thin" is small,
49-
# but "thin" LTO is much faster to compile.
50-
# If you play with benchmarks or flamegraphs, it is better to use "thin"
51-
# To speedup iterations between compilation.
52-
#lto = "thin"
53-
panic = "unwind"
54-
5545
[workspace.package]
5646
authors = ["Fuel Labs <[email protected]>"]
5747
categories = ["concurrency", "cryptography::cryptocurrencies", "emulators"]
@@ -64,111 +54,121 @@ rust-version = "1.85.0"
6454
version = "0.43.2"
6555

6656
[workspace.dependencies]
57+
58+
# Common dependencies
59+
anyhow = "1.0"
60+
async-graphql = { version = "=7.0.15", features = [
61+
"graphiql",
62+
"tracing",
63+
], default-features = false }
64+
async-trait = "0.1"
65+
aws-sdk-kms = "1.37"
66+
axum = "0.5"
67+
bytes = "1.5.0"
68+
clap = "4.4"
69+
cynic = { version = "3.1.0", features = ["http-reqwest"] }
70+
derive_more = { version = "0.99" }
71+
ed25519 = { version = "2.2.3", default-features = false }
72+
ed25519-dalek = { version = "2.1.1", default-features = false }
73+
educe = { version = "0.6", default-features = false, features = [
74+
"Eq",
75+
"PartialEq",
76+
"Hash",
77+
"Debug",
78+
] }
79+
enum-iterator = "1.2"
80+
enum_dispatch = "0.3.13"
6781
# Workspace members
6882
fuel-core = { version = "0.43.2", path = "./crates/fuel-core", default-features = false }
69-
fuel-core-client-bin = { version = "0.43.2", path = "./bin/fuel-core-client" }
83+
fuel-core-bft = { version = "0.43.2", path = "./crates/services/consensus_module/bft" }
7084
fuel-core-bin = { version = "0.43.2", path = "./bin/fuel-core" }
71-
fuel-core-keygen = { version = "0.43.2", path = "./crates/keygen" }
72-
fuel-core-keygen-bin = { version = "0.43.2", path = "./bin/keygen" }
7385
fuel-core-chain-config = { version = "0.43.2", path = "./crates/chain-config", default-features = false }
7486
fuel-core-client = { version = "0.43.2", path = "./crates/client" }
87+
fuel-core-client-bin = { version = "0.43.2", path = "./bin/fuel-core-client" }
7588
fuel-core-compression = { version = "0.43.2", path = "./crates/compression" }
7689
fuel-core-compression-service = { version = "0.43.2", path = "./crates/services/compression" }
77-
fuel-core-database = { version = "0.43.2", path = "./crates/database" }
78-
fuel-core-metrics = { version = "0.43.2", path = "./crates/metrics" }
79-
fuel-core-services = { version = "0.43.2", path = "./crates/services" }
8090
fuel-core-consensus-module = { version = "0.43.2", path = "./crates/services/consensus_module" }
81-
fuel-core-bft = { version = "0.43.2", path = "./crates/services/consensus_module/bft" }
82-
fuel-core-poa = { version = "0.43.2", path = "./crates/services/consensus_module/poa" }
83-
fuel-core-shared-sequencer = { version = "0.43.2", path = "crates/services/shared-sequencer" }
91+
fuel-core-database = { version = "0.43.2", path = "./crates/database" }
8492
fuel-core-executor = { version = "0.43.2", path = "./crates/services/executor", default-features = false }
85-
fuel-core-importer = { version = "0.43.2", path = "./crates/services/importer" }
8693
fuel-core-gas-price-service = { version = "0.43.2", path = "crates/services/gas_price_service" }
94+
fuel-core-importer = { version = "0.43.2", path = "./crates/services/importer" }
95+
fuel-core-keygen = { version = "0.43.2", path = "./crates/keygen" }
96+
fuel-core-keygen-bin = { version = "0.43.2", path = "./bin/keygen" }
97+
fuel-core-metrics = { version = "0.43.2", path = "./crates/metrics" }
8798
fuel-core-p2p = { version = "0.43.2", path = "./crates/services/p2p" }
8899
fuel-core-parallel-executor = { version = "0.43.2", path = "./crates/services/parallel-executor" }
100+
fuel-core-poa = { version = "0.43.2", path = "./crates/services/consensus_module/poa" }
89101
fuel-core-producer = { version = "0.43.2", path = "./crates/services/producer" }
90102
fuel-core-relayer = { version = "0.43.2", path = "./crates/services/relayer" }
91-
fuel-core-sync = { version = "0.43.2", path = "./crates/services/sync" }
92-
fuel-core-txpool = { version = "0.43.2", path = "./crates/services/txpool_v2" }
93-
fuel-core-tx-status-manager = { version = "0.43.2", path = "./crates/services/tx_status_manager" }
103+
fuel-core-services = { version = "0.43.2", path = "./crates/services" }
104+
fuel-core-shared-sequencer = { version = "0.43.2", path = "crates/services/shared-sequencer" }
94105
fuel-core-storage = { version = "0.43.2", path = "./crates/storage", default-features = false }
106+
fuel-core-sync = { version = "0.43.2", path = "./crates/services/sync" }
107+
fuel-core-tests = { version = "0.0.0", path = "./tests" }
95108
fuel-core-trace = { version = "0.43.2", path = "./crates/trace" }
109+
fuel-core-tx-status-manager = { version = "0.43.2", path = "./crates/services/tx_status_manager" }
110+
fuel-core-txpool = { version = "0.43.2", path = "./crates/services/txpool_v2" }
96111
fuel-core-types = { version = "0.43.2", path = "./crates/types", default-features = false }
97-
fuel-core-tests = { version = "0.0.0", path = "./tests" }
98112
fuel-core-upgradable-executor = { version = "0.43.2", path = "./crates/services/upgradable-executor" }
99113
fuel-core-wasm-executor = { version = "0.43.2", path = "./crates/services/upgradable-executor/wasm-executor", default-features = false }
100114
fuel-core-xtask = { version = "0.0.0", path = "./xtask" }
101115
fuel-gas-price-algorithm = { version = "0.43.2", path = "crates/fuel-gas-price-algorithm" }
102116

103117
# Fuel dependencies
104118
fuel-vm-private = { version = "0.62.0", package = "fuel-vm", default-features = false }
105-
106-
# Common dependencies
107-
anyhow = "1.0"
108-
async-graphql = { version = "=7.0.15", features = [
109-
"graphiql",
110-
"tracing",
111-
], default-features = false }
112-
async-trait = "0.1"
113-
aws-sdk-kms = "1.37"
114-
cynic = { version = "3.1.0", features = ["http-reqwest"] }
115-
clap = "4.4"
116-
educe = { version = "0.6", default-features = false, features = [
117-
"Eq",
118-
"PartialEq",
119-
"Hash",
120-
"Debug",
121-
] }
122-
ed25519 = { version = "2.2.3", default-features = false }
123-
ed25519-dalek = { version = "2.1.1", default-features = false }
124-
derive_more = { version = "0.99" }
125-
enum_dispatch = "0.3.13"
126-
enum-iterator = "1.2"
119+
futures = "0.3"
127120
hex = { version = "0.4", features = ["serde"] }
128121
hyper = { version = "0.14.26" }
122+
impl-tools = "0.10"
123+
indicatif = { version = "0.17", default-features = false }
124+
insta = "1.8"
125+
itertools = { version = "0.12", default-features = false }
126+
mockall = "0.11"
129127
num-rational = "0.4.2"
130-
primitive-types = { version = "0.12", default-features = false }
131-
rand = "0.8"
128+
num_enum = "0.7"
129+
once_cell = "1.16"
132130
parking_lot = "0.12"
133-
tokio = { version = "1.27", default-features = false }
134-
tokio-rayon = "2.1.0"
135-
tokio-stream = "0.1"
136-
tokio-util = { version = "0.7", default-features = false }
137-
tracing = "0.1"
138-
thiserror = "1.0"
139-
futures = "0.3"
131+
parquet = { version = "49.0", default-features = false }
132+
paste = "1.0"
133+
pin-project-lite = "0.2"
140134
postcard = "1.0"
141-
tracing-attributes = "0.1"
142-
tracing-subscriber = "0.3"
135+
pretty_assertions = "1.4.0"
136+
primitive-types = { version = "0.12", default-features = false }
137+
prometheus-client = "0.22.0"
138+
proptest = "1.1"
139+
rand = "0.8"
140+
rayon = "1.10.0"
141+
# enable cookie store to support L7 sticky sessions
142+
reqwest = { version = "0.12.0", default-features = false, features = [
143+
"rustls-tls",
144+
"cookies",
145+
] }
143146
serde = "1.0"
144147
serde-big-array = { version = "0.5", default-features = false }
145148
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
146149
serde_with = { version = "3.4", default-features = false }
147150
strum = { version = "0.25" }
148151
strum_macros = "0.25"
149-
# enable cookie store to support L7 sticky sessions
150-
reqwest = { version = "0.12.0", default-features = false, features = [
151-
"rustls-tls",
152-
"cookies",
153-
] }
154-
mockall = "0.11"
155-
num_enum = "0.7"
152+
tempfile = "3.4"
156153
test-case = "3.3"
157-
impl-tools = "0.10"
158154
test-strategy = "0.3"
159-
parquet = { version = "49.0", default-features = false }
160-
rayon = "1.10.0"
161-
bytes = "1.5.0"
162-
paste = "1.0"
163-
pretty_assertions = "1.4.0"
164-
proptest = "1.1"
165-
pin-project-lite = "0.2"
166-
axum = "0.5"
167-
once_cell = "1.16"
168-
prometheus-client = "0.22.0"
169-
indicatif = { version = "0.17", default-features = false }
170-
itertools = { version = "0.12", default-features = false }
171-
insta = "1.8"
172-
tempfile = "3.4"
155+
thiserror = "1.0"
173156
tikv-jemallocator = "0.5"
157+
tokio = { version = "1.27", default-features = false }
158+
tokio-rayon = "2.1.0"
159+
tokio-stream = "0.1"
160+
tokio-util = { version = "0.7", default-features = false }
161+
tracing = "0.1"
162+
tracing-attributes = "0.1"
163+
tracing-subscriber = "0.3"
174164
url = "2.2"
165+
166+
[profile.release]
167+
codegen-units = 1
168+
lto = "fat"
169+
# The difference in performance for "fat" and "thin" is small,
170+
# but "thin" LTO is much faster to compile.
171+
# If you play with benchmarks or flamegraphs, it is better to use "thin"
172+
# To speedup iterations between compilation.
173+
#lto = "thin"
174+
panic = "unwind"

benches/Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ publish = false
66
rust-version = { workspace = true }
77
version = "0.0.0"
88

9+
[features]
10+
default = ["fuel-core/rocksdb", "fuel-core/rocksdb-production"]
11+
fault-proving = [
12+
"fuel-core-types/fault-proving",
13+
"fuel-core-chain-config/fault-proving",
14+
"fuel-core/fault-proving",
15+
"fuel-core-storage/fault-proving",
16+
"fuel-core-database/fault-proving",
17+
"fuel-core-sync/fault-proving",
18+
]
19+
920
[dependencies]
1021
anyhow = { workspace = true }
1122
async-trait = { workspace = true }
@@ -66,17 +77,6 @@ name = "state"
6677
harness = false
6778
name = "vm"
6879

69-
[features]
70-
default = ["fuel-core/rocksdb", "fuel-core/rocksdb-production"]
71-
fault-proving = [
72-
"fuel-core-types/fault-proving",
73-
"fuel-core-chain-config/fault-proving",
74-
"fuel-core/fault-proving",
75-
"fuel-core-storage/fault-proving",
76-
"fuel-core-database/fault-proving",
77-
"fuel-core-sync/fault-proving",
78-
]
79-
8080
[[bench]]
8181
harness = false
8282
name = "block_target_gas"

bin/e2e-test-client/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ rust-version = { workspace = true }
1111
version = { workspace = true }
1212
name = "fuel-core-e2e-client"
1313
publish = false
14+
15+
[features]
16+
default = []
1417
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1518

1619
[dependencies]
@@ -41,6 +44,3 @@ fuel-core = { workspace = true, features = [
4144
fuel-core-trace = { path = "../../crates/trace" }
4245
insta = { workspace = true }
4346
tempfile = { workspace = true }
44-
45-
[features]
46-
default = []

0 commit comments

Comments
 (0)