Skip to content

Commit

Permalink
cargo update
Browse files Browse the repository at this point in the history
Should fix the recent CI failures re: Ethereum as well.
  • Loading branch information
kayabaNerve committed Oct 9, 2024
1 parent 435f1d9 commit 599b2de
Show file tree
Hide file tree
Showing 13 changed files with 423 additions and 352 deletions.
698 changes: 371 additions & 327 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ parking_lot = { path = "patches/parking_lot" }
zstd = { path = "patches/zstd" }
# Needed for WAL compression
rocksdb = { path = "patches/rocksdb" }
# 1.0.1 was yanked due to a breaking change (an extra field)
# 2.0 has fewer dependencies and still works within our tree
tiny-bip39 = { path = "patches/tiny-bip39" }

# is-terminal now has an std-based solution with an equivalent API
is-terminal = { path = "patches/is-terminal" }
Expand All @@ -155,9 +158,6 @@ matches = { path = "patches/matches" }
option-ext = { path = "patches/option-ext" }
directories-next = { path = "patches/directories-next" }

# https://github.com/alloy-rs/core/issues/717
alloy-sol-type-parser = { git = "https://github.com/alloy-rs/core", rev = "446b9d2fbce12b88456152170709a3eaac929af0" }

[workspace.lints.clippy]
unwrap_or_default = "allow"
borrow_as_ptr = "deny"
Expand Down
6 changes: 4 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ license-files = [
multiple-versions = "warn"
wildcards = "warn"
highlight = "all"
deny = [ { name = "serde_derive", version = ">=1.0.172, <1.0.185" } ]
deny = [
{ name = "serde_derive", version = ">=1.0.172, <1.0.185" },
{ name = "hashbrown", version = ">=0.15" },
]

[sources]
unknown-registry = "deny"
Expand All @@ -102,5 +105,4 @@ allow-git = [
"https://github.com/rust-lang-nursery/lazy-static.rs",
"https://github.com/serai-dex/substrate-bip39",
"https://github.com/serai-dex/substrate",
"https://github.com/alloy-rs/core",
]
14 changes: 7 additions & 7 deletions networks/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ frost = { package = "modular-frost", path = "../../crypto/frost", default-featur

alloy-core = { version = "0.8", default-features = false }
alloy-sol-types = { version = "0.8", default-features = false, features = ["json"] }
alloy-consensus = { version = "0.3", default-features = false, features = ["k256"] }
alloy-network = { version = "0.3", default-features = false }
alloy-rpc-types-eth = { version = "0.3", default-features = false }
alloy-rpc-client = { version = "0.3", default-features = false }
alloy-consensus = { version = "0.4", default-features = false, features = ["k256"] }
alloy-network = { version = "0.4", default-features = false }
alloy-rpc-types-eth = { version = "0.4", default-features = false }
alloy-rpc-client = { version = "0.4", default-features = false }
alloy-simple-request-transport = { path = "./alloy-simple-request-transport", default-features = false }
alloy-provider = { version = "0.3", default-features = false }
alloy-provider = { version = "0.4", default-features = false }

alloy-node-bindings = { version = "0.3", default-features = false, optional = true }
alloy-node-bindings = { version = "0.4", default-features = false, optional = true }

[dev-dependencies]
frost = { package = "modular-frost", path = "../../crypto/frost", default-features = false, features = ["tests"] }

tokio = { version = "1", features = ["macros"] }

alloy-node-bindings = { version = "0.3", default-features = false }
alloy-node-bindings = { version = "0.4", default-features = false }

[features]
tests = ["alloy-node-bindings", "frost/tests"]
6 changes: 3 additions & 3 deletions networks/ethereum/alloy-simple-request-transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ rustdoc-args = ["--cfg", "docsrs"]
workspace = true

[dependencies]
tower = "0.4"
tower = "0.5"

serde_json = { version = "1", default-features = false }
simple-request = { path = "../../../common/request", default-features = false }

alloy-json-rpc = { version = "0.3", default-features = false }
alloy-transport = { version = "0.3", default-features = false }
alloy-json-rpc = { version = "0.4", default-features = false }
alloy-transport = { version = "0.4", default-features = false }

[features]
default = ["tls"]
Expand Down
2 changes: 1 addition & 1 deletion networks/ethereum/src/deployer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl Deployer {
nonce: 0,
gas_price: 100_000_000_000u128,
// TODO: Use a more accurate gas limit
gas_limit: 1_000_000u128,
gas_limit: 1_000_000,
to: TxKind::Create,
value: U256::ZERO,
input: bytecode,
Expand Down
2 changes: 1 addition & 1 deletion networks/ethereum/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl Router {
to: TxKind::Call(self.1),
input: abi::executeCall::new((outs.to_vec(), sig.into())).abi_encode().into(),
// TODO
gas_limit: 100_000 + ((200_000 + 10_000) * u128::try_from(outs.len()).unwrap()),
gas_limit: 100_000 + ((200_000 + 10_000) * u64::try_from(outs.len()).unwrap()),
..Default::default()
}
}
Expand Down
21 changes: 21 additions & 0 deletions patches/tiny-bip39/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "tiny-bip39"
version = "1.0.2"
description = "tiny-bip39 which patches to the latest update"
license = "MIT"
repository = "https://github.com/serai-dex/serai/tree/develop/patches/tiny-bip39"
authors = ["Luke Parker <[email protected]>"]
keywords = []
edition = "2021"
rust-version = "1.70"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lib]
name = "bip39"
path = "src/lib.rs"

[dependencies]
tiny-bip39 = "2"
1 change: 1 addition & 0 deletions patches/tiny-bip39/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub use bip39::*;
9 changes: 6 additions & 3 deletions processor/src/networks/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ impl<D: Db> Network for Ethereum<D> {
completion.signature(),
),
};
tx.gas_limit = 1_000_000u64.into();
tx.gas_limit = 1_000_000u64;
tx.gas_price = 1_000_000_000u64.into();
let tx = ethereum_serai::crypto::deterministically_sign(&tx);

Expand Down Expand Up @@ -905,7 +905,7 @@ impl<D: Db> Network for Ethereum<D> {
chain_id: None,
nonce: 0,
gas_price: 1_000_000_000u128,
gas_limit: 200_000u128,
gas_limit: 200_000,
to: ethereum_serai::alloy::primitives::TxKind::Call(send_to.0.into()),
// 1 ETH
value,
Expand All @@ -924,7 +924,10 @@ impl<D: Db> Network for Ethereum<D> {
.unwrap();

let mut bytes = vec![];
tx.encode_with_signature_fields(&Signature::from(sig), &mut bytes);
tx.encode_with_signature_fields(
&Signature::from(sig).with_chain_id(self.provider.get_chain_id().await.unwrap()),
&mut bytes,
);
let pending_tx = self.provider.send_raw_transaction(&bytes).await.ok().unwrap();

// Mine an epoch containing this TX
Expand Down
2 changes: 1 addition & 1 deletion processor/src/tests/literal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ mod ethereum {
let deployer = Deployer::new(provider.clone()).await.unwrap().unwrap();

let mut tx = deployer.deploy_router(&key);
tx.gas_limit = 1_000_000u64.into();
tx.gas_limit = 1_000_000u64;
tx.gas_price = 1_000_000_000u64.into();
let tx = ethereum_serai::crypto::deterministically_sign(&tx);

Expand Down
2 changes: 1 addition & 1 deletion tests/processor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl Coordinator {
provider
.raw_request::<_, ()>(
"anvil_setBalance".into(),
[signer.to_string(), (tx.gas_limit * tx.gas_price).to_string()],
[signer.to_string(), (u128::from(tx.gas_limit) * tx.gas_price).to_string()],
)
.await
.unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/processor/src/networks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,13 @@ impl Wallet {
provider
.raw_request::<_, ()>(
"anvil_setBalance".into(),
[signer.to_string(), (tx.gas_limit * tx.gas_price).to_string()],
[signer.to_string(), (u128::from(tx.gas_limit) * tx.gas_price).to_string()],
)
.await
.unwrap();

let mut bytes = vec![];
tx.encode_with_signature_fields(&Signature::from(sig), &mut bytes);
tx.encode_with_signature_fields(&sig, &mut bytes);
let _ = provider.send_raw_transaction(&bytes).await.unwrap();

provider.raw_request::<_, ()>("anvil_mine".into(), [96]).await.unwrap();
Expand All @@ -364,7 +364,7 @@ impl Wallet {
chain_id: None,
nonce: *nonce,
gas_price: 1_000_000_000u128,
gas_limit: 200_000u128,
gas_limit: 200_000,
to: TxKind::Call(router_addr.into()),
// 1 ETH
value: one_eth,
Expand Down

0 comments on commit 599b2de

Please sign in to comment.