Skip to content

Commit

Permalink
Merge pull request #4276 from smartcontractkit/release/0.10.5-rc1
Browse files Browse the repository at this point in the history
Release 0.10.5
  • Loading branch information
tyrion70 committed Apr 26, 2021
2 parents 1f76904 + b5c8df4 commit 0fee9cb
Show file tree
Hide file tree
Showing 421 changed files with 13,510 additions and 8,327 deletions.
6 changes: 4 additions & 2 deletions .circleci/config.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
- setup-aws-ecr
- run:
name: Docker build
command: DOCKER_TAG=circleci make docker
command: DOCKER_TAG=circleci BUILDER="${AWS_ECR_URL}/builder" make docker
- run:
name: Docker build non-root
command: DOCKER_TAG=circleci-nonroot CHAINLINK_USER=chainlink make docker
Expand All @@ -29,7 +29,7 @@ workflows:
only: /^v.*/
commands:
setup-aws-ecr:
description: 'Install aws cli and log docker in ECR'
description: 'Install aws cli and login to public and private ECR'
steps:
- run:
name: Install AWS CLI
Expand Down Expand Up @@ -60,3 +60,5 @@ commands:
accountID=$(aws sts get-caller-identity --output text --query 'Account')
# docker cli login to ECR
aws ecr-public get-login-password --region "us-east-1" --profile "default" | docker login --username AWS --password-stdin "public.ecr.aws"
# docker login to private ECR
aws ecr get-login-password --region us-west-2 --profile "default" | docker login --username AWS --password-stdin "${AWS_ECR_URL}"
7 changes: 5 additions & 2 deletions .github/workflows/continuous-integration-workflow.yml
Expand Up @@ -20,6 +20,7 @@ jobs:
password: ${{ secrets.DOCKER_READONLY_PASSWORD }}
env:
DATABASE_URL: postgres://chainlink@postgres:5432/chainlink_test?sslmode=disable
LOG_LEVEL: debug
services:
postgres:
image: postgres
Expand Down Expand Up @@ -62,8 +63,10 @@ jobs:
go-mod-${{ env.CACHE_VERSION }}
- name: Download Go vendor packages
run: go mod download
- name: Set up Yarn for Contracts
run: yarn setup:contracts
- name: Compile all contracts
run: ./evm-contracts/scripts/native_solc_compile_all
- name: Verify local solc binaries
run: ./evm-contracts/scripts/check_solc_hashes
- name: Setup DB
run: go run ./core local db preparetest
- name: Run tests
Expand Down
5 changes: 2 additions & 3 deletions GNUmakefile
Expand Up @@ -69,13 +69,12 @@ contracts-operator-ui-build: # only compiles tsc and builds contracts and operat
CHAINLINK_VERSION="$(VERSION)@$(COMMIT_SHA)" yarn workspace @chainlink/operator-ui build

.PHONY: abigen
abigen: tools/bin/abigen
tools/bin/abigen:
abigen:
./tools/bin/build_abigen

.PHONY: go-solidity-wrappers
go-solidity-wrappers: tools/bin/abigen ## Recompiles solidity contracts and their go wrappers
yarn workspace @chainlink/contracts compile:clean
./evm-contracts/scripts/native_solc_compile_all
go generate ./core/internal/gethwrappers
go run ./packr/main.go ./core/services/eth/

Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.10.4
0.10.5
7 changes: 5 additions & 2 deletions belt/package.json
Expand Up @@ -2,13 +2,14 @@
"name": "@chainlink/belt",
"private": false,
"description": "A toolbelt for performing various commands on chainlink smart contracts.",
"version": "0.0.3",
"version": "0.0.5-alpha.1",
"author": "Chainlink Devs",
"bin": {
"belt": "./bin/run"
},
"scripts": {
"postpack": "rm -f oclif.manifest.json",
"postinstall": "patch-package || true",
"prepack": "yarn setup --force && oclif-dev manifest && oclif-dev readme",
"setup": "tsc -b",
"clean": "tsc -b --clean",
Expand All @@ -29,6 +30,7 @@
"debug": "^4.3.1",
"ethers": "^4.0.45",
"inquirer": "^7.3.3",
"patch-package": "^6.4.7",
"shelljs": "^0.8.3",
"ts-generator": "^0.1.1",
"tslib": "^2.1.0",
Expand Down Expand Up @@ -56,7 +58,8 @@
"/bin",
"/lib",
"/npm-shrinkwrap.json",
"/oclif.manifest.json"
"/oclif.manifest.json",
"/patches"
],
"homepage": "https://github.com/smartcontractkit/chainlink",
"keywords": [
Expand Down
44 changes: 44 additions & 0 deletions belt/patches/@0x+sol-compiler+4.0.8.patch
@@ -0,0 +1,44 @@
diff --git a/node_modules/@0x/sol-compiler/lib/src/utils/compiler.js b/node_modules/@0x/sol-compiler/lib/src/utils/compiler.js
index 3f22564..22afa17 100644
--- a/node_modules/@0x/sol-compiler/lib/src/utils/compiler.js
+++ b/node_modules/@0x/sol-compiler/lib/src/utils/compiler.js
@@ -210,7 +210,7 @@ function getSolcJSReleasesAsync(isOfflineMode) {
return [2 /*return*/, constants_1.constants.SOLC_BIN_PATHS];
}
if (!(solcJSReleasesCache === undefined)) return [3 /*break*/, 3];
- return [4 /*yield*/, fetch('https://ethereum.github.io/solc-bin/bin/list.json')];
+ return [4 /*yield*/, fetch('https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/list.json')];
case 1:
versionList = _a.sent();
return [4 /*yield*/, versionList.json()];
@@ -235,7 +235,7 @@ function compileSolcJSAsync(solcInstance, standardInput) {
var standardInputStr, standardOutputStr, compiled;
return __generator(this, function (_a) {
standardInputStr = JSON.stringify(standardInput);
- standardOutputStr = solcInstance.compileStandardWrapper(standardInputStr);
+ standardOutputStr = solcInstance.compile(standardInputStr);
compiled = JSON.parse(standardOutputStr);
return [2 /*return*/, compiled];
});
@@ -252,7 +252,7 @@ function compileDockerAsync(solcVersion, standardInput) {
var standardInputStr, dockerCommand, standardOutputStr, compiled;
return __generator(this, function (_a) {
standardInputStr = JSON.stringify(standardInput, null, 2);
- dockerCommand = "docker run -i -a stdin -a stdout -a stderr ethereum/solc:" + solcVersion + " solc --standard-json";
+ dockerCommand = "docker run -i -a stdin -a stdout -a stderr ethereum/solc:" + solcVersion + " --standard-json";
standardOutputStr = child_process_1.execSync(dockerCommand, { input: standardInputStr }).toString();
compiled = JSON.parse(standardOutputStr);
return [2 /*return*/, compiled];
diff --git a/node_modules/@0x/sol-compiler/lib/src/utils/constants.js b/node_modules/@0x/sol-compiler/lib/src/utils/constants.js
index 4c7aca0..26b6ac2 100644
--- a/node_modules/@0x/sol-compiler/lib/src/utils/constants.js
+++ b/node_modules/@0x/sol-compiler/lib/src/utils/constants.js
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
var path = require("path");
exports.constants = {
SOLIDITY_FILE_EXTENSION: '.sol',
- BASE_COMPILER_URL: 'https://ethereum.github.io/solc-bin/bin/',
+ BASE_COMPILER_URL: 'https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/',
LATEST_ARTIFACT_VERSION: '2.0.0',
SOLC_BIN_DIR: path.join(__dirname, '..', '..', '..', 'solc_bin'),
SOLC_BIN_PATHS: {
2 changes: 1 addition & 1 deletion core/README.md
Expand Up @@ -10,7 +10,7 @@
[![GoDoc](https://godoc.org/github.com/smartcontractkit/chainlink?status.svg)](https://godoc.org/github.com/smartcontractkit/chainlink)

Chainlink Core is the API backend that Chainlink client contracts on Ethereum
make requests to. The backend utulizes Solidity contract ABIs to generate types
make requests to. The backend utilizes Solidity contract ABIs to generate types
for interacting with Ethereum contracts.

## Features
Expand Down
1 change: 1 addition & 0 deletions core/adapters/compare.go
Expand Up @@ -15,6 +15,7 @@ type Compare struct {
Value string `json:"value"`
}

// Defining errors to use if the Compare operations fail
var (
ErrResultNotNumber = errors.New("the result was not a number")
ErrValueNotNumber = errors.New("the value was not a number")
Expand Down
2 changes: 1 addition & 1 deletion core/adapters/eth_tx.go
Expand Up @@ -232,9 +232,9 @@ func getConfirmedReceipt(ethTxID int64, db *gorm.DB, minRequiredOutgoingConfirma

}

// A base set of supported types, expand as needed.
var (
ErrInvalidABIEncoding = errors.New("invalid abi encoding")
// A base set of supported types, expand as needed.
// The corresponding go type is the type we need to pass into abi.Arguments.PackValues.
solidityTypeToGoType = map[string]reflect.Type{
"int256": reflect.TypeOf(big.Int{}),
Expand Down
3 changes: 3 additions & 0 deletions core/adapters/result_collect.go
Expand Up @@ -5,12 +5,15 @@ import (
"github.com/smartcontractkit/chainlink/core/store/models"
)

// ResultCollect receiver type
type ResultCollect struct{}

// TaskType returns the TaskTypeResultCollect adapter
func (r ResultCollect) TaskType() models.TaskType {
return TaskTypeResultCollect
}

// Perform takes an input to run and returns the output
func (r ResultCollect) Perform(input models.RunInput, store *store.Store) models.RunOutput {
updatedCollection := make([]interface{}, 0)
for _, c := range input.ResultCollection().Array() {
Expand Down
11 changes: 9 additions & 2 deletions core/chainlink.Dockerfile
@@ -1,5 +1,4 @@
# MAKE ALL CHANGES WITHIN THE DEFAULT WORKDIR FOR YARN AND GO DEP CACHE HITS

ARG BUILDER=smartcontract/builder
FROM ${BUILDER}:1.0.39
WORKDIR /chainlink
Expand Down Expand Up @@ -65,7 +64,15 @@ FROM ubuntu:18.04

ARG CHAINLINK_USER=root
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y ca-certificates
RUN apt-get update && apt-get install -y ca-certificates wget gnupg lsb-release

# Install Postgres for CLI tools, needed specifically for DB backups
RUN wget --quiet -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" |tee /etc/apt/sources.list.d/pgdg.list \
&& apt-get update && apt-get install -y postgresql-client-13 \
&& apt-get clean all

COPY --from=1 /go/bin/chainlink /usr/local/bin/

RUN if [ ${CHAINLINK_USER} != root ]; then \
Expand Down
2 changes: 1 addition & 1 deletion core/cmd/app.go
Expand Up @@ -461,7 +461,7 @@ func NewApp(client *Client) *cli.App {
},
{
Name: "list", Usage: "List the public keys in the db",
Action: client.ListKeys,
Action: client.ListVRFKeys,
},
{
Name: "",
Expand Down
79 changes: 79 additions & 0 deletions core/cmd/bridge_commands.go
@@ -0,0 +1,79 @@
package cmd

import (
"errors"

"github.com/smartcontractkit/chainlink/core/web/presenters"
"github.com/urfave/cli"
"go.uber.org/multierr"
)

// IndexBridges returns all bridges.
func (cli *Client) IndexBridges(c *cli.Context) (err error) {
return cli.getPage("/v2/bridge_types", c.Int("page"), &[]presenters.BridgeResource{})
}

// ShowBridge returns the info for the given Bridge name.
func (cli *Client) ShowBridge(c *cli.Context) (err error) {
if !c.Args().Present() {
return cli.errorOut(errors.New("must pass the name of the bridge to be shown"))
}
bridgeName := c.Args().First()
resp, err := cli.HTTP.Get("/v2/bridge_types/" + bridgeName)
if err != nil {
return cli.errorOut(err)
}
defer func() {
if cerr := resp.Body.Close(); cerr != nil {
err = multierr.Append(err, cerr)
}
}()
var resource presenters.BridgeResource
return cli.renderAPIResponse(resp, &resource)
}

// CreateBridge adds a new bridge to the chainlink node
func (cli *Client) CreateBridge(c *cli.Context) (err error) {
if !c.Args().Present() {
return cli.errorOut(errors.New("must pass in the bridge's parameters [JSON blob | JSON filepath]"))
}

buf, err := getBufferFromJSON(c.Args().First())
if err != nil {
return cli.errorOut(err)
}

resp, err := cli.HTTP.Post("/v2/bridge_types", buf)
if err != nil {
return cli.errorOut(err)
}
defer func() {
if cerr := resp.Body.Close(); cerr != nil {
err = multierr.Append(err, cerr)
}
}()

var resource presenters.BridgeResource
err = cli.renderAPIResponse(resp, &resource)
return err
}

// RemoveBridge removes a specific Bridge by name.
func (cli *Client) RemoveBridge(c *cli.Context) (err error) {
if !c.Args().Present() {
return cli.errorOut(errors.New("must pass the name of the bridge to be removed"))
}
bridgeName := c.Args().First()
resp, err := cli.HTTP.Delete("/v2/bridge_types/" + bridgeName)
if err != nil {
return cli.errorOut(err)
}
defer func() {
if cerr := resp.Body.Close(); cerr != nil {
err = multierr.Append(err, cerr)
}
}()
var resource presenters.BridgeResource
err = cli.renderAPIResponse(resp, &resource)
return err
}

0 comments on commit 0fee9cb

Please sign in to comment.