diff --git a/.circleci/config.yml b/.circleci/config.yml index caf5d1e60377e..ee30a568c85a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -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: <> + steps: + - restore_cache: + name: Restore go cache for <> (<>/go.mod) + keys: + - go-<>-<>-<>-{{ checksum "<>/go.mod" }}-{{ checksum "<>/go.sum" }} + - go-<>-<>-<>-{{ checksum "<>/go.mod" }}- + - go-<>-<>-<>- + + 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: <> + steps: + - save_cache: + name: Save go cache for <> (<>/go.mod) + paths: + - ~/.cache/go-build + - ~/go/pkg/mod + key: go-<>-<>-<>-{{ checksum "<>/go.mod" }}-{{ checksum "<>/go.sum" }} + jobs: # Kurtosis-based acceptance tests op-acceptance-tests-kurtosis: @@ -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: | @@ -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: @@ -1236,12 +1282,16 @@ jobs: - attach_workspace: at: "." if: ${{ uses_artifacts }} + - go-restore-cache: + namespace: fuzz-<> - run: name: Fuzz no_output_timeout: 15m command: | make fuzz working_directory: "<>" + - go-save-cache: + namespace: fuzz-<> - run: name: Copy fuzz artifacts command: | @@ -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: | @@ -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: | diff --git a/op-batcher/justfile b/op-batcher/justfile index d3aa74c7dfe37..fc1cf9c9b8663 100644 --- a/op-batcher/justfile +++ b/op-batcher/justfile @@ -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 {} diff --git a/op-chain-ops/justfile b/op-chain-ops/justfile index ee7efe7d6c82f..9c232a6ae2464 100644 --- a/op-chain-ops/justfile +++ b/op-chain-ops/justfile @@ -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 @@ -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 {} diff --git a/op-e2e/Makefile b/op-e2e/Makefile index 73273e3e855b6..447dbfaa60549 100644 --- a/op-e2e/Makefile +++ b/op-e2e/Makefile @@ -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: diff --git a/op-node/justfile b/op-node/justfile index e4d75f82d3bde..1cfb154e2412a 100644 --- a/op-node/justfile +++ b/op-node/justfile @@ -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 {} diff --git a/op-service/justfile b/op-service/justfile index 655aa53852bc2..e6ffa93254f60 100644 --- a/op-service/justfile +++ b/op-service/justfile @@ -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 {}