Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
ff6a571
Add bootnodes implementation and tests
kamilsa Sep 30, 2025
e4918e6
Add nodeId support to Configuration and configurator
kamilsa Sep 30, 2025
af43bf1
Validator registry
kamilsa Sep 30, 2025
94f5718
Node key hex
kamilsa Oct 1, 2025
03b9b56
Fix ENR
kamilsa Oct 1, 2025
edbb087
Add genesis config path support and YAML reader
kamilsa Oct 1, 2025
47d2e8c
Refactor bootnodes YAML parsing to use dedicated readNodesYaml function
kamilsa Oct 1, 2025
ccacd83
Refactor ChainSpec and Configuration classes to remove unused spec fi…
kamilsa Oct 1, 2025
8fe087d
Default logging config
kamilsa Oct 1, 2025
db60ae1
Add genesis and validator configuration files
kamilsa Oct 1, 2025
1980d2a
Add support for listen multiaddress and update genesis time handling
kamilsa Oct 3, 2025
7a201af
Merge remote-tracking branch 'origin/master' into feature/configs-cli
turuslan Oct 3, 2025
724577a
fix ssz list decode
turuslan Oct 3, 2025
1a0fcd2
enr encode ip order
turuslan Oct 3, 2025
7a1f18c
replace assert with log
turuslan Oct 3, 2025
eb0be98
tryGetSignedBlock
turuslan Oct 3, 2025
e99ed93
generate-genesis
turuslan Oct 3, 2025
a82cb2d
fix generated code
turuslan Oct 3, 2025
143a2fe
genesis format
turuslan Oct 3, 2025
f6e08e7
remove sample peer from network module
turuslan Oct 3, 2025
4891362
reduce log
turuslan Oct 3, 2025
1583c1e
--data-dir
turuslan Oct 3, 2025
e158405
line buffering for piping logs
turuslan Oct 3, 2025
538001c
--node-key hex or path
turuslan Oct 3, 2025
edb349d
enr listen address from nodes.yaml
turuslan Oct 3, 2025
b78aac3
test ip order
turuslan Oct 4, 2025
3f121fc
add Docker support with multi-stage build
Oct 3, 2025
f9f175e
refactor path resolution for configuration settings to ensure absolut…
kamilsa Oct 4, 2025
0ab8230
update docker build features, docker verify
Oct 4, 2025
3f9670b
clean up Dockerfile by removing incompatible Python venv and build di…
kamilsa Oct 4, 2025
8fcf384
add Ping and Identify protocols to networking module
kamilsa Oct 5, 2025
9be8223
fix enr key order (quic)
turuslan Oct 5, 2025
a957aec
add gossip protocol configuration to networking module
kamilsa Oct 5, 2025
2006ab0
spec signature size
turuslan Oct 6, 2025
414db46
update libp2p
turuslan Oct 6, 2025
ab6aca3
don't ignore nodes.yaml
turuslan Oct 6, 2025
073147a
fix gossip message id
turuslan Oct 6, 2025
6f1a458
fix build
turuslan Oct 6, 2025
9dc09eb
clang-format
turuslan Oct 6, 2025
5c0361e
spec vote validator_id
turuslan Oct 6, 2025
64891fa
update leanp2p
turuslan Oct 6, 2025
cff1fa8
downgrade gossip for zeam
turuslan Oct 6, 2025
1686be7
outcome try
turuslan Oct 6, 2025
5649e85
add gossip protocol configuration to networking module
kamilsa Oct 6, 2025
eb796e8
refactor block hashing to use sszHash function in fork choice logic
kamilsa Oct 6, 2025
c2bcc19
improve error handling in fork choice logic for head block and attest…
kamilsa Oct 6, 2025
dd67521
add justification empty error handling in block storage
kamilsa Oct 6, 2025
1adcfa7
fix state justifications size
turuslan Oct 6, 2025
3ee1cb0
log parent block
turuslan Oct 6, 2025
e0c0fbd
clang-format
turuslan Oct 6, 2025
81ca147
import produced block
turuslan Oct 6, 2025
334b29c
revert block hash
turuslan Oct 6, 2025
8ddd88b
support multiple validator indices
turuslan Oct 8, 2025
44f5aa3
remove debug env
turuslan Oct 8, 2025
1e681bf
libp2p tag
turuslan Oct 8, 2025
42ea004
libp2p tag (shadow)
turuslan Oct 14, 2025
5d4807a
refactor ValidatorRegistry
turuslan Oct 15, 2025
d2e576b
unused genesis ssz json
turuslan Oct 15, 2025
4231724
move bootnodes impl to cpp
turuslan Oct 15, 2025
0a14df8
fmt path
turuslan Oct 15, 2025
57c70bc
arg 0
turuslan Oct 15, 2025
28ea404
forward
turuslan Oct 15, 2025
2f1ac6e
fmt join
turuslan Oct 15, 2025
dda3769
fmt slot hash
turuslan Oct 15, 2025
0458384
forward
turuslan Oct 15, 2025
57d1fc4
extract signature types
turuslan Oct 15, 2025
357734d
latest finalized metric
turuslan Oct 8, 2025
866accd
config multiaddr
turuslan Oct 15, 2025
aa2a0db
config node key
turuslan Oct 15, 2025
b1b1122
yaml name hint
turuslan Oct 15, 2025
4572f4d
remove generate-genesis
turuslan Oct 15, 2025
d169be6
refactor genesis state
turuslan Oct 15, 2025
73d4f1d
sign block and vote stub
turuslan Oct 16, 2025
b3d8ea6
rename
turuslan Oct 16, 2025
fa51173
const
turuslan Oct 16, 2025
1a64184
unused
turuslan Oct 16, 2025
0efe1e9
rename
turuslan Oct 16, 2025
b422c40
clang-format comment reflow
turuslan Oct 16, 2025
6d6823e
valueOrRaise
turuslan Oct 16, 2025
0400b15
error enum
turuslan Oct 16, 2025
0bd4b1e
hint
turuslan Oct 16, 2025
26ee2d2
error message
turuslan Oct 16, 2025
c28abc0
default logging yaml
turuslan Oct 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/.env
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GCC_VERSION=14
RUST_VERSION=stable
LINUX_PACKAGES="make \
autoconf \
automake \
build-essential \
cargo \
curl \
gcc-$GCC_VERSION \
g++-$GCC_VERSION \
Expand Down
6 changes: 6 additions & 0 deletions .ci/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ main() {
apt update && apt install -y $LINUX_PACKAGES
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION 90
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION 90
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 90
# Install Rust via rustup
if ! command -v rustup >/dev/null 2>&1; then
echo "=== Installing Rust ${RUST_VERSION} via rustup..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_VERSION} --profile minimal
fi
if [ -f "$HOME/.cargo/env" ]; then
source "$HOME/.cargo/env"
fi
Expand Down
16 changes: 16 additions & 0 deletions .ci/scripts/init_py.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@ set -euo pipefail

init_py() {
echo "$VENV"
# Verify python3 is available and check version
if ! command -v python3 >/dev/null 2>&1; then
echo "Error: python3 is not available"
exit 1
fi
echo "Using Python: $(python3 --version)"

# Create venv
python3 -m venv "$VENV"

# Verify venv was created successfully
if [ ! -f "$VENV/bin/python3" ]; then
echo "Error: venv created but python3 binary is missing"
echo "This might indicate that python3-venv package is not installed"
exit 1
fi

source $VENV/bin/activate
pip3 install cmake==${CMAKE_VERSION}
pip3 install --no-cache-dir asn1tools
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
RUSTUP_HOME: ~/.rustup
CACHE_PATH: |
~/.cargo
~/.rustup
~/.hunter
~/.cache/pip
~/.cache/vcpkg
Expand All @@ -45,12 +46,6 @@ jobs:
submodules: true
fetch-depth: 0

- name: "Set up Rust"
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy

- name: "Restore cache dependencies"
id: cache-restore
if: ${{ env.USE_CACHE == 'true' }}
Expand Down
99 changes: 99 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# ==================== Stage 1: Builder (init + configure + build) ====================
FROM ubuntu:24.04 AS builder

ARG DEBIAN_FRONTEND=noninteractive
ARG CMAKE_VERSION=3.31.1
ARG GCC_VERSION=14
ARG RUST_VERSION=stable

ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND}
ENV CMAKE_VERSION=${CMAKE_VERSION}
ENV GCC_VERSION=${GCC_VERSION}
ENV RUST_VERSION=${RUST_VERSION}
ENV VCPKG_FORCE_SYSTEM_BINARIES=1

ENV PROJECT=/qlean-mini
ENV VENV=${PROJECT}/.venv
ENV BUILD=${PROJECT}/.build
ENV PATH=${VENV}/bin:/root/.cargo/bin:${PATH}
ENV CARGO_HOME=/root/.cargo
ENV RUSTUP_HOME=/root/.rustup

WORKDIR ${PROJECT}

# Copy project files
COPY . ${PROJECT}

# Run all inits and build with vcpkg cache
RUN set -eux; \
chmod +x .ci/scripts/*.sh; \
# System dependencies and Rust via init.sh
./.ci/scripts/init.sh; \
# Clean up any existing venv that might have incompatible Python version
rm -rf ${VENV}; \
# Python venv and cmake via init_py
make init_py

# Configure and build with full vcpkg cache
RUN --mount=type=cache,target=/qlean-mini/.vcpkg,id=vcpkg-full \
set -eux; \
export PATH="${HOME}/.cargo/bin:${PATH}"; \
source ${HOME}/.cargo/env 2>/dev/null || true; \
# Init vcpkg inside cache mount if needed
if [ ! -f "/qlean-mini/.vcpkg/vcpkg" ]; then \
make init_vcpkg; \
fi; \
# Clean build directory to avoid CMake cache path mismatch
rm -rf ${BUILD}; \
make configure; \
make build; \
# Collect artifacts
mkdir -p /opt/artifacts/bin /opt/artifacts/modules /opt/artifacts/lib /opt/artifacts/vcpkg; \
# Copy executable
cp -v ${BUILD}/src/executable/qlean /opt/artifacts/bin/; \
# Copy all module .so files
find ${BUILD}/src/modules -type f -name "*_module.so" -exec cp -v {} /opt/artifacts/modules/ \; || true; \
# Copy all other project .so libraries (app, utils, etc)
find ${BUILD}/src -type f -name "*.so" ! -name "*_module.so" -exec cp -v {} /opt/artifacts/lib/ \; || true; \
# Copy vcpkg installed libraries
if [ -d "${BUILD}/vcpkg_installed" ]; then \
cp -R ${BUILD}/vcpkg_installed /opt/artifacts/vcpkg/installed; \
fi; \
# List collected artifacts
echo "=== Collected artifacts ==="; \
ls -lh /opt/artifacts/bin/; \
ls -lh /opt/artifacts/modules/ || true; \
ls -lh /opt/artifacts/lib/ || true

# ==================== Stage 2: Runtime ====================
FROM ubuntu:24.04 AS runtime

# Install minimal runtime dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libstdc++6 \
ca-certificates && \
rm -rf /var/lib/apt/lists/*

# Environment variables for runtime
ENV LD_LIBRARY_PATH=/opt/qlean/lib:/opt/qlean/vcpkg/installed/x64-linux/lib:/opt/qlean/vcpkg/installed/x64-linux-dynamic/lib:/opt/qlean/vcpkg/installed/lib:/usr/local/lib
ENV QLEAN_MODULES_DIR=/opt/qlean/modules

WORKDIR /work

# Copy artifacts from builder
COPY --from=builder /opt/artifacts/bin/qlean /usr/local/bin/qlean
COPY --from=builder /opt/artifacts/lib/ /opt/qlean/lib/
COPY --from=builder /opt/artifacts/modules/ /opt/qlean/modules/
COPY --from=builder /opt/artifacts/vcpkg/installed/ /opt/qlean/vcpkg/installed/

# Verify artifacts
RUN echo "=== Runtime image contents ===" && \
ls -lh /usr/local/bin/qlean && \
echo "=== Project libraries ===" && \
ls -lh /opt/qlean/lib/ || true && \
echo "=== Modules ===" && \
ls -lh /opt/qlean/modules/ || true

ENTRYPOINT ["qlean", "--modules-dir", "/opt/qlean/modules"]
CMD ["--help"]
43 changes: 43 additions & 0 deletions Dockerfile.runtime
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Use existing builder image
FROM qlean-mini:latest-builder AS builder

# ==================== Stage 2: Runtime ====================
FROM ubuntu:24.04 AS runtime

# Install minimal runtime dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libstdc++6 \
ca-certificates && \
rm -rf /var/lib/apt/lists/*

# Environment variables for runtime
ENV LD_LIBRARY_PATH=/opt/qlean/lib:/opt/qlean/vcpkg/installed/x64-linux/lib:/opt/qlean/vcpkg/installed/x64-linux-dynamic/lib:/opt/qlean/vcpkg/installed/lib:/usr/local/lib
ENV QLEAN_MODULES_DIR=/opt/qlean/modules

WORKDIR /work

# Copy binary
COPY --from=builder /qlean-mini/.build/src/executable/qlean /usr/local/bin/qlean
# Copy all project .so libraries
COPY --from=builder /qlean-mini/.build/src/app/*.so /opt/qlean/lib/
COPY --from=builder /qlean-mini/.build/src/utils/*.so /opt/qlean/lib/
# Copy modules
COPY --from=builder /qlean-mini/.build/src/modules/example/libexample_module.so /opt/qlean/modules/
COPY --from=builder /qlean-mini/.build/src/modules/networking/libnetworking_module.so /opt/qlean/modules/
COPY --from=builder /qlean-mini/.build/src/modules/production/libproduction_module.so /opt/qlean/modules/
COPY --from=builder /qlean-mini/.build/src/modules/synchronizer/libsynchronizer_module.so /opt/qlean/modules/
# Copy vcpkg libraries
COPY --from=builder /qlean-mini/.build/vcpkg_installed/ /opt/qlean/vcpkg/installed/

# Verify artifacts
RUN echo "=== Runtime image contents ===" && \
ls -lh /usr/local/bin/qlean && \
echo "=== Project libraries ===" && \
ls -lh /opt/qlean/lib/ || true && \
echo "=== Modules ===" && \
ls -lh /opt/qlean/modules/ || true

ENTRYPOINT ["qlean", "--modules-dir", "/opt/qlean/modules"]
CMD ["--help"]

Loading
Loading