Skip to content

Commit 961fe22

Browse files
Remove unused dependencies and restrict use of alloy. (#3907)
## Motivation Machete is imprecise for finding unused dependencies. With the help of a simple script more unused dependencies were found. Also, the use of `alloy::primitives` poses some problems and was eliminated when possible. ## Proposal A specific program was designed for this search. It is not particularly clever, but we had several missed stuff that machete could not find and `cargo +nightly udeps` could not find as well. For the basic types, we want to avoid the use of `alloy::primitives` as it a library with dependency on `c-kzg`. So, instead it was replaced by `alloy_primitives` and `revm_primitives`. ## Test Plan The CI. ## Release Plan - Nothing to do / These changes follow the usual release cycle. ## Links The program being used is available at [cargo_package_management](https://github.com/MathieuDutSik/cargo_package_management).
1 parent 03c7875 commit 961fe22

File tree

12 files changed

+5
-48
lines changed

12 files changed

+5
-48
lines changed

Cargo.lock

Lines changed: 1 addition & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ alloy-primitives = { version = "1.0.0", default-features = false, features = [
4545
"serde",
4646
"k256",
4747
] }
48-
alloy-signer = { version = "0.9.2", default-features = false }
4948
alloy-sol-types = "1.0.0"
5049
anyhow = "1.0.80"
5150
assert_matches = "1.5.0"
@@ -161,7 +160,6 @@ serde_with = { version = "3", default-features = false, features = [
161160
"alloc",
162161
"macros",
163162
] }
164-
serde_yaml = "0.8.26"
165163
sha3 = "0.10.8"
166164
similar-asserts = "1.5.0"
167165
static_assertions = "1.1.0"

examples/Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

linera-chain/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ web = ["linera-base/web", "linera-views/web", "linera-execution/web"]
2626
[dependencies]
2727
anyhow = { workspace = true, optional = true }
2828
async-graphql.workspace = true
29-
async-trait.workspace = true
3029
axum = { workspace = true, optional = true }
3130
custom_debug_derive.workspace = true
3231
futures.workspace = true

linera-client/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ linera-rpc = { workspace = true, features = ["server", "simple-network"] }
101101
cfg_aliases.workspace = true
102102

103103
[dev-dependencies]
104-
alloy = { workspace = true, default-features = false, features = [
105-
"rpc-types-eth",
106-
] }
107104
amm.workspace = true
108105
anyhow.workspace = true
109106
base64.workspace = true

linera-execution/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ revm = [
1818
"dep:revm-primitives",
1919
"dep:revm-precompile",
2020
"dep:revm-interpreter",
21-
"dep:alloy",
2221
"dep:alloy-primitives",
2322
"dep:alloy-sol-types",
2423
"dep:hex",
@@ -31,9 +30,6 @@ wasmtime = ["dep:wasmtime", "linera-witty/wasmtime"]
3130
web = ["linera-base/web", "linera-views/web", "js-sys"]
3231

3332
[dependencies]
34-
alloy = { workspace = true, default-features = false, optional = true, features = [
35-
"rpc-types-eth",
36-
] }
3733
alloy-primitives = { workspace = true, optional = true }
3834
alloy-sol-types = { workspace = true, optional = true }
3935
anyhow.workspace = true

linera-execution/src/evm/database.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ use std::{
99
sync::{Arc, Mutex},
1010
};
1111

12-
use alloy::primitives::{Address, B256, U256};
1312
use linera_views::common::from_bytes_option;
1413
use revm::{
1514
db::AccountState,
1615
primitives::{keccak256, state::AccountInfo},
1716
Database, DatabaseCommit, DatabaseRef,
1817
};
19-
use revm_primitives::{address, BlobExcessGasAndPrice, BlockEnv, EvmState};
18+
use revm_primitives::{address, Address, BlobExcessGasAndPrice, BlockEnv, EvmState, B256, U256};
2019

2120
use crate::{BaseRuntime, Batch, ContractRuntime, ExecutionError, ViewError};
2221

linera-execution/src/evm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub enum EvmExecutionError {
3434
#[error("The operation was reverted")]
3535
Revert {
3636
gas_used: u64,
37-
output: alloy::primitives::Bytes,
37+
output: revm_primitives::Bytes,
3838
},
3939
#[error("The operation was halted")]
4040
Halt { gas_used: u64, reason: HaltReason },

linera-execution/src/evm/revm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use core::ops::Range;
77
use std::{convert::TryFrom, sync::Arc};
88

9-
use alloy::primitives::Address;
109
use linera_base::{
1110
crypto::CryptoHash,
1211
data_types::{Bytecode, Resources, SendMessageRequest, StreamUpdate},
@@ -22,7 +21,7 @@ use revm::{
2221
use revm_interpreter::{CallInputs, CallOutcome, Gas, InstructionResult, InterpreterResult};
2322
use revm_precompile::PrecompileResult;
2423
use revm_primitives::{
25-
address, EvmState, ExecutionResult, Log, Output, PrecompileErrors, PrecompileOutput,
24+
address, Address, EvmState, ExecutionResult, Log, Output, PrecompileErrors, PrecompileOutput,
2625
SuccessReason, TxKind,
2726
};
2827
#[cfg(with_metrics)]

linera-service/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ tracing.workspace = true
121121
cfg_aliases.workspace = true
122122

123123
[dev-dependencies]
124-
alloy = { workspace = true, default-features = false, features = [
125-
"rpc-types-eth",
126-
] }
127124
amm.workspace = true
128125
base64.workspace = true
129126
call-evm-counter.workspace = true

0 commit comments

Comments
 (0)