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
68 changes: 63 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ parameters:
flake-shake-workers:
type: integer
default: 50
# go-cache-version can be used as a cache buster when making breaking changes to caching strategy
go-cache-version:
type: string
default: "v0.0"

orbs:
go: circleci/go@1.8.0
Expand Down Expand Up @@ -281,6 +285,49 @@ commands:
at: "."
- utils/install-mise

go-restore-cache:
parameters:
# The go module to cache for. If the go module does not come with its own go.mod and go.sum,
# "." can be used to point to the root go.mod and go.sum
module:
type: string
default: .
# Since many builds can run off the same go.mod/go.sum, we'll namespace the caches
namespace:
type: string
# Version can be used as a cache buster when making breaking changes to caching strategy
version:
type: string
default: <<pipeline.parameters.go-cache-version>>
steps:
- restore_cache:
name: Restore go cache for <<parameters.namespace>> (<<parameters.module>>/go.mod)
keys:
- go-<<parameters.namespace>>-<<parameters.version>>-<<parameters.module>>-{{ checksum "<<parameters.module>>/go.mod" }}-{{ checksum "<<parameters.module>>/go.sum" }}
- go-<<parameters.namespace>>-<<parameters.version>>-<<parameters.module>>-{{ checksum "<<parameters.module>>/go.mod" }}-
- go-<<parameters.namespace>>-<<parameters.version>>-<<parameters.module>>-

go-save-cache:
parameters:
# The go module to cache for. If the go module does not come with its own go.mod and go.sum,
# "." can be used to point to the root go.mod and go.sum
module:
type: string
default: .
# Since many builds can run off the same go.mod/go.sum, we'll namespace the caches
namespace:
type: string
version:
type: string
default: <<pipeline.parameters.go-cache-version>>
steps:
- save_cache:
name: Save go cache for <<parameters.namespace>> (<<parameters.module>>/go.mod)
paths:
- ~/.cache/go-build
- ~/go/pkg/mod
key: go-<<parameters.namespace>>-<<parameters.version>>-<<parameters.module>>-{{ checksum "<<parameters.module>>/go.mod" }}-{{ checksum "<<parameters.module>>/go.sum" }}

jobs:
# Kurtosis-based acceptance tests
op-acceptance-tests-kurtosis:
Expand Down Expand Up @@ -865,10 +912,14 @@ jobs:
name: Pull artifacts
command: bash scripts/ops/pull-artifacts.sh
working_directory: packages/contracts-bedrock
- go-restore-cache:
namespace: packages/contracts-bedrock/scripts/go-ffi
- run:
name: Build go-ffi
command: just build-go-ffi
working_directory: packages/contracts-bedrock
- go-save-cache:
namespace: packages/contracts-bedrock/scripts/go-ffi
- run:
name: Run tests
command: |
Expand All @@ -892,11 +943,6 @@ jobs:
name: Lint forge test names
command: just lint-forge-tests-check-no-build
working_directory: packages/contracts-bedrock
- save_cache:
name: Save Go build cache
key: golang-build-cache-contracts-bedrock-tests-{{ checksum "go.sum" }}
paths:
- "~/.cache/go-build"
- notify-failures-on-develop

contracts-bedrock-heavy-fuzz-nightly:
Expand Down Expand Up @@ -1236,12 +1282,16 @@ jobs:
- attach_workspace:
at: "."
if: ${{ uses_artifacts }}
- go-restore-cache:
namespace: fuzz-<<parameters.package_name>>
- run:
name: Fuzz
no_output_timeout: 15m
command: |
make fuzz
working_directory: "<<parameters.package_name>>"
- go-save-cache:
namespace: fuzz-<<parameters.package_name>>
- run:
name: Copy fuzz artifacts
command: |
Expand Down Expand Up @@ -1684,12 +1734,16 @@ jobs:
working_directory: op-acceptance-tests
command: |
just cmd-check
- go-restore-cache:
namespace: op-acceptance-tests-flake-shake-aggregator
- run:
name: Build flake-shake aggregator
working_directory: op-acceptance-tests
command: |
go mod download
go build -o ../flake-shake-aggregator ./cmd/flake-shake-aggregator/main.go
- go-save-cache:
namespace: op-acceptance-tests-flake-shake-aggregator
- run:
name: Aggregate results
command: |
Expand Down Expand Up @@ -1728,12 +1782,16 @@ jobs:
working_directory: op-acceptance-tests
command: |
just cmd-check
- go-restore-cache:
namespace: op-acceptance-tests-flake-shake-promoter
- run:
name: Build flake-shake promoter
working_directory: op-acceptance-tests
command: |
go mod download
go build -o ../flake-shake-promoter ./cmd/flake-shake-promoter/main.go
- go-save-cache:
namespace: op-acceptance-tests-flake-shake-promoter
- run:
name: Set GH_TOKEN
command: |
Expand Down
2 changes: 1 addition & 1 deletion op-batcher/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ fuzz:
"FuzzChannelZeroCloseTimeout" \
"FuzzSeqWindowClose" \
"FuzzSeqWindowZeroTimeoutClose" \
| parallel -j {{PARALLEL_JOBS}} {{just_executable()}} batcher_fuzz_task {}
| parallel --tag -j {{PARALLEL_JOBS}} {{just_executable()}} batcher_fuzz_task {}
4 changes: 2 additions & 2 deletions op-chain-ops/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ _LDFLAGSSTRING := "'" + trim(
# Build ecotone-scalar binary
ecotone-scalar: (go_build "./bin/ecotone-scalar" "./cmd/ecotone-scalar" "-ldflags" _LDFLAGSSTRING)

# Build receipt-reference-builder binary
# Build receipt-reference-builder binary
receipt-reference-builder: (go_build "./bin/receipt-reference-builder" "./cmd/receipt-reference-builder" "-ldflags" _LDFLAGSSTRING)

# Run tests
Expand All @@ -33,4 +33,4 @@ fuzz:
"FuzzEncodeDecodeLegacyWithdrawal" \
"FuzzAliasing" \
"FuzzVersionedNonce" \
| parallel -j {{PARALLEL_JOBS}} {{just_executable()}} fuzz_task {}
| parallel --tag -j {{PARALLEL_JOBS}} {{just_executable()}} fuzz_task {}
6 changes: 1 addition & 5 deletions op-e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ clean:
.PHONY: clean

fuzz:
printf "%s\n" \
"go test -run NOTAREALTEST -tags cgo_test -v -fuzztime 10s -fuzz FuzzFjordCostFunction ./opgeth" \
"go test -run NOTAREALTEST -tags cgo_test -v -fuzztime 10s -fuzz FuzzFastLzGethSolidity ./opgeth" \
"go test -run NOTAREALTEST -tags cgo_test -v -fuzztime 10s -fuzz FuzzFastLzCgo ./opgeth" \
| parallel -j 8 {}
parallel --tag -N1 "go test -run NOTAREALTEST -tags cgo_test -v -fuzztime 10s -fuzz {} ./opgeth" ::: FuzzFjordCostFunction FuzzFastLzGethSolidity FuzzFastLzCgo

ifndef CONTRACT
gen-binding:
Expand Down
2 changes: 1 addition & 1 deletion op-node/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ fuzz:
"FuzzParseL1InfoDepositTxDataBadLength" \
"FuzzRejectCreateBlockBadTimestamp" \
"FuzzDecodeDepositTxDataToL1Info" \
| parallel -j {{PARALLEL_JOBS}} {{just_executable()}} node_fuzz_task {}
| parallel --tag -j {{PARALLEL_JOBS}} {{just_executable()}} node_fuzz_task {}
2 changes: 1 addition & 1 deletion op-service/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ service_fuzz_task FUZZ TIME='60s': (go_fuzz FUZZ TIME "./eth")
fuzz:
go test ./eth/... -list=Fuzz -vet=off \
| grep 'Fuzz' \
| parallel -j {{PARALLEL_JOBS}} {{just_executable()}} service_fuzz_task {}
| parallel --tag -j {{PARALLEL_JOBS}} {{just_executable()}} service_fuzz_task {}