Skip to content

Commit c4bb337

Browse files
sdsvarun-doshiaditiharini
authored
Switch to Malachite crate (#187)
Now that Malachite has been released as a crate, we no longer need to install it via Git. --------- Co-authored-by: varun-doshi <[email protected]> Co-authored-by: Aditi Srinivasan <[email protected]>
1 parent bdd71eb commit c4bb337

File tree

14 files changed

+491
-323
lines changed

14 files changed

+491
-323
lines changed

.github/workflows/verify.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
pull_request:
55
branches: [main]
66
workflow_call:
7-
secrets:
8-
MALACHITE_PRIVATE_REPO_SSH_KEY:
97

108
permissions:
119
contents: read
@@ -14,9 +12,6 @@ concurrency:
1412
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1513
cancel-in-progress: true
1614

17-
env:
18-
MALACHITE_GIT_REF: "8a9f3702eb41199bc8a7f45139adba233a04744a"
19-
2015
jobs:
2116
build:
2217
timeout-minutes: 20
@@ -25,11 +20,8 @@ jobs:
2520
- runner=64cpu-linux-arm64
2621
steps:
2722
- uses: actions/checkout@v4
28-
- uses: webfactory/[email protected]
29-
with:
30-
ssh-private-key: ${{ secrets.MALACHITE_PRIVATE_REPO_SSH_KEY }}
31-
- name: Build via Docker Compose, exposing SSH agent to build container
32-
run: docker compose build --ssh default
23+
- name: Build via Docker Compose
24+
run: docker compose build
3325

3426
test:
3527
timeout-minutes: 20
@@ -41,27 +33,15 @@ jobs:
4133
uses: arduino/setup-protoc@v3
4234

4335
- uses: actions/checkout@v4
44-
with:
45-
repository: farcasterxyz/malachite
46-
ref: ${{ env.MALACHITE_GIT_REF }}
47-
path: ./malachite
48-
ssh-key: ${{ secrets.MALACHITE_PRIVATE_REPO_SSH_KEY }}
49-
50-
- uses: actions/checkout@v4
51-
with:
52-
path: ./snapchain
5336

54-
- working-directory: ./snapchain
55-
env:
37+
- env:
5638
RUSTFLAGS: "-Dwarnings"
5739
run: cargo test
5840

59-
- working-directory: ./snapchain
60-
env:
41+
- env:
6142
RUSTFLAGS: "-Dwarnings"
6243
run: cargo build --bins
6344

64-
- working-directory: ./snapchain
65-
env:
45+
- env:
6646
RUSTFLAGS: "-Dwarnings"
6747
run: cargo fmt --all --check

Cargo.lock

Lines changed: 129 additions & 92 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ async-trait = "0.1.68"
2525
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "fmt", "json"] }
2626
hex = "0.4.3"
2727
ractor = "0.11.2"
28-
malachite-consensus = { path = "../malachite/code/crates/consensus" }
29-
malachite-common = { path = "../malachite/code/crates/common" }
30-
malachite-config = { path = "../malachite/code/crates/config" }
31-
malachite-node = { path = "../malachite/code/crates/node" }
32-
malachite-metrics = { path = "../malachite/code/crates/metrics" }
28+
informalsystems-malachitebft-core-consensus = { version = "0.0.1" }
29+
informalsystems-malachitebft-core-types = { version = "0.0.1"}
30+
informalsystems-malachitebft-config = { version = "0.0.1"}
31+
informalsystems-malachitebft-metrics = { version = "0.0.1" }
3332
blake3 = "1.4.1"
3433
tracing = "0.1.40"
3534
thiserror = "1.0.66"

Dockerfile

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,11 @@ FROM rust:1.83 AS builder
22

33
WORKDIR /usr/src/app
44

5-
# Build Malachite first
6-
ARG [email protected]:farcasterxyz/malachite.git
7-
ENV MALACHITE_GIT_REPO_URL=$MALACHITE_GIT_REPO_URL
8-
ARG MALACHITE_GIT_REF=8a9f3702eb41199bc8a7f45139adba233a04744a
9-
ENV RUST_BACKTRACE=1
10-
RUN --mount=type=ssh <<EOF
11-
set -eu
12-
apt-get update && apt-get install -y libclang-dev git libjemalloc-dev llvm-dev make protobuf-compiler libssl-dev openssh-client
13-
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
14-
cd ..
15-
git clone $MALACHITE_GIT_REPO_URL
16-
cd malachite
17-
git checkout $MALACHITE_GIT_REF
18-
cd code
19-
cargo build
20-
EOF
5+
RUN apt-get update && apt-get install -y libclang-dev libjemalloc-dev llvm-dev make protobuf-compiler
216

227
# Unfortunately, we can't prefetch creates without including the source code,
238
# since the Cargo configuration references files in src.
24-
# This means we'll re-fetch all creates every time the source code changes,
9+
# This means we'll re-fetch all crates every time the source code changes,
2510
# which isn't ideal.
2611
COPY Cargo.toml build.rs ./
2712
COPY src ./src

0 commit comments

Comments
 (0)