Skip to content

Commit

Permalink
Merge branch 'main' into remove-unknown-fields-solvers-dto
Browse files Browse the repository at this point in the history
  • Loading branch information
m-lord-renkse authored Apr 23, 2024
2 parents 9e94ece + b482f79 commit 12bae24
Show file tree
Hide file tree
Showing 20 changed files with 834 additions and 670 deletions.
1,290 changes: 723 additions & 567 deletions Cargo.lock

Large diffs are not rendered by default.

69 changes: 38 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,53 @@ resolver = "2"
members = ["crates/*"]

[workspace.dependencies]
anyhow = "1"
async-trait = "0.1"
anyhow = "1.0.82"
async-trait = "0.1.80"
axum = "0.6"
bigdecimal = "0.3"
cached = { version = "0.44", default-features = false }
chrono = { version = "0.4", default-features = false }
clap = { version = "4", features = ["derive", "env"] }
derivative = "2"
cached = { version = "0.49.3", default-features = false }
chrono = { version = "0.4.38", default-features = false }
clap = { version = "4.5.4", features = ["derive", "env"] }
derivative = "2.2.0"
ethcontract = { version = "0.25.6", default-features = false, features = ["aws-kms"] }
ethcontract-generate = { version = "0.25.6", default-features = false }
ethcontract-mock = { version = "0.25.6", default-features = false }
ethereum-types = "0.14"
futures = "0.3"
ethereum-types = "0.14.1"
flate2 = "1.0.28"
futures = "0.3.30"
gas-estimation = { git = "https://github.com/cowprotocol/gas-estimation", tag = "v0.7.3", features = ["web3_", "tokio_"] }
hex = { version = "0.4", default-features = false }
hex-literal = "0.4"
hex = { version = "0.4.3", default-features = false }
hex-literal = "0.4.1"
humantime = "2.1.0"
humantime-serde = "1.1.1"
hyper = "0.14.28"
indexmap = "2.2.5"
itertools = "0.11"
lazy_static = "1"
maplit = "1"
mockall = "0.11"
num = "0.4"
once_cell = "1"
itertools = "0.12.1"
lazy_static = "1.4.0"
maplit = "1.0.2"
mockall = "0.12.1"
num = "0.4.2"
once_cell = "1.19.0"
primitive-types = "0.12"
prometheus = "0.13"
prometheus = "0.13.3"
prometheus-metric-storage = "0.5.0"
rand = "0.8"
regex = "1"
reqwest = "0.11"
secp256k1 = "0.27"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_with = "3"
rand = "0.8.5"
regex = "1.10.4"
reqwest = "0.11.27"
secp256k1 = "0.27.0"
serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.116"
serde_with = "3.7.0"
sqlx = { version = "0.7", default-features = false, features = ["runtime-tokio", "tls-native-tls", "bigdecimal", "chrono", "postgres", "macros"] }
strum = { version = "0.25", features = ["derive"] }
thiserror = "1"
tokio = "1"
tracing = "0.1"
tracing-subscriber = "0.3"
url = "2"
strum = { version = "0.26.2", features = ["derive"] }
tempfile = "3.10.1"
time = { version = "0.3.25", features = ["macros"] }
thiserror = "1.0.58"
toml = "0.8.12"
tokio = "1.37.0"
tokio-stream = { version = "0.1.15", features = ["sync"] }
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
url = "2.5.0"
warp = { git = 'https://github.com/cowprotocol/warp.git', rev = "87a91e2", default-features = false }
web3 = { version = "0.19", default-features = false }
web3 = { version = "0.19.0", default-features = false }
2 changes: 1 addition & 1 deletion crates/app-data-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ license = "MIT OR Apache-2.0"

[dependencies]
hex-literal = { workspace = true }
tiny-keccak = { version = "2.0", features = ["keccak"] }
tiny-keccak = { version = "2.0.2", features = ["keccak"] }
2 changes: 1 addition & 1 deletion crates/database/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
[dependencies]
bigdecimal = { workspace = true }
chrono = { workspace = true, features = ["clock"] }
const_format = "0.2"
const_format = "0.2.32"
futures = { workspace = true }
hex = { workspace = true }
sqlx = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/database/src/orders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ mod tests {
assert_eq!(time, order.cancellation_timestamp.unwrap());

// Cancel again and verify that cancellation timestamp was not changed.
let irrelevant_time = Utc.timestamp_opt(1234567890, 1_000_000_000).unwrap();
let irrelevant_time = Utc.timestamp_opt(1234564319, 1_000_000_000).unwrap();
assert_ne!(irrelevant_time, time);
cancel_order(&mut db, &order.uid, time).await.unwrap();
let order = read_order(&mut db, &order.uid).await.unwrap().unwrap();
Expand Down
46 changes: 23 additions & 23 deletions crates/driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,39 @@ path = "src/main.rs"

[dependencies]
app-data = { path = "../app-data" }
async-trait = "0.1"
axum = "0.6"
bigdecimal = "0.3"
chrono = { version = "0.4", features = ["clock"], default-features = false }
async-trait = { workspace = true }
axum = { workspace = true }
bigdecimal = { workspace = true }
chrono = { workspace = true, features = ["clock"], default-features = false }
derivative = { workspace = true }
ethabi = "18.0"
ethereum-types = "0.14"
ethereum-types = { workspace = true }
ethrpc = { path = "../ethrpc" }
futures = "0.3"
hex = "0.4"
hex-literal = "0.4"
futures = { workspace = true }
hex = { workspace = true }
hex-literal = { workspace = true }
humantime = { workspace = true }
humantime-serde = { workspace = true }
hyper = "0.14"
hyper = { workspace = true }
lazy_static = { workspace = true }
indexmap = { version = "2", features = ["serde"] }
itertools = "0.11"
num = "0.4"
indexmap = { workspace = true, features = ["serde"] }
itertools = { workspace = true }
num = { workspace = true }
number = { path = "../number" }
prometheus = "0.13"
prometheus = { workspace = true }
prometheus-metric-storage = { workspace = true }
rand = "0.8"
reqwest = "0.11"
serde = "1.0"
serde_json = "1.0"
serde_with = "3.0"
rand = { workspace = true }
reqwest = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_with = { workspace = true }
tap = "1.0.1"
thiserror = "1.0"
tokio = { version = "1.22", features = ["macros", "rt-multi-thread", "signal", "time"] }
toml = "0.7"
thiserror = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "signal", "time"] }
toml = { workspace = true }
tower = "0.4"
tower-http = { version = "0.4", features = ["limit", "trace"] }
url = { version = "2.3", features = ["serde"] }
url = { workspace = true, features = ["serde"] }
web3 = { workspace = true, features = ["http"] }

# These still use { workspace = true } because they're used at
Expand All @@ -75,4 +75,4 @@ maplit = { workspace = true }
mockall = { workspace = true }
solvers-dto = { path = "../solvers-dto" }
tokio = { workspace = true, features = ["test-util", "process"] }
tempfile = "3.4"
tempfile = { workspace = true }
2 changes: 1 addition & 1 deletion crates/e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ shared = { path = "../shared" }
solver = { path = "../solver" }
solvers = { path = "../solvers" }
sqlx = { workspace = true }
tempfile = "3.3.0"
tempfile = { workspace = true }
tokio = { workspace = true, features = ["macros", "process"] }
tracing = { workspace = true }
warp = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/e2e/src/api/zeroex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl Eip712TypedZeroExOrder {
},
order: Order {
chain_id,
expiry: NaiveDateTime::MAX.timestamp() as u64,
expiry: NaiveDateTime::MAX.and_utc().timestamp() as u64,
fee_recipient: self.fee_recipient,
maker: self.maker,
maker_token: self.maker_token,
Expand Down
8 changes: 4 additions & 4 deletions crates/e2e/tests/e2e/liquidity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ async fn zero_ex_liquidity(web3: Web3) {
sender: Default::default(),
fee_recipient: zeroex.address(),
pool: H256::default(),
expiry: NaiveDateTime::MAX.timestamp() as u64,
expiry: NaiveDateTime::MAX.and_utc().timestamp() as u64,
salt: U256::from(Utc::now().timestamp()),
}
.to_order_record(chain_id, zeroex.address(), zeroex_maker);
Expand Down Expand Up @@ -263,7 +263,7 @@ fn create_zeroex_liquidity_orders(
sender: Default::default(),
fee_recipient: zeroex_addr,
pool: H256::default(),
expiry: NaiveDateTime::MAX.timestamp() as u64,
expiry: NaiveDateTime::MAX.and_utc().timestamp() as u64,
salt: U256::from(Utc::now().timestamp()),
};
let usdt_weth_order = Eip712TypedZeroExOrder {
Expand All @@ -280,7 +280,7 @@ fn create_zeroex_liquidity_orders(
sender: Default::default(),
fee_recipient: zeroex_addr,
pool: H256::default(),
expiry: NaiveDateTime::MAX.timestamp() as u64,
expiry: NaiveDateTime::MAX.and_utc().timestamp() as u64,
salt: U256::from(Utc::now().timestamp()),
};
let usdc_weth_order = Eip712TypedZeroExOrder {
Expand All @@ -297,7 +297,7 @@ fn create_zeroex_liquidity_orders(
sender: Default::default(),
fee_recipient: zeroex_addr,
pool: H256::default(),
expiry: NaiveDateTime::MAX.timestamp() as u64,
expiry: NaiveDateTime::MAX.and_utc().timestamp() as u64,
salt: U256::from(Utc::now().timestamp()),
};
[typed_order, usdt_weth_order, usdc_weth_order]
Expand Down
6 changes: 3 additions & 3 deletions crates/ethrpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ doctest = false

[dependencies]
anyhow = { workspace = true }
async-trait = { workspace= true }
async-trait = { workspace = true }
ethereum-types = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
Expand All @@ -24,11 +24,11 @@ primitive-types = { workspace = true }
prometheus = { workspace = true }
prometheus-metric-storage = { workspace = true }
reqwest = { workspace = true, features = ["cookies"] }
scopeguard = "1"
scopeguard = "1.2.0"
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true, features = [] }
tokio-stream = { version = "0.1", features = ["sync"] }
tokio-stream = { workspace = true }
web3 = { workspace = true }
contracts = { path = "../contracts" }
ethcontract = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/model/src/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use {
fmt::{self, Debug, Display},
str::FromStr,
},
strum::{AsRefStr, EnumString, EnumVariantNames},
strum::{AsRefStr, EnumString, VariantNames},
web3::signing::{self, Key, SecretKeyRef},
};

Expand Down Expand Up @@ -875,7 +875,7 @@ pub enum OrderKind {
Hash,
EnumString,
AsRefStr,
EnumVariantNames,
VariantNames,
)]
#[strum(ascii_case_insensitive)]
#[serde(tag = "class", rename_all = "lowercase")]
Expand Down
4 changes: 2 additions & 2 deletions crates/observe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ license = "MIT OR Apache-2.0"
atty = "0.2.14"
futures = { workspace = true }
once_cell = { workspace = true }
pin-project-lite = "0.2"
pin-project-lite = "0.2.14"
prometheus = { workspace = true }
prometheus-metric-storage = { workspace = true }
time = { version = "0.3", features = ["macros"] }
time = { workspace = true }
tokio = { workspace = true, features = [] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter", "fmt", "time"] }
3 changes: 2 additions & 1 deletion crates/orderbook/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ name = "orderbook"
path = "src/main.rs"

[dependencies]
axum = { workspace = true }
anyhow = { workspace = true }
app-data = { path = "../app-data" }
app-data-hash = { path = "../app-data-hash" }
Expand All @@ -32,7 +33,7 @@ gas-estimation = { workspace = true }
hex = { workspace = true }
hex-literal = { workspace = true }
humantime = { workspace = true }
hyper = "0.14"
hyper = { workspace = true }
maplit = { workspace = true }
model = { path = "../model" }
multibase = "0.9"
Expand Down
6 changes: 3 additions & 3 deletions crates/s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0"

[dependencies]
anyhow = { workspace = true }
aws-config = { version ="0.56" }
aws-sdk-s3 = { version = "0.29", default-features = false, features = ["rustls", "rt-tokio"] }
flate2 = "1.0"
aws-config = { version = "1.2.0", features = ["behavior-version-latest"] }
aws-sdk-s3 = { version = "1.23.0", default-features = false, features = ["rustls", "rt-tokio"] }
flate2 = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion crates/s3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Uploader {
let uploader = Self {
bucket: config.bucket,
filename_prefix: config.filename_prefix,
client: Client::new(&aws_config::load_from_env().await),
client: Client::new(&aws_config::from_env().load().await),
};
uploader.assert_credentials_are_usable().await;
uploader
Expand Down
12 changes: 6 additions & 6 deletions crates/shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ database = { path = "../database" }
delay_map = "0.3"
derivative = { workspace = true }
ethcontract = { workspace = true }
ethrpc = { path = "../ethrpc"}
flate2 = "1"
ethrpc = { path = "../ethrpc" }
flate2 = { workspace = true }
futures = { workspace = true }
gas-estimation = { workspace = true }
observe = { path = "../observe" }
Expand All @@ -51,18 +51,18 @@ serde_json = { workspace = true }
serde_with = { workspace = true }
strum = { workspace = true }
thiserror = { workspace = true }
time = { version = "0.3", features = ["macros"] }
time = { workspace = true }
tokio = { workspace = true, features = ["macros", "time"] }
tokio-stream = { version = "0.1", features = ["sync"] }
tokio-stream = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter", "fmt", "time"] }
url = { workspace = true }
warp = { workspace = true }
web3 = { workspace = true }

[dev-dependencies]
async-stream = "0.3"
tempfile = "3.4"
async-stream = "0.3.5"
tempfile = { workspace = true }
ethcontract-mock = { workspace = true }
regex = { workspace = true }
testlib = { path = "../testlib" }
Expand Down
4 changes: 2 additions & 2 deletions crates/shared/src/zeroex_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ pub struct Order {
pub chain_id: u64,
/// Timestamp in seconds of when the order expires. Expired orders cannot be
/// filled.
#[derivative(Default(value = "NaiveDateTime::MAX.timestamp() as u64"))]
#[derivative(Default(value = "NaiveDateTime::MAX.and_utc().timestamp() as u64"))]
#[serde_as(as = "DisplayFromStr")]
pub expiry: u64,
/// The address of the entity that will receive any fees stipulated by the
Expand Down Expand Up @@ -764,7 +764,7 @@ mod tests {
"003427369d4c2a6b0aceeb7b315bb9a6086bc6fc4c887aa51efc73b662c9d127"
).unwrap(),
remaining_fillable_taker_amount: 262467000000000000u128,
created_at: DateTime::from_utc(NaiveDate::from_ymd_opt(2022, 2, 26).unwrap().and_hms_nano_opt(6, 59, 0, 440_000_000).unwrap(), Utc),
created_at: DateTime::from_naive_utc_and_offset(NaiveDate::from_ymd_opt(2022, 2, 26).unwrap().and_hms_nano_opt(6, 59, 0, 440_000_000).unwrap(), Utc),
},
order: Order {
chain_id: 1u64,
Expand Down
2 changes: 1 addition & 1 deletion crates/solver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contracts = { path = "../contracts" }
derivative = { workspace = true }
ethcontract = { workspace = true }
ethrpc = { path = "../ethrpc" }
flate2 = "1.0"
flate2 = { workspace = true }
futures = { workspace = true }
gas-estimation = { workspace = true }
observe = { path = "../observe" }
Expand Down
4 changes: 2 additions & 2 deletions crates/solver/src/liquidity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ use {
},
},
std::{collections::BTreeMap, sync::Arc},
strum::{EnumVariantNames, IntoStaticStr},
strum::IntoStaticStr,
};

/// Defines the different types of liquidity our solvers support
#[derive(Clone, IntoStaticStr, EnumVariantNames, Debug)]
#[derive(Clone, IntoStaticStr, Debug)]
#[cfg_attr(test, derive(PartialEq))]
pub enum Liquidity {
ConstantProduct(ConstantProductOrder),
Expand Down
Loading

0 comments on commit 12bae24

Please sign in to comment.