Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
0d52168
test(docker): add Dockerfile-dev for native-Linux dev shell
chiliec May 1, 2026
5a72216
test(consensus_sim): audit chain API and clock dependencies
chiliec May 1, 2026
8c5ea54
test(consensus_sim): scaffold opt-in CMake target with sanitizers
chiliec May 2, 2026
5b8e215
test(consensus_sim): add virtual_clock with monotonic advance
chiliec May 19, 2026
bba1bd2
test(consensus_sim): add deterministic genesis_factory
chiliec May 19, 2026
21e2377
test(consensus_sim): add simulated_node wrapping graphene::chain::dat…
chiliec May 19, 2026
cf11ef7
test(consensus_sim): add message_bus with partition/drop primitives
chiliec May 19, 2026
bdabea3
test(consensus_sim): add invariant library skeleton
chiliec May 19, 2026
ff7b304
test(consensus_sim): add scenario_driver event loop
chiliec May 19, 2026
550d9a3
test(consensus_sim): 7-node no-faults smoke passes
chiliec May 20, 2026
044109f
test(consensus_sim): determinism replay self-test passes
chiliec May 20, 2026
34cb1c5
test(consensus_sim): write failure logs on invariant violation
chiliec May 20, 2026
0371798
test(consensus_sim): add fault_injector and no_double_signed invariant
chiliec May 20, 2026
dd1285c
test(consensus_sim): single-seed equivocation scenario
chiliec May 20, 2026
cb155bb
test(consensus_sim): 100-seed equivocation sweep
chiliec May 20, 2026
09ae266
test(consensus_sim): add WITH_COVERAGE plumbing and harness README
chiliec May 20, 2026
0c3647f
test(consensus_sim): produce real equivocating block_b via shadow node
chiliec May 20, 2026
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
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ if(CHAINBASE_CHECK_LOCKING)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCHAINBASE_CHECK_LOCKING")
endif()

option(BUILD_CONSENSUS_TESTS "Build consensus simulation test harness" OFF)
option(WITH_COVERAGE "Enable gcov coverage instrumentation for consensus tests" OFF)

if(WIN32)
set(BOOST_ROOT $ENV{BOOST_ROOT})
set(Boost_USE_MULTITHREADED ON)
Expand Down Expand Up @@ -200,6 +203,11 @@ add_subdirectory(libraries)
add_subdirectory(plugins)
add_subdirectory(programs)

if(BUILD_CONSENSUS_TESTS)
enable_testing()
add_subdirectory(tests/consensus_sim)
endif()

if(ENABLE_INSTALLER)

set(VERSION_MAJOR 0)
Expand Down
5 changes: 5 additions & 0 deletions libraries/chain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ add_dependencies(graphene_chain graphene_protocol graphene_utilities build_hardf
target_link_libraries(graphene_chain graphene_protocol graphene_utilities fc chainbase appbase ${PATCH_MERGE_LIB})
target_include_directories(graphene_chain PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../")

if(WITH_COVERAGE)
target_compile_options(graphene_chain PRIVATE --coverage)
target_link_options(graphene_chain PUBLIC --coverage)
endif()

if(MSVC)
set_source_files_properties(database.cpp PROPERTIES COMPILE_FLAGS "/bigobj")
endif(MSVC)
Expand Down
5 changes: 5 additions & 0 deletions libraries/protocol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ target_link_libraries(graphene_${CURRENT_TARGET} fc) #graphene::version)
target_include_directories(graphene_${CURRENT_TARGET}
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../version/include" "${CMAKE_CURRENT_BINARY_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/../../version/include")

if(WITH_COVERAGE)
target_compile_options(graphene_${CURRENT_TARGET} PRIVATE --coverage)
target_link_options(graphene_${CURRENT_TARGET} PUBLIC --coverage)
endif()

install(TARGETS
graphene_${CURRENT_TARGET}

Expand Down
8 changes: 8 additions & 0 deletions libraries/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GRAPHENE_GIT_REVISION_SHA)
get_git_unix_timestamp(GRAPHENE_GIT_REVISION_UNIX_TIMESTAMP)
git_describe(GRAPHENE_GIT_REVISION_DESCRIPTION --tags)
# Fallbacks when git lookup fails (e.g. building inside a container that can't
# resolve a worktree gitfile pointing to a host path).
if(NOT GRAPHENE_GIT_REVISION_UNIX_TIMESTAMP MATCHES "^[0-9]+$")
set(GRAPHENE_GIT_REVISION_UNIX_TIMESTAMP 0)
endif()
if(NOT GRAPHENE_GIT_REVISION_SHA MATCHES "^[a-f0-9]+$")
set(GRAPHENE_GIT_REVISION_SHA "")
endif()
if(NOT GRAPHENE_GIT_REVISION_DESCRIPTION)
set(GRAPHENE_GIT_REVISION_DESCRIPTION "unknown")
endif(NOT GRAPHENE_GIT_REVISION_DESCRIPTION)
Expand Down
72 changes: 72 additions & 0 deletions share/vizd/docker/Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Dockerfile-dev — developer toolchain image for VIZ blockchain
#
# PURPOSE: Provides a fully-equipped Linux build environment that mirrors the
# CI builder stage (same base image and apt packages as Dockerfile-production)
# WITHOUT baking any source code in. The host worktree is mounted at /workspace
# so you can iterate on the source without rebuilding this image.
#
# BUILD:
# docker build -f share/vizd/docker/Dockerfile-dev -t viz-dev .
#
# ENTER A SHELL:
# docker run --rm -it -v $(pwd):/workspace viz-dev
#
# ONE-SHOT COMMAND:
# docker run --rm -v $(pwd):/workspace viz-dev bash -c "cd /workspace/build && make -j$(nproc) vizd"
#
# ccache is stored in /workspace/.ccache (mounted from the host worktree) so it
# persists across container runs. Set CCACHE_DIR=/workspace/.ccache inside the
# container or rely on the ENV below.

FROM phusion/baseimage:noble-1.0.3

ENV LANG=en_US.UTF-8

# ccache configuration — cache directory is mounted from the host worktree so
# it survives container restarts without polluting the image layers.
ENV CCACHE_DIR=/workspace/.ccache
ENV CCACHE_MAXSIZE=2G
ENV CCACHE_COMPRESS=1

# Install build dependencies (mirrors Dockerfile-production builder stage exactly,
# plus gcovr for coverage reports and gdb for debugging failing scenarios).
RUN apt-get update && \
apt-get install -y --no-install-recommends \
autoconf \
automake \
autotools-dev \
binutils \
bsdmainutils \
build-essential \
cmake \
git \
ccache \
gdb \
gcovr \
libboost-chrono-dev \
libboost-context-dev \
libboost-coroutine-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-locale-dev \
libboost-program-options-dev \
libboost-serialization-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev \
libbz2-dev \
liblzma-dev \
libzstd-dev \
libreadline-dev \
libssl-dev \
libtool \
ncurses-dev \
pbzip2 \
pkg-config \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*

WORKDIR /workspace

CMD ["/bin/bash"]
75 changes: 75 additions & 0 deletions share/vizd/docker/README-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# VIZ Developer Docker Image

`Dockerfile-dev` builds a long-lived Linux toolchain image that mirrors the CI
builder stage (same base image and packages as `Dockerfile-production`) without
baking any source code in. Mount the worktree as a volume and compile/test
inside the container against a real Ubuntu Noble environment.

## Prerequisites

- Docker Desktop (or Docker Engine) running locally.
- Git submodules initialized on the host **before** using the container:

```bash
git submodule update --init --recursive
```

## Build the image

Run once from the repository root (or worktree root):

```bash
docker build -f share/vizd/docker/Dockerfile-dev -t viz-dev .
```

Typical build time: 3–8 minutes on first run (pulls base image + ~30 apt
packages). Subsequent builds are fast thanks to Docker layer cache.

## Enter an interactive shell

```bash
docker run --rm -it -v $(pwd):/workspace viz-dev
```

Inside the container your worktree is at `/workspace`. Run cmake, make, ctest,
gcovr, or gdb from there.

## Run a one-shot command

```bash
docker run --rm -v $(pwd):/workspace viz-dev bash -c "
mkdir -p build-docker && cd build-docker
cmake -DCMAKE_BUILD_TYPE=Release -DLOW_MEMORY_NODE=OFF ..
make -j$(nproc) vizd
"
```

## Configure only (no build)

```bash
docker run --rm -v $(pwd):/workspace viz-dev bash -c "
mkdir -p build-docker && cd build-docker
cmake -DCMAKE_BUILD_TYPE=Release -DLOW_MEMORY_NODE=OFF .. 2>&1 | tail -30
"
```

## ccache

The image sets `CCACHE_DIR=/workspace/.ccache`. When you mount the worktree
with `-v $(pwd):/workspace`, ccache writes to `<worktree>/.ccache/` on the
host and persists across container runs. The `.ccache/` directory is listed in
`.git/info/exclude` so it won't appear in `git status`.

## Clean up

Remove the build directory created inside the worktree:

```bash
rm -rf build-docker/
```

Remove the image:

```bash
docker rmi viz-dev
```
3 changes: 3 additions & 0 deletions tests/consensus_sim/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build.log
failures/*
!failures/.gitkeep
Loading
Loading