Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 43 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# beacon_chain
# Copyright (c) 2025 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.

version: 2
updates:
- package-ecosystem: gitsubmodule
directory: /
ignore:
# Libraries that track the latest tag have to be managed manually,
# as Dependabot otherwise suggests the latest unstable commit
# https://github.com/dependabot/dependabot-core/pull/13052
- dependency-name: vendor/nim-bearssl
- dependency-name: vendor/nim-chronicles
- dependency-name: vendor/nim-chronos
- dependency-name: vendor/nim-eth
- dependency-name: vendor/nim-faststreams
- dependency-name: vendor/nim-json-rpc
- dependency-name: vendor/nim-json-serialization
- dependency-name: vendor/nim-libbacktrace
- dependency-name: vendor/nim-libp2p
- dependency-name: vendor/nim-metrics
- dependency-name: vendor/nim-normalize
- dependency-name: vendor/nim-presto
- dependency-name: vendor/nim-results
- dependency-name: vendor/nim-serialization
- dependency-name: vendor/nim-stew
- dependency-name: vendor/nim-stint
- dependency-name: vendor/nim-taskpools
- dependency-name: vendor/nim-testutils
- dependency-name: vendor/nim-toml-serialization
- dependency-name: vendor/nim-unicodedb
- dependency-name: vendor/nim-unittest2
- dependency-name: vendor/nim-web3
- dependency-name: vendor/nim-websock
- dependency-name: vendor/nimcrypto
- dependency-name: vendor/NimYAML
schedule:
interval: daily
target-branch: unstable
76 changes: 41 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,33 @@ jobs:
builder: ['self-hosted','ubuntu-22.04']
- target:
os: macos
cpu: amd64
builder: macos-13
- target:
os: macos
cpu: arm64
builder: macos-latest
- target:
os: windows
builder: windows-2019
builder: windows-2022

defaults:
run:
shell: bash

name: ${{ matrix.target.os }}-${{ matrix.target.cpu }}${{ matrix.branch != '' && ' (Nim ' || '' }}${{ matrix.branch-short }}${{ matrix.branch != '' && ')' || '' }}
runs-on: ${{ matrix.builder }}

steps:
- name: Fix nim cache conflicts
run: |
echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV

- name: Clean workspace (very aggressive)
if: contains(matrix.builder, 'self-hosted')
run: rm -rf "$GITHUB_WORKSPACE"/*

- name: Checkout
uses: actions/checkout@v4

Expand All @@ -89,23 +104,6 @@ jobs:
7z x -y "external/mingw-${{ matrix.target.cpu }}.zip" -oexternal/mingw-${{ matrix.target.cpu }}/
mv external/mingw-${{ matrix.target.cpu }}/**/* ./external/mingw-${{ matrix.target.cpu }}

- name: Restore Nim DLLs dependencies (Windows) from cache
if: runner.os == 'Windows'
id: windows-dlls-cache
uses: actions/cache@v4
with:
path: external/dlls-${{ matrix.target.cpu }}
key: 'dlls-${{ matrix.target.cpu }}'

- name: Install DLLs dependencies (Windows)
if: >
steps.windows-dlls-cache.outputs.cache-hit != 'true' &&
runner.os == 'Windows'
run: |
mkdir -p external
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip
7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }}

- name: Path to cached dependencies (Windows)
if: >
runner.os == 'Windows'
Expand Down Expand Up @@ -219,32 +217,40 @@ jobs:
name: "Developer builds"
runs-on: ['self-hosted','ubuntu-22.04']
steps:
- name: Fix nim cache conflicts
run: |
echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV

- name: Clean workspace (very aggressive)
run: rm -rf "$GITHUB_WORKSPACE"/*

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Build with developer flags
run: |
make -j nimbus_beacon_node LOG_LEVEL=TRACE NIMFLAGS="-d:has_deposit_root_checks=1"

- name: Build files with isMainModule
run: |
executables=(
"beacon_chain/el/deposit_contract"
"beacon_chain/fork_choice/fork_choice"
"beacon_chain/fork_choice/proto_array"
"beacon_chain/networking/network_metadata_downloads"
"beacon_chain/era_db"
"beacon_chain/trusted_node_sync"
"benchmarks/rest_api_benchmark"
"tests/mocking/mock_genesis"
)
makefile_content=$(<./Makefile)
executables=()
while IFS= read -r file; do
base=$(basename "$file" ".nim")
if ! grep -qw "$base" <<< "$makefile_content"; then
executables+=("$file")
fi
done < <(grep -Rl --include="*.nim" --exclude-dir=vendor "when isMainModule:" .)
make -j update
source env.sh
for executable in "${executables[@]}"; do
nim c --passC:-fsyntax-only --noLinking:on -d:chronicles_log_level=TRACE "${executable}"
done

- name: Build with custom SECONDS_PER_SLOT
run: |
source env.sh
nim c --passC:-fsyntax-only --noLinking:on -d:chronicles_log_level=TRACE -d:SECONDS_PER_SLOT=1 beacon_chain/nimbus_beacon_node

lint:
name: "Lint"
runs-on: ubuntu-latest
Expand All @@ -259,7 +265,7 @@ jobs:
if: ${{ !cancelled() }} && github.event_name == 'pull_request'
run: |
excluded_files="config.yaml|config.nims|beacon_chain.nimble"
excluded_extensions="ans|bin|cfg|yml|json|json\\.template|md|png|service|ssz|tpl|txt|lock|nix|gitignore|envrc"
excluded_extensions="ans|bin|cfg|yml|json|json\\.template|md|png|service|ssz|tpl|txt|lock|nix|gitignore|envrc|sh"

current_year=$(date +"%Y")
problematic_files=()
Expand All @@ -282,13 +288,13 @@ jobs:
run: |
problematic_files=()
while read -r file; do
if ! grep -qE '^{\.push raises: \[\]\.}$' "$file"; then
if ! grep -qE '^{\.push raises: \[\](, gcsafe)?\.}$' "$file"; then
problematic_files+=("$file")
fi
done < <(git diff --name-only --diff-filter=AM --ignore-submodules HEAD^ HEAD | grep -E '\.nim$' || true)

if (( ${#problematic_files[@]} )); then
echo "The following files do not have '{.push raises: [].}':"
echo "The following files do not have '{.push raises: [], gcsafe.}' (gcsafe optional):"
for file in "${problematic_files[@]}"; do
echo "- $file"
done
Expand Down
Loading
Loading