Skip to content

Commit

Permalink
rename module to chainlink-automation (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Nov 20, 2023
1 parent 8b96355 commit d4cab69
Show file tree
Hide file tree
Showing 149 changed files with 405 additions and 394 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
env:
TESTCOVERAGE_THRESHOLD: 70
run: |
go test github.com/smartcontractkit/ocr2keepers/pkg/v3/... -coverprofile coverV3.out -covermode count
go test github.com/smartcontractkit/chainlink-automation/pkg/v3/... -coverprofile coverV3.out -covermode count
echo "Quality Gate: checking V3 test coverage is above threshold ..."
echo "Threshold : $TESTCOVERAGE_THRESHOLD %"
totalCoverage=`go tool cover -func=coverV3.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
Expand Down Expand Up @@ -105,10 +105,10 @@ jobs:
go-version-file: "go.mod"

- name: Run Keepers Package v2 Fuzz Tests
run: go test --fuzz=Fuzz --fuzztime=10s -run=^# github.com/smartcontractkit/ocr2keepers/pkg/v2
run: go test --fuzz=Fuzz --fuzztime=10s -run=^# github.com/smartcontractkit/chainlink-automation/pkg/v2

- name: Run Keepers Package v3 Fuzz Tests
run: go test --fuzz=Fuzz --fuzztime=10s -run=^# github.com/smartcontractkit/ocr2keepers/pkg/v3
run: go test --fuzz=Fuzz --fuzztime=10s -run=^# github.com/smartcontractkit/chainlink-automation/pkg/v3

sonar-scan:
name: SonarQube
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Copyright (c) 2023 SmartContract ChainLink Limited SEZC

Portions of this software are licensed as follows:

*All content residing under (1) https://github.com/smartcontractkit/chainlink/tree/develop/contracts/src/v0.8/automation/2_1; (2) https://github.com/smartcontractkit/ocr2keepers/tree/main/pkg/v3 are licensed under “Business Source License 1.1” with a Change Date of September 12, 2027 and Change License to “MIT License”
*All content residing under (1) https://github.com/smartcontractkit/chainlink/tree/develop/contracts/src/v0.8/automation/2_1; (2) https://github.com/smartcontractkit/chainlink-automation/tree/main/pkg/v3 are licensed under “Business Source License 1.1” with a Change Date of September 12, 2027 and Change License to “MIT License”

* Content outside of the above mentioned directories or restrictions above is available under the "MIT" license as defined below.

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ race: dependencies

coverage:
@go test -coverprofile cover.out $(GOPACKAGES) && \
go test github.com/smartcontractkit/ocr2keepers/pkg/v3/... -coverprofile coverV3.out -covermode count && \
go test github.com/smartcontractkit/chainlink-automation/pkg/v3/... -coverprofile coverV3.out -covermode count && \
go tool cover -func=coverV3.out | grep total | grep -Eo '[0-9]+\.[0-9]+'

benchmark: dependencies fmt
@go test $(GOPACKAGES) -bench=. -benchmem -run=^#

parallel: dependencies fmt
@go test github.com/smartcontractkit/ocr2keepers/internal/keepers -bench=BenchmarkCacheParallelism -benchtime 20s -mutexprofile mutex.out -run=^#
@go test github.com/smartcontractkit/chainlink-automation/internal/keepers -bench=BenchmarkCacheParallelism -benchtime 20s -mutexprofile mutex.out -run=^#

simulator: dependencies fmt
go build -o $(GOBIN)/simulator ./cmd/simulator/*.go || exit
Expand Down
22 changes: 11 additions & 11 deletions benchmarks.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
go mod download
gofmt -w .
PASS
ok github.com/smartcontractkit/ocr2keepers/cmd/simulator 0.475s
ok github.com/smartcontractkit/chainlink-automation/cmd/simulator 0.475s
goos: darwin
goarch: amd64
pkg: github.com/smartcontractkit/ocr2keepers/internal/keepers
pkg: github.com/smartcontractkit/chainlink-automation/internal/keepers
cpu: VirtualApple @ 2.50GHz
BenchmarkCacheParallelism-10 3714394 312.9 ns/op 55 B/op 1 allocs/op
BenchmarkDecode-10 325212 3503 ns/op 1160 B/op 10 allocs/op
Expand All @@ -24,21 +24,21 @@ BenchmarkWorkerGroup/MaxProcs-10 147 130.0 comp
BenchmarkWorkerGroup/2x_MaxProcs-10 295 280.0 complete 383 B/op 4 allocs/op
BenchmarkWorkerGroup/10x_MaxProcs-10 10000 900.0 complete 128 B/op 2 allocs/op
PASS
ok github.com/smartcontractkit/ocr2keepers/internal/keepers 72.649s
? github.com/smartcontractkit/ocr2keepers/internal/mocks [no test files]
ok github.com/smartcontractkit/chainlink-automation/internal/keepers 72.649s
? github.com/smartcontractkit/chainlink-automation/internal/mocks [no test files]
PASS
ok github.com/smartcontractkit/ocr2keepers/pkg 0.560s
ok github.com/smartcontractkit/chainlink-automation/pkg 0.560s
goos: darwin
goarch: amd64
pkg: github.com/smartcontractkit/ocr2keepers/pkg/chain
pkg: github.com/smartcontractkit/chainlink-automation/pkg/chain
cpu: VirtualApple @ 2.50GHz
BenchmarkEncodeReport/No_Perform_Data-10 165970 6783 ns/op 3096 B/op 71 allocs/op
BenchmarkEncodeReport/Small_Perform_Data-10 170286 7121 ns/op 3608 B/op 75 allocs/op
BenchmarkEncodeReport/Large_Perform_Data-10 164830 7304 ns/op 4152 B/op 74 allocs/op
BenchmarkEncodeReport/Multiple_Performs-10 89985 13546 ns/op 9944 B/op 169 allocs/op
PASS
ok github.com/smartcontractkit/ocr2keepers/pkg/chain 33.573s
? github.com/smartcontractkit/ocr2keepers/pkg/chain/gethwrappers [no test files]
? github.com/smartcontractkit/ocr2keepers/pkg/chain/gethwrappers/keeper_registry_logic2_0 [no test files]
? github.com/smartcontractkit/ocr2keepers/pkg/chain/gethwrappers/keeper_registry_wrapper2_0 [no test files]
? github.com/smartcontractkit/ocr2keepers/pkg/types [no test files]
ok github.com/smartcontractkit/chainlink-automation/pkg/chain 33.573s
? github.com/smartcontractkit/chainlink-automation/pkg/chain/gethwrappers [no test files]
? github.com/smartcontractkit/chainlink-automation/pkg/chain/gethwrappers/keeper_registry_logic2_0 [no test files]
? github.com/smartcontractkit/chainlink-automation/pkg/chain/gethwrappers/keeper_registry_wrapper2_0 [no test files]
? github.com/smartcontractkit/chainlink-automation/pkg/types [no test files]
10 changes: 5 additions & 5 deletions cmd/simulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
"github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil"
flag "github.com/spf13/pflag"

"github.com/smartcontractkit/ocr2keepers/tools/simulator/config"
"github.com/smartcontractkit/ocr2keepers/tools/simulator/node"
"github.com/smartcontractkit/ocr2keepers/tools/simulator/run"
"github.com/smartcontractkit/ocr2keepers/tools/simulator/simulate/chain"
"github.com/smartcontractkit/ocr2keepers/tools/simulator/telemetry"
"github.com/smartcontractkit/chainlink-automation/tools/simulator/config"
"github.com/smartcontractkit/chainlink-automation/tools/simulator/node"
"github.com/smartcontractkit/chainlink-automation/tools/simulator/run"
"github.com/smartcontractkit/chainlink-automation/tools/simulator/simulate/chain"
"github.com/smartcontractkit/chainlink-automation/tools/simulator/telemetry"
)

var (
Expand Down
11 changes: 4 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/smartcontractkit/ocr2keepers
module github.com/smartcontractkit/chainlink-automation

go 1.20

Expand All @@ -22,19 +22,16 @@ require (
gonum.org/v1/gonum v0.13.0
)

require (
github.com/deckarep/golang-set/v2 v2.3.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/holiman/uint256 v1.2.2 // indirect
)

require (
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.3.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/holiman/uint256 v1.2.2 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand Down
8 changes: 4 additions & 4 deletions pkg/v2/coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"sync/atomic"
"time"

"github.com/smartcontractkit/ocr2keepers/pkg/util"
ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2"
"github.com/smartcontractkit/chainlink-automation/pkg/util"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v2"
)

var (
Expand All @@ -41,13 +41,13 @@ var (
IndefiniteBlockingKey = ocr2keepers.BlockKey("18446744073709551616") // Higher than possible block numbers (uint64), used to block keys indefintely
)

//go:generate mockery --name LogProvider --srcpkg "github.com/smartcontractkit/ocr2keepers/pkg/v2/coordinator" --case underscore --filename log_provider.generated.go
//go:generate mockery --name LogProvider --srcpkg "github.com/smartcontractkit/chainlink-automation/pkg/v2/coordinator" --case underscore --filename log_provider.generated.go
type LogProvider interface {
PerformLogs(context.Context) ([]ocr2keepers.PerformLog, error)
StaleReportLogs(context.Context) ([]ocr2keepers.StaleReportLog, error)
}

//go:generate mockery --name Encoder --srcpkg "github.com/smartcontractkit/ocr2keepers/pkg/v2/coordinator" --case underscore --filename encoder.generated.go
//go:generate mockery --name Encoder --srcpkg "github.com/smartcontractkit/chainlink-automation/pkg/v2/coordinator" --case underscore --filename encoder.generated.go
type Encoder interface {
// SplitUpkeepKey ...
SplitUpkeepKey(ocr2keepers.UpkeepKey) (ocr2keepers.BlockKey, ocr2keepers.UpkeepIdentifier, error)
Expand Down
7 changes: 4 additions & 3 deletions pkg/v2/coordinator/coordinator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import (
"testing"
"time"

"github.com/smartcontractkit/ocr2keepers/pkg/util"
ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2"
"github.com/smartcontractkit/ocr2keepers/pkg/v2/coordinator/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"

"github.com/smartcontractkit/chainlink-automation/pkg/util"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v2"
"github.com/smartcontractkit/chainlink-automation/pkg/v2/coordinator/mocks"
)

func TestReportCoordinator(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/v2/coordinator/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"log"
"time"

ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2"
"github.com/smartcontractkit/ocr2keepers/pkg/v2/config"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v2"
"github.com/smartcontractkit/chainlink-automation/pkg/v2/config"
)

// CoordinatorFactory provides a single method to create a new coordinator
Expand Down
2 changes: 1 addition & 1 deletion pkg/v2/coordinator/mocks/encoder.generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/v2/coordinator/mocks/log_provider.generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/v2/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
offchainreporting "github.com/smartcontractkit/libocr/offchainreporting2plus"
"github.com/smartcontractkit/libocr/offchainreporting2plus/types"

"github.com/smartcontractkit/ocr2keepers/pkg/v2/config"
"github.com/smartcontractkit/chainlink-automation/pkg/v2/config"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/v2/delegate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/ocr2keepers/pkg/v2/mocks"
"github.com/smartcontractkit/chainlink-automation/pkg/v2/mocks"
)

func TestStart(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/v2/encoding/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"
"strings"

ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v2"
)

const separator string = "|"
Expand Down
2 changes: 1 addition & 1 deletion pkg/v2/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/smartcontractkit/libocr/offchainreporting2plus/types"

"github.com/smartcontractkit/ocr2keepers/pkg/v2/config"
"github.com/smartcontractkit/chainlink-automation/pkg/v2/config"
)

// an upkeep key is composed of a block number and upkeep id (~40 bytes)
Expand Down
2 changes: 1 addition & 1 deletion pkg/v2/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"

"github.com/smartcontractkit/ocr2keepers/pkg/v2/mocks"
"github.com/smartcontractkit/chainlink-automation/pkg/v2/mocks"
)

func TestLogWriter(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/v2/observation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"

ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2"
"github.com/smartcontractkit/ocr2keepers/pkg/v2/encoding"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v2"
"github.com/smartcontractkit/chainlink-automation/pkg/v2/encoding"
)

func TestObservation_UnmarshalJSON(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/v2/observer/polling/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"github.com/smartcontractkit/libocr/offchainreporting2plus/types"

ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2"
"github.com/smartcontractkit/ocr2keepers/pkg/v2/config"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v2"
"github.com/smartcontractkit/chainlink-automation/pkg/v2/config"
)

// PollingObserverFactory ...
Expand Down
6 changes: 3 additions & 3 deletions pkg/v2/observer/polling/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"sync"
"time"

"github.com/smartcontractkit/ocr2keepers/internal/util"
ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2"
"github.com/smartcontractkit/ocr2keepers/pkg/v2/observer"
"github.com/smartcontractkit/chainlink-automation/internal/util"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v2"
"github.com/smartcontractkit/chainlink-automation/pkg/v2/observer"
)

var ErrTooManyErrors = fmt.Errorf("too many errors in parallel worker process")
Expand Down
2 changes: 1 addition & 1 deletion pkg/v2/ocr.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/smartcontractkit/libocr/offchainreporting2plus/types"

"github.com/smartcontractkit/ocr2keepers/pkg/v2/config"
"github.com/smartcontractkit/chainlink-automation/pkg/v2/config"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/v2/runner/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package runner
import (
"sync"

ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v2"
)

type Result struct {
Expand Down
6 changes: 3 additions & 3 deletions pkg/v2/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"sync/atomic"
"time"

"github.com/smartcontractkit/ocr2keepers/internal/util"
pkgutil "github.com/smartcontractkit/ocr2keepers/pkg/util"
ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2"
"github.com/smartcontractkit/chainlink-automation/internal/util"
pkgutil "github.com/smartcontractkit/chainlink-automation/pkg/util"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v2"
)

var ErrTooManyErrors = fmt.Errorf("too many errors in parallel worker process")
Expand Down
2 changes: 1 addition & 1 deletion pkg/v2/shuffle.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ocr2keepers
import (
"math/rand"

"github.com/smartcontractkit/ocr2keepers/internal/util"
"github.com/smartcontractkit/chainlink-automation/internal/util"
)

func filterDedupeShuffleObservations(upkeepKeys [][]UpkeepKey, keyRandSource [16]byte, filters ...func(UpkeepKey) (bool, error)) ([]UpkeepKey, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/v3/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Licensor: SmartContract Chainlink Limited SEZC
Licensed Work: Automation v2.1
The Licensed Work is (c) 2023 SmartContract Chainlink Limited SEZC

Additional Use Grant: Any uses listed and defined at https://github.com/smartcontractkit/ocr2keepers/tree/main/pkg/v3/Automation_v2.1_Grants.md
Additional Use Grant: Any uses listed and defined at https://github.com/smartcontractkit/chainlink-automation/tree/main/pkg/v3/Automation_v2.1_Grants.md

Change Date: September 12, 2027

Expand Down
8 changes: 4 additions & 4 deletions pkg/v3/coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"log"
"time"

internalutil "github.com/smartcontractkit/ocr2keepers/internal/util"
"github.com/smartcontractkit/ocr2keepers/pkg/util"
"github.com/smartcontractkit/ocr2keepers/pkg/v3/config"
ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types"
internalutil "github.com/smartcontractkit/chainlink-automation/internal/util"
"github.com/smartcontractkit/chainlink-automation/pkg/util"
"github.com/smartcontractkit/chainlink-automation/pkg/v3/config"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v3/types"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions pkg/v3/coordinator/coordinator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

"github.com/stretchr/testify/assert"

"github.com/smartcontractkit/ocr2keepers/pkg/util"
"github.com/smartcontractkit/ocr2keepers/pkg/v3/config"
ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types"
"github.com/smartcontractkit/chainlink-automation/pkg/util"
"github.com/smartcontractkit/chainlink-automation/pkg/v3/config"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v3/types"
)

func TestNewCoordinator(t *testing.T) {
Expand Down
16 changes: 8 additions & 8 deletions pkg/v3/flows/conditional.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"log"
"time"

ocr2keepersv3 "github.com/smartcontractkit/ocr2keepers/pkg/v3"
"github.com/smartcontractkit/ocr2keepers/pkg/v3/postprocessors"
"github.com/smartcontractkit/ocr2keepers/pkg/v3/preprocessors"
"github.com/smartcontractkit/ocr2keepers/pkg/v3/random"
"github.com/smartcontractkit/ocr2keepers/pkg/v3/service"
"github.com/smartcontractkit/ocr2keepers/pkg/v3/telemetry"
"github.com/smartcontractkit/ocr2keepers/pkg/v3/tickers"
ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types"
ocr2keepersv3 "github.com/smartcontractkit/chainlink-automation/pkg/v3"
"github.com/smartcontractkit/chainlink-automation/pkg/v3/postprocessors"
"github.com/smartcontractkit/chainlink-automation/pkg/v3/preprocessors"
"github.com/smartcontractkit/chainlink-automation/pkg/v3/random"
"github.com/smartcontractkit/chainlink-automation/pkg/v3/service"
"github.com/smartcontractkit/chainlink-automation/pkg/v3/telemetry"
"github.com/smartcontractkit/chainlink-automation/pkg/v3/tickers"
ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v3/types"
)

const (
Expand Down
Loading

0 comments on commit d4cab69

Please sign in to comment.