Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,29 @@ jobs:
- run-contracts-check:
command: opcm-upgrade-checks-no-build

contracts-bedrock-checks-fast:
docker:
- image: <<pipeline.parameters.default_docker_image>>
resource_class: 2xlarge
steps:
- utils/checkout-with-mise
- install-zstd
- install-contracts-dependencies
- check-changed:
patterns: contracts-bedrock
- run:
name: Print forge version
command: forge --version
- run:
name: Pull cached artifacts
command: bash scripts/ops/pull-artifacts.sh --fallback-to-latest
working_directory: packages/contracts-bedrock
- run:
name: Run checks
command: just check-fast
working_directory: packages/contracts-bedrock
- notify-failures-on-develop

todo-issues:
parameters:
check_closed:
Expand Down Expand Up @@ -2633,6 +2656,9 @@ workflows:
- contracts-bedrock-build
context:
- circleci-repo-readonly-authenticated-github-token
- contracts-bedrock-checks-fast:
context:
- circleci-repo-readonly-authenticated-github-token
- contracts-bedrock-upload:
requires:
- contracts-bedrock-build
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/bmatcuk/doublestar/v4 v4.8.1
github.com/btcsuite/btcd v0.24.2
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/chelnak/ysmrr v0.6.0
github.com/cockroachdb/pebble v1.1.5
github.com/coder/websocket v1.8.13
github.com/consensys/gnark-crypto v0.18.0
Expand Down Expand Up @@ -194,7 +195,7 @@ require (
github.com/libp2p/go-yamux/v4 v4.0.1 // indirect
github.com/lufia/plan9stats v0.0.0-20240513124658-fba389f38bae // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mholt/archiver v3.1.1+incompatible // indirect
github.com/miekg/dns v1.1.62 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chelnak/ysmrr v0.6.0 h1:kMhO0oI02tl/9szvxrOE0yeImtrK4KQhER0oXu1K/iM=
github.com/chelnak/ysmrr v0.6.0/go.mod h1:56JSrmQgb7/7xoMvuD87h3PE/qW6K1+BQcrgWtVLTUo=
github.com/chengxilo/virtualterm v1.0.4 h1:Z6IpERbRVlfB8WkOmtbHiDbBANU7cimRIof7mk9/PwM=
github.com/chengxilo/virtualterm v1.0.4/go.mod h1:DyxxBZz/x1iqJjFxTFcr6/x+jSpqN0iwWCOK1q10rlY=
github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
Expand Down Expand Up @@ -579,13 +581,12 @@ github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
Expand Down Expand Up @@ -1137,7 +1138,6 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
92 changes: 92 additions & 0 deletions packages/contracts-bedrock/checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Check Runner Configuration
#
# Phases run sequentially, top to bottom.
# Within each phase, checks run in parallel (unless parallel: false).
# Dependencies within a phase are respected.
#
# Phase fields:
# - name: Phase identifier (shown in output)
# - build: (optional) Build command to run before checks
# - parallel: (optional) Whether checks run in parallel (default: true)
# - checks: List of checks to run
#
# Check fields:
# - name: Unique identifier
# - description: Human-readable description
# - command: Shell command to run
# - depends: (optional) Checks that must complete first (within same phase)
# - retry-clean: (optional) If true, retry with clean build on failure

phases:
# Phase 1: Setup - runs sequentially
- name: setup
parallel: false
checks:
- name: lint-fix
description: Fix code formatting
command: forge fmt || true
Comment thread
smartcontracts marked this conversation as resolved.

# Phase 2: Pre-build checks - no compilation needed
- name: pre-build
checks:
- name: lint
description: Check code formatting
command: forge fmt --check
- name: semgrep
description: Run semgrep security linter
command: cd ../../ && semgrep scan --config .semgrep/rules/ ./packages/contracts-bedrock
- name: semgrep-test-validity
description: Check semgrep tests are valid
command: forge fmt ../../.semgrep/tests/sol-rules.t.sol --check
- name: deploy-configs
description: Validate deploy configurations
command: ./scripts/checks/check-deploy-configs.sh
- name: kontrol-summaries
description: Check kontrol summaries unchanged
command: ./scripts/checks/check-kontrol-summaries-unchanged.sh

# Phase 3: Source build checks - production contracts only
- name: source
build: just build-source
checks:
- name: snapshots
description: Check snapshots are up to date
command: go run ./scripts/autogen/generate-snapshots . && go run scripts/autogen/generate-semver-lock/main.go
- name: semver-diff
description: Check semver changes match lock changes
command: ./scripts/checks/check-semver-diff.sh
depends:
- snapshots
- name: unused-imports
description: Check for unused imports
command: go run ./scripts/checks/unused-imports
- name: strict-pragma
description: Check strict pragma versions
command: go run ./scripts/checks/strict-pragma
- name: valid-semver
description: Check valid semver versions
command: go run ./scripts/checks/valid-semver-check/main.go
- name: spacers
description: Validate storage spacers
command: go run ./scripts/checks/spacers
- name: reinitializers
description: Check reinitializer modifiers
command: go run ./scripts/checks/reinitializer
- name: interfaces
description: Check interface correctness
command: go run ./scripts/checks/interfaces
retry-clean: true
- name: size-check
description: Check contract sizes
command: forge build --sizes --skip "/**/test/**" --skip "/**/scripts/**"
- name: opcm-upgrade-checks
description: Check OPCM upgrade methods
command: go run ./scripts/checks/opcm-upgrade-checks/

# Phase 4: Dev build checks - needs test artifacts
- name: dev
build: just forge-build-dev
checks:
- name: forge-test-names
description: Validate forge test conventions
command: go run ./scripts/checks/test-validation
24 changes: 24 additions & 0 deletions packages/contracts-bedrock/justfile
Comment thread
smartcontracts marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,27 @@ lint: lint-fix lint-check
# Generates a table of contents for the POLICY.md file.
toc:
md_toc -p github meta/POLICY.md


########################################################
# PARALLEL CHECK RUNNER #
########################################################

# Runs checks in parallel with smart build caching.
# Handles builds automatically and caches results for faster subsequent runs.
# Use -run to run specific checks, -list to see available checks.
# Examples:
# just check-fast # Run all checks with caching
# just check-fast -run lint # Run only lint check
# just check-fast -no-build # Skip checks that require builds
# just check-fast -list # List available checks
# just check-fast -verbose # Show output for all checks
# just check-fast -no-cache # Disable build caching
# just check-fast -clean # Clean artifacts before each build
# just check-fast -config path/to/file # Use custom checks.yaml
check-fast *ARGS:
go run ./scripts/check-runner -config checks.yaml {{ARGS}}

# Alias for check-fast.
pr *ARGS:
just check-fast {{ARGS}}
Comment thread
smartcontracts marked this conversation as resolved.
Loading