Skip to content

Commit

Permalink
Merge branch 'develop' into feature/BCF-2393-multichain-telemetry-sup…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
george-dorin authored Sep 22, 2023
2 parents 75ef748 + 90a0a37 commit 8f3bde1
Show file tree
Hide file tree
Showing 56 changed files with 1,807 additions and 127 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ jobs:
id: sonarqube_report_paths
shell: bash
run: |
echo "sonarqube_tests_report_paths=$(find go_core_tests_*_logs -name output.txt | paste -sd "," -)" >> $GITHUB_OUTPUT
echo "sonarqube_coverage_report_paths=$(find go_core_tests_*_logs -name coverage.txt | paste -sd "," -)" >> $GITHUB_OUTPUT
echo "sonarqube_tests_report_paths=$(find go_core_tests_logs -name output.txt | paste -sd "," -)" >> $GITHUB_OUTPUT
echo "sonarqube_coverage_report_paths=$(find go_core_tests_logs -name coverage.txt | paste -sd "," -)" >> $GITHUB_OUTPUT
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@69c1a75940dec6249b86dace6b630d3a2ae9d2a7 # v2.0.1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ jobs:

testnet-smoke-tests-notify:
name: Live Testnet Start Slack Thread
if: ${{ github.event_name == 'schedule' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) && needs.*.result != 'skipped' }}
if: ${{ always() && needs.testnet-smoke-tests-matrix.result != 'skipped' && needs.testnet-smoke-tests-matrix.result != 'cancelled' }}
environment: integration
outputs:
thread_ts: ${{ steps.slack.outputs.thread_ts }}
Expand Down Expand Up @@ -859,7 +859,7 @@ jobs:

testnet-smoke-tests-results:
name: Post Live Testnet Smoke Test Results
if: ${{ github.event_name == 'schedule' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) && needs.*.result != 'skipped' }}
if: ${{ always() && needs.testnet-smoke-tests-matrix.result != 'skipped' && needs.testnet-smoke-tests-matrix.result != 'cancelled' }}
environment: integration
permissions:
checks: write
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
golang 1.20.4
golang 1.21.1
mockery 2.28.1
nodejs 16.16.0
postgres 13.3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ regarding Chainlink social accounts, news, and networking.

## Build Chainlink

1. [Install Go 1.20](https://golang.org/doc/install), and add your GOPATH's [bin directory to your PATH](https://golang.org/doc/code.html#GOPATH)
1. [Install Go 1.21.1](https://golang.org/doc/install), and add your GOPATH's [bin directory to your PATH](https://golang.org/doc/code.html#GOPATH)
- Example Path for macOS `export PATH=$GOPATH/bin:$PATH` & `export GOPATH=/Users/$USER/go`
2. Install [NodeJS v16](https://nodejs.org/en/download/package-manager/) & [pnpm via npm](https://pnpm.io/installation#using-npm).
- It might be easier long term to use [nvm](https://nodejs.org/en/download/package-manager/#nvm) to switch between node versions for different projects. For example, assuming $NODE_VERSION was set to a valid version of NodeJS, you could run: `nvm install $NODE_VERSION && nvm use $NODE_VERSION`
Expand Down
2 changes: 1 addition & 1 deletion core/chainlink.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build image: Chainlink binary
FROM golang:1.20-buster as buildgo
FROM golang:1.21-bullseye as buildgo
RUN go version
WORKDIR /chainlink

Expand Down
4 changes: 2 additions & 2 deletions core/chainlink.devspace.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build image: Chainlink binary
FROM golang:1.20-buster as buildgo
FROM golang:1.21-bullseye as buildgo
RUN go version
WORKDIR /chainlink

Expand All @@ -18,7 +18,7 @@ COPY . .
RUN make install-chainlink

# Final image: ubuntu with chainlink binary
FROM golang:1.20-buster
FROM golang:1.21-bullseye

ARG CHAINLINK_USER=root
ENV DEBIAN_FRONTEND noninteractive
Expand Down
41 changes: 1 addition & 40 deletions core/cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ type ChainlinkAppFactory struct{}
func (n ChainlinkAppFactory) NewApplication(ctx context.Context, cfg chainlink.GeneralConfig, appLggr logger.Logger, db *sqlx.DB) (app chainlink.Application, err error) {
initGlobals(cfg.Prometheus())

// TODO TO BE REMOVED IN v2.7.0
err = evmChainIDMigration(cfg, db.DB, appLggr)
err = migrate.SetMigrationENVVars(cfg)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -301,44 +300,6 @@ func takeBackupIfVersionUpgrade(dbUrl url.URL, rootDir string, cfg periodicbacku
return err
}

// evmChainIDMigration TODO TO BE REMOVED IN v2.7.0. This is a helper function for evmChainID 0195 migration in v2.6.0 only, so that we don't have to inject evmChainID into goose.
func evmChainIDMigration(generalConfig chainlink.GeneralConfig, db *sql.DB, lggr logger.Logger) error {
migrationVer, err := migrate.Current(db, lggr)
if err != nil {
return err
}
if migrationVer != 194 {
return nil
}

if generalConfig.EVMEnabled() {
if generalConfig.EVMConfigs() == nil {
return errors.New("evm configs are missing")
}
if generalConfig.EVMConfigs()[0] == nil {
return errors.New("evm config is nil")
}
updateQueries := []string{
`UPDATE direct_request_specs SET evm_chain_id = $1 WHERE evm_chain_id IS NULL;`,
`UPDATE flux_monitor_specs SET evm_chain_id = $1 WHERE evm_chain_id IS NULL;`,
`UPDATE ocr_oracle_specs SET evm_chain_id = $1 WHERE evm_chain_id IS NULL;`,
`UPDATE keeper_specs SET evm_chain_id = $1 WHERE evm_chain_id IS NULL;`,
`UPDATE vrf_specs SET evm_chain_id = $1 WHERE evm_chain_id IS NULL;`,
`UPDATE blockhash_store_specs SET evm_chain_id = $1 WHERE evm_chain_id IS NULL;`,
`UPDATE block_header_feeder_specs SET evm_chain_id = $1 WHERE evm_chain_id IS NULL;`,
}

chainID := generalConfig.EVMConfigs()[0].ChainID.String()
for i := range updateQueries {
_, err := db.Exec(updateQueries[i], chainID)
if err != nil {
return errors.Wrap(err, "failed to set missing evm chain ids")
}
}
}
return nil
}

// Runner implements the Run method.
type Runner interface {
Run(context.Context, chainlink.Application) error
Expand Down
14 changes: 1 addition & 13 deletions core/cmd/shell_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -840,19 +840,7 @@ func (s *Shell) MigrateDatabase(_ *cli.Context) error {
return s.errorOut(errDBURLMissing)
}

// TODO TO BE REMOVED IN v2.7.0
db, err := sql.Open(string(dialects.Postgres), parsed.String())
if err != nil {
return fmt.Errorf("unable to open postgres database for evmChainID helper migration: %+v", err)
}
defer func() {
if cerr := db.Close(); cerr != nil {
err = multierr.Append(err, cerr)
}
}()

// TODO TO BE REMOVED IN v2.7.0
err = evmChainIDMigration(s.Config, db, s.Logger)
err := migrate.SetMigrationENVVars(s.Config)
if err != nil {
return err
}
Expand Down
2 changes: 2 additions & 0 deletions core/config/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ var (
PyroscopeAuthToken = Secret("CL_PYROSCOPE_AUTH_TOKEN")
PrometheusAuthToken = Secret("CL_PROMETHEUS_AUTH_TOKEN")
ThresholdKeyShare = Secret("CL_THRESHOLD_KEY_SHARE")
// Migrations env vars
EVMChainIDNotNullMigration0195 = "CL_EVM_CHAINID_NOT_NULL_MIGRATION_0195"
)

type Var string
Expand Down
1 change: 1 addition & 0 deletions core/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func init() {
var _ relaylogger.Logger = (Logger)(nil)

//go:generate mockery --quiet --name Logger --output . --filename logger_mock_test.go --inpackage --case=underscore
//go:generate mockery --quiet --name Logger --output ./mocks/ --case=underscore

// Logger is the main interface of this package.
// It implements uber/zap's SugaredLogger interface and adds conditional logging helpers.
Expand Down
Loading

0 comments on commit 8f3bde1

Please sign in to comment.