Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed Feb 17, 2025
1 parent 0c1ce7e commit 45b5148
Show file tree
Hide file tree
Showing 611 changed files with 224 additions and 205 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ jobs:
with:
path: |
./contracts/out
./contract-bindings
./contracts/cache
./crates/contract-bindings
## TODO maybe add the rust version and solc version to the key
key: v2-contracts-abi-${{ hashFiles('./contracts/**/*.sol') }}

- name: Generate ABI and bindings
- name: Generate ABI and contract-bindings
run: cd contracts && make gen

- name: Install Rust nightly
Expand All @@ -66,6 +66,7 @@ jobs:
components: rustfmt,clippy

- name: Print Rust toolchain default versions
working-directory: crates
run: |
echo "rustup show:"
rustup show
Expand All @@ -77,14 +78,17 @@ jobs:
ldd --version
- name: Check fmt (nightly)
working-directory: crates
run: cargo +nightly-2024-07-05 fmt --check --all

- name: Check clippy
working-directory: crates
run: cargo clippy --release --tests --no-deps -- -D clippy::all

- name: Build all (including tests, benches, examples)
working-directory: crates/node
run: |
cd fendermint && make $PWD/builtin-actors/output/bundle.car
make $PWD/builtin-actors/output/bundle.car
cargo build --locked --release --all-targets
- name: Build Docker image for e2e tests
Expand All @@ -93,31 +97,31 @@ jobs:
cat <<EOF > /tmp/Dockerfile
# syntax=docker/dockerfile:1
FROM alpine as builder
COPY /fendermint/app/config /app/fendermint/app/config
COPY /target/release/fendermint /app/output/bin/fendermint
COPY /target/release/ipc-cli /app/output/bin/ipc-cli
COPY /crates/node/app/config /app/fendermint/app/config
COPY /crates/target/release/fendermint /app/output/bin/fendermint
COPY /crates/target/release/ipc-cli /app/output/bin/ipc-cli
EOF
## Append the runner build phase to the Dockerfile.
cat fendermint/docker/runner.Dockerfile >> /tmp/Dockerfile
cat crates/node/docker/runner.Dockerfile >> /tmp/Dockerfile
## Print the Dockerfile for debugging.
echo "Dockerfile:"
cat /tmp/Dockerfile
## Create the temporary .dockerignore file.
cat <<EOF > /tmp/Dockerfile.dockerignore
target
!target/release/fendermint
!target/release/ipc-cli
!crates/target/release/fendermint
!crates/target/release/ipc-cli
contracts/cache
contracts/node-modules
EOF
## Print the .dockerignore file for debugging.
echo "Dockerfile.dockerignore:"
cat /tmp/Dockerfile.dockerignore
## Build the Docker image.
DOCKER_BUILDKIT=1 docker build \
--load \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/contracts-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
with:
path: |
./contracts/out
./contract-bindings
./contracts/cache
./crates/contract-bindings
key: v2-contracts-abi-${{ hashFiles('./contracts/**/*.sol') }}

- name: Run tests
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
env:
CARGO_INCREMENTAL: "0"
SCCACHE_CACHE_SIZE: 10G
# TODO use RUSTC_WRAPPER=sccache and double check if the ones below are still required
CC: "sccache clang"
CXX: "sccache clang++"
PROFILE: "ci"
Expand All @@ -20,7 +21,7 @@ jobs:
matrix:
image:
- name: fendermint
path: fendermint
path: crates/node
needs_deps: true
- name: ipc-contracts
path: contracts
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ jobs:
with:
path: |
./contracts/out
./contract-bindings
./contracts/cache
./crates/contract-bindings
key: v2-contracts-abi-${{ hashFiles('./contracts/**/*.sol') }}

- uses: Swatinem/rust-cache@v2
with:
shared-key: build

- name: Run e2e tests
run: cd fendermint && PROFILE=release make e2e-only
working-directory: crates/node
run: PROFILE=release make e2e-only
2 changes: 1 addition & 1 deletion .github/workflows/tests-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
with:
path: |
./contracts/out
./contract-bindings
./contracts/cache
./crates/contract-bindings
key: v2-contracts-abi-${{ hashFiles('./contracts/**/*.sol') }}

- uses: Swatinem/rust-cache@v2
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

default:
cd contracts && make gen
cargo build --release
./target/release/ipc-cli --version
./target/release/fendermint --version
cd crates && (cargo build --release && ./target/release/ipc-cli --version && ./target/release/fendermint --version)

SUBTREES_RUST := fendermint ipc ipld/resolver
SUBTREES_RUST := $(patsubst %, crates/%, $(ls -1 crates))
SUBTREES_CONTRACTS := contracts
SUBTREES_ALL := $(SUBTREES_RUST) $(SUBTREES_CONTRACTS)

Expand Down
2 changes: 1 addition & 1 deletion contracts/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
out/* linguist-generated=true
binding/* linguist-generated=true
contract-bindings/* linguist-generated=true
5 changes: 2 additions & 3 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ crytic-export/
.env
broadcast/
out/
binding/src

node_modules

Expand All @@ -22,7 +21,7 @@ deployments.json
scripts/*.out
scripts/deploy-registry.ts
scripts/deploy-gateway.ts
binding/target
contract-bindings/target
subnet.registry.json
subnet.actor.json

Expand All @@ -38,4 +37,4 @@ report.json
*.un~

## Licenses are picked up from the root when packing the npm package.
LICENSE-*
LICENSE-*
4 changes: 2 additions & 2 deletions contracts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ compile-abi: node_modules | forge
./ops/compile-abi.sh $(OUTPUT)

rust-binding:
OUTPUT=$(OUTPUT) cargo build --locked --release --manifest-path ../contract-bindings/Cargo.toml -p ipc_actors_abis
OUTPUT=$(OUTPUT) cargo build --locked --release --manifest-path ../crates/contract-bindings/Cargo.toml -p ipc_actors_abis

# ==============================================================================
# Running security checks within the local computer
Expand Down Expand Up @@ -149,4 +149,4 @@ forge:
exit 1; \
fi

# ==============================================================================
# ==============================================================================
2 changes: 1 addition & 1 deletion contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Also:

1. Use `make storage` to check that the storage layout has not been corrupted.
2. Use `make coverage` to get the test coverage report.
3. Use `make rust-binding` to generate bindings in Rust.
3. Use `make rust-binding` to generate contract-bindings in Rust.

# Vulnerability Management

Expand Down
File renamed without changes.
58 changes: 29 additions & 29 deletions Cargo.toml → crates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ members = [
"contract-bindings",

# merkle
"ext/merkle-tree-rs",
"ext/libp2p-bitswap",
"ext/frc42_dispatch",
"patched_external/merkle-tree-rs",
"patched_external/libp2p-bitswap",
"patched_external/frc42_dispatch",

# ipc
"ipc/cli",
Expand All @@ -21,26 +21,26 @@ members = [
"ipld/resolver",

# fendermint
"fendermint/abci",
"fendermint/app",
"fendermint/app/options",
"fendermint/crypto",
"fendermint/app/settings",
"fendermint/eth/*",
"fendermint/rocksdb",
"fendermint/rpc",
"fendermint/storage",
"fendermint/testing",
"fendermint/testing/materializer",
"fendermint/testing/*-test",
"fendermint/tracing",
"fendermint/vm/*",
"fendermint/actors",
"fendermint/actors/api",
"fendermint/actors/chainmetadata",
"fendermint/actors/activity-tracker",
"fendermint/actors/eam",
"fendermint/actors/gas_market/eip1559",
"node/abci",
"node/app",
"node/app/options",
"node/crypto",
"node/app/settings",
"node/eth/*",
"node/rocksdb",
"node/rpc",
"node/storage",
"node/testing",
"node/testing/materializer",
"node/testing/*-test",
"node/tracing",
"node/vm/*",
"node/actors",
"node/actors/api",
"node/actors/chainmetadata",
"node/actors/activity-tracker",
"node/actors/eam",
"node/actors/gas_market/eip1559",
]

[workspace.package]
Expand Down Expand Up @@ -116,7 +116,7 @@ libp2p = { version = "0.53", default-features = false, features = [
"plaintext",
] }
libp2p-mplex = { version = "0.41" }
libp2p-bitswap = { path = "ext/libp2p-bitswap" }
libp2p-bitswap = { path = "patched_external/libp2p-bitswap" }
libsecp256k1 = "0.7"
literally = "0.1.3"
log = "0.4"
Expand Down Expand Up @@ -185,15 +185,15 @@ ipc_ipld_resolver = { path = "ipld/resolver" }
ipc-types = { path = "ipc/types" }
ipc-observability = { path = "ipc/observability" }
ipc_actors_abis = { path = "contract-bindings" }
fendermint_actors_api = { path = "fendermint/actors/api" }
fendermint_actors_api = { path = "crates/node/actors/api" }

# Vendored for cross-compilation, see https://github.com/cross-rs/cross/wiki/Recipes#openssl
# Make sure every top level build target actually imports this dependency, and don't end up
# depending on the same _without_ the "vendored" feature, because then the Docker build for
# for ARM64 on AMD64 will fail, it won't find the OpenSSL installation.
openssl = { version = "0.10", features = ["vendored"] }

# NOTE: When upgrading the FVM it may cause our fendermint/actors/build.rs to fail as it can
# NOTE: When upgrading the FVM it may cause our node/actors/build.rs to fail as it can
# pull in crates as transitive dependencies that do not support Wasm architector. If this
# happens, try removing "crypto" feature from fvm_shared dependency in contract-bindings/Cargo.toml
# and run `cargo build`. Then add the "crypto" feature back and run `cargo build` again.
Expand Down Expand Up @@ -226,15 +226,15 @@ fil_actors_evm_shared = { git = "https://github.com/filecoin-project/builtin-act
fil_actor_eam = { git = "https://github.com/filecoin-project/builtin-actors", tag = "v15.0.0" }
fil_actors_runtime = { git = "https://github.com/filecoin-project/builtin-actors", tag = "v15.0.0" }

fendermint_actor_eam = { path = "./fendermint/actors/eam" }
fendermint_actor_activity_tracker = { path = "./fendermint/actors/activity-tracker" }
fendermint_actor_eam = { path = "./node/actors/eam" }
fendermint_actor_activity_tracker = { path = "./node/actors/activity-tracker" }

cid = { version = "0.10.1", default-features = false, features = [
"serde-codec",
"std",
] }

frc42_dispatch = { path = "./ext/frc42_dispatch" }
frc42_dispatch = { path = "./patched_external/frc42_dispatch" }

# Using the same tendermint-rs dependency as tower-abci. From both we are interested in v037 modules.
tower-abci = { version = "0.7" }
Expand Down
5 changes: 5 additions & 0 deletions crates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# crates

Home of all rust crates, without exception.

The root shall contain a virtual manifest referencing all workspace crates.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::io::Write;
use std::path::PathBuf;

const SKIP_ENV_VAR_NAME: &str = "SKIP_BINDING_GENERATION";

/// Generate Rust contract-bindings from the IPC Solidity Actors ABI artifacts.
///p
/// These are built by `make ipc-actors-abi`, here we just add the final step
Expand Down Expand Up @@ -47,7 +46,13 @@ fn main() -> color_eyre::Result<()> {
println!("cargo:warn=Running binding generation...");

// Where are the Solidity artifacts.
let workspace_dir = crate_dir.parent().expect("Should exist").to_path_buf();
let workspace_dir = crate_dir
.clone()
.parent()
.expect("Parent dir should exist, since we are part of a workspace")
.parent()
.expect("Structure is such that we are two levels from the root")
.to_path_buf();

let contracts_dir = workspace_dir.join("contracts");

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ipc/api/Cargo.toml → crates/ipc/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ serde_with = { workspace = true, features = ["hex"] }

ipc_actors_abis = { workspace = true }
ipc-types = { workspace = true }
merkle-tree-rs = { path = "../../ext/merkle-tree-rs" }
merkle-tree-rs = { path = "../../patched_external/merkle-tree-rs" }

[dev-dependencies]
serde_json = { workspace = true }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ipc/provider/Cargo.toml → crates/ipc/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fil_actors_runtime = { workspace = true }
fvm_ipld_encoding = { workspace = true }
fvm_shared = { workspace = true, features = ["crypto"] }

merkle-tree-rs = { path = "../../ext/merkle-tree-rs" }
merkle-tree-rs = { path = "../../patched_external/merkle-tree-rs" }

ipc-types = { workspace = true }
ipc-wallet = { workspace = true, features = ["with-ethers"] }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 45b5148

Please sign in to comment.