Fix docker and deps (#3978)

## Proposed Changes

- Fix this cargo-audit failure for `sqlite3-sys`: https://github.com/sigp/lighthouse/actions/runs/4179008889/jobs/7238473962
- Prevent the Docker builds from running out of RAM on CI by removing `gnosis` and LMDB support from the `-dev` images (see: https://github.com/sigp/lighthouse/pull/3959#issuecomment-1430531155, successful run on my fork: https://github.com/michaelsproul/lighthouse/actions/runs/4179162480/jobs/7239537947).
This commit is contained in:
Michael Sproul 2023-02-15 11:51:46 +00:00
parent 8dd9249177
commit 2fcfdf1a01
5 changed files with 40 additions and 54 deletions

View File

@ -53,7 +53,7 @@ jobs:
x86_64-portable]
features: [
{version_suffix: "", env: "gnosis,slasher-lmdb,slasher-mdbx,jemalloc"},
{version_suffix: "-dev", env: "gnosis,slasher-lmdb,slasher-mdbx,jemalloc,spec-minimal"}
{version_suffix: "-dev", env: "jemalloc,spec-minimal"}
]
include:
- profile: maxperf
@ -65,8 +65,6 @@ jobs:
VERSION: ${{ needs.extract-version.outputs.VERSION }}
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
FEATURE_SUFFIX: ${{ matrix.features.version_suffix }}
FEATURES: ${{ matrix.features.env }}
CROSS_FEATURES: ${{ matrix.features.env }}
steps:
- uses: actions/checkout@v3
- name: Update Rust
@ -106,7 +104,6 @@ jobs:
--platform=linux/${SHORT_ARCH} \
--file ./Dockerfile.cross . \
--tag ${IMAGE_NAME}:${VERSION}-${SHORT_ARCH}${VERSION_SUFFIX}${MODERNITY_SUFFIX}${FEATURE_SUFFIX} \
--build-arg FEATURES=${FEATURES} \
--provenance=false \
--push
build-docker-multiarch:

79
Cargo.lock generated
View File

@ -464,7 +464,7 @@ dependencies = [
"http",
"http-body",
"hyper",
"itoa 1.0.5",
"itoa",
"matchit",
"memchr",
"mime",
@ -816,18 +816,6 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
[[package]]
name = "bstr"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
dependencies = [
"lazy_static",
"memchr",
"regex-automata",
"serde",
]
[[package]]
name = "buf_redux"
version = "0.8.4"
@ -1356,13 +1344,12 @@ dependencies = [
[[package]]
name = "csv"
version = "1.1.6"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1"
checksum = "af91f40b7355f82b0a891f50e70399475945bb0b0da4f1700ce60761c9d3e359"
dependencies = [
"bstr",
"csv-core",
"itoa 0.4.8",
"itoa",
"ryu",
"serde",
]
@ -1827,7 +1814,7 @@ dependencies = [
"enr",
"fnv",
"futures",
"hashlink",
"hashlink 0.7.0",
"hex",
"hkdf",
"lazy_static",
@ -2558,9 +2545,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
[[package]]
name = "fastrand"
version = "1.8.0"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499"
checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
dependencies = [
"instant",
]
@ -3043,6 +3030,15 @@ dependencies = [
"hashbrown 0.11.2",
]
[[package]]
name = "hashlink"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa"
dependencies = [
"hashbrown 0.12.3",
]
[[package]]
name = "headers"
version = "0.3.8"
@ -3182,7 +3178,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
dependencies = [
"bytes",
"fnv",
"itoa 1.0.5",
"itoa",
]
[[package]]
@ -3299,7 +3295,7 @@ dependencies = [
"http-body",
"httparse",
"httpdate",
"itoa 1.0.5",
"itoa",
"pin-project-lite 0.2.9",
"socket2",
"tokio",
@ -3590,12 +3586,6 @@ dependencies = [
"either",
]
[[package]]
name = "itoa"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
name = "itoa"
version = "1.0.5"
@ -4302,9 +4292,9 @@ dependencies = [
[[package]]
name = "libsqlite3-sys"
version = "0.22.2"
version = "0.25.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290b64917f8b0cb885d9de0f9959fe1f775d7fa12f1da2db9001c1c8ab60f89d"
checksum = "29f835d03d717946d28b1d1ed632eb6f0e24a299388ee623d0c23118d3e8a7fa"
dependencies = [
"cc",
"pkg-config",
@ -4731,14 +4721,14 @@ dependencies = [
[[package]]
name = "mio"
version = "0.8.5"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de"
checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
dependencies = [
"libc",
"log",
"wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys 0.42.0",
"windows-sys 0.45.0",
]
[[package]]
@ -5223,9 +5213,9 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.17.0"
version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "oneshot_broadcast"
@ -5845,7 +5835,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c"
dependencies = [
"dtoa",
"itoa 1.0.5",
"itoa",
"parking_lot 0.12.1",
"prometheus-client-derive-text-encode",
]
@ -6047,9 +6037,9 @@ dependencies = [
[[package]]
name = "r2d2_sqlite"
version = "0.18.0"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d24607049214c5e42d3df53ac1d8a23c34cc6a5eefe3122acb2c72174719959"
checksum = "b4f5d0337e99cd5cacd91ffc326c6cc9d8078def459df560c4f9bf9ba4a51034"
dependencies = [
"r2d2",
"rusqlite",
@ -6408,16 +6398,15 @@ dependencies = [
[[package]]
name = "rusqlite"
version = "0.25.4"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c4b1eaf239b47034fb450ee9cdedd7d0226571689d8823030c4b6c2cb407152"
checksum = "01e213bc3ecb39ac32e81e51ebe31fd888a940515173e3a18a35f8c6e896422a"
dependencies = [
"bitflags",
"fallible-iterator",
"fallible-streaming-iterator",
"hashlink",
"hashlink 0.8.1",
"libsqlite3-sys",
"memchr",
"smallvec",
]
@ -6818,7 +6807,7 @@ version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76"
dependencies = [
"itoa 1.0.5",
"itoa",
"ryu",
"serde",
]
@ -6841,7 +6830,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
"form_urlencoded",
"itoa 1.0.5",
"itoa",
"ryu",
"serde",
]
@ -7700,7 +7689,7 @@ version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376"
dependencies = [
"itoa 1.0.5",
"itoa",
"libc",
"num_threads",
"serde",

View File

@ -37,7 +37,7 @@ cached_tree_hash = { path = "../cached_tree_hash" }
serde_yaml = "0.8.13"
tempfile = "3.1.0"
derivative = "2.1.1"
rusqlite = { version = "0.25.3", features = ["bundled"], optional = true }
rusqlite = { version = "0.28.0", features = ["bundled"], optional = true }
arbitrary = { version = "1.0", features = ["derive"], optional = true }
eth2_serde_utils = "0.1.1"
regex = "1.5.5"

View File

@ -12,9 +12,9 @@ path = "tests/main.rs"
[dependencies]
tempfile = "3.1.0"
types = { path = "../../consensus/types" }
rusqlite = { version = "0.25.3", features = ["bundled"] }
rusqlite = { version = "0.28.0", features = ["bundled"] }
r2d2 = "0.8.9"
r2d2_sqlite = "0.18.0"
r2d2_sqlite = "0.21.0"
serde = "1.0.116"
serde_derive = "1.0.116"
serde_json = "1.0.58"

View File

@ -162,8 +162,8 @@ impl SlashingDatabase {
/// The exclusive locking mode also has the benefit of applying to other processes, so multiple
/// Lighthouse processes trying to access the same database will also be blocked.
fn apply_pragmas(conn: &mut rusqlite::Connection) -> Result<(), rusqlite::Error> {
conn.pragma_update(None, "foreign_keys", &true)?;
conn.pragma_update(None, "locking_mode", &"EXCLUSIVE")?;
conn.pragma_update(None, "foreign_keys", true)?;
conn.pragma_update(None, "locking_mode", "EXCLUSIVE")?;
Ok(())
}