Skip to content

Commit

Permalink
Merge branch 'filecoin-project:master' into lotus-wallet-security
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcdx authored Apr 27, 2022
2 parents 8c86afd + 1162b02 commit bccdbea
Show file tree
Hide file tree
Showing 288 changed files with 7,743 additions and 2,294 deletions.
71 changes: 43 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
version: 2.1
orbs:
go: gotest/[email protected]
aws-cli: circleci/[email protected]

executors:
golang:
docker:
- image: circleci/golang:1.16.4
- image: cimg/go:1.17.9
resource_class: 2xlarge
ubuntu:
docker:
Expand All @@ -25,8 +24,9 @@ executors:
commands:
install-deps:
steps:
- go/install-ssh
- go/install: {package: git}
- run: |
sudo apt update
sudo apt install python-is-python3
prepare:
parameters:
linux:
Expand Down Expand Up @@ -67,14 +67,14 @@ commands:
- run: |
apt update
apt install -y wget
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512
if [ "$(sha512sum go-ipfs_v0.4.22_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512)" ]
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512
if [ "$(sha512sum go-ipfs_v0.12.2_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512)" ]
then
echo "ipfs failed checksum check"
exit 1
fi
tar -xf go-ipfs_v0.4.22_linux-amd64.tar.gz
tar -xf go-ipfs_v0.12.2_linux-amd64.tar.gz
mv go-ipfs/ipfs /usr/local/bin/ipfs
chmod +x /usr/local/bin/ipfs
git_fetch_all_tags:
Expand Down Expand Up @@ -110,8 +110,12 @@ jobs:
steps:
- install-deps
- prepare
- go/mod-tidy-check

- run: go mod tidy -v
- run:
name: Check git diff
command: |
git --no-pager diff go.mod go.sum
git --no-pager diff --quiet go.mod go.sum
build-all:
executor: golang
steps:
Expand Down Expand Up @@ -188,9 +192,6 @@ jobs:
command: make deps lotus
no_output_timeout: 30m
- download-params
- go/install-gotestsum:
gobin: $HOME/.local/bin
version: 0.5.2
- run:
name: go test
environment:
Expand All @@ -215,8 +216,6 @@ jobs:
- when:
condition: << parameters.codecov-upload >>
steps:
- go/install: {package: bash}
- go/install: {package: curl}
- run:
shell: /bin/bash -eo pipefail
command: |
Expand Down Expand Up @@ -255,9 +254,6 @@ jobs:
cd extern/test-vectors
git fetch
git checkout origin/<< parameters.vectors-branch >>
- go/install-gotestsum:
gobin: $HOME/.local/bin
version: 0.5.2
- run:
name: install statediff globally
command: |
Expand Down Expand Up @@ -370,8 +366,8 @@ jobs:
- run:
name: Install go
command: |
curl -O https://dl.google.com/go/go1.16.4.darwin-amd64.pkg && \
sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
curl -O https://dl.google.com/go/go1.17.9.darwin-amd64.pkg && \
sudo installer -pkg go1.17.9.darwin-amd64.pkg -target /
- run:
name: Install pkg-config
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
Expand Down Expand Up @@ -512,9 +508,6 @@ jobs:
executor:
type: executor
default: golang
golangci-lint-version:
type: string
default: 1.27.0
concurrency:
type: string
default: '2'
Expand All @@ -533,13 +526,10 @@ jobs:
- run:
command: make deps
no_output_timeout: 30m
- go/install-golangci-lint:
gobin: $HOME/.local/bin
version: << parameters.golangci-lint-version >>
- run:
name: Lint
command: |
$HOME/.local/bin/golangci-lint run -v --timeout 2m \
golangci-lint run -v --timeout 2m \
--concurrency << parameters.concurrency >> << parameters.args >>
lint-all:
<<: *lint
Expand Down Expand Up @@ -874,6 +864,11 @@ workflows:
suite: itest-get_messages_in_ts
target: "./itests/get_messages_in_ts_test.go"

- test:
name: test-itest-lookup_robust_address
suite: itest-lookup_robust_address
target: "./itests/lookup_robust_address_test.go"

- test:
name: test-itest-mempool
suite: itest-mempool
Expand Down Expand Up @@ -909,6 +904,11 @@ workflows:
suite: itest-sector_finalize_early
target: "./itests/sector_finalize_early_test.go"

- test:
name: test-itest-sector_make_cc_avail
suite: itest-sector_make_cc_avail
target: "./itests/sector_make_cc_avail_test.go"

- test:
name: test-itest-sector_miner_collateral
suite: itest-sector_miner_collateral
Expand All @@ -919,6 +919,16 @@ workflows:
suite: itest-sector_pledge
target: "./itests/sector_pledge_test.go"

- test:
name: test-itest-sector_prefer_no_upgrade
suite: itest-sector_prefer_no_upgrade
target: "./itests/sector_prefer_no_upgrade_test.go"

- test:
name: test-itest-sector_revert_available
suite: itest-sector_revert_available
target: "./itests/sector_revert_available_test.go"

- test:
name: test-itest-sector_terminate
suite: itest-sector_terminate
Expand Down Expand Up @@ -949,6 +959,11 @@ workflows:
suite: itest-wdpost
target: "./itests/wdpost_test.go"

- test:
name: test-itest-worker
suite: itest-worker
target: "./itests/worker_test.go"

- test:
name: test-unit-cli
suite: utest-unit-cli
Expand Down Expand Up @@ -1087,4 +1102,4 @@ workflows:
only:
- master
jobs:
- publish-packer-snap
- publish-packer-snap
46 changes: 18 additions & 28 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
version: 2.1
orbs:
go: gotest/[email protected]
aws-cli: circleci/[email protected]

executors:
golang:
docker:
- image: circleci/golang:1.16.4
- image: cimg/go:1.17.9
resource_class: 2xlarge
ubuntu:
docker:
Expand All @@ -25,8 +24,9 @@ executors:
commands:
install-deps:
steps:
- go/install-ssh
- go/install: {package: git}
- run: |
sudo apt update
sudo apt install python-is-python3
prepare:
parameters:
linux:
Expand Down Expand Up @@ -67,14 +67,14 @@ commands:
- run: |
apt update
apt install -y wget
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512
if [ "$(sha512sum go-ipfs_v0.4.22_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512)" ]
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512
if [ "$(sha512sum go-ipfs_v0.12.2_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512)" ]
then
echo "ipfs failed checksum check"
exit 1
fi
tar -xf go-ipfs_v0.4.22_linux-amd64.tar.gz
tar -xf go-ipfs_v0.12.2_linux-amd64.tar.gz
mv go-ipfs/ipfs /usr/local/bin/ipfs
chmod +x /usr/local/bin/ipfs
git_fetch_all_tags:
Expand Down Expand Up @@ -110,8 +110,12 @@ jobs:
steps:
- install-deps
- prepare
- go/mod-tidy-check

- run: go mod tidy -v
- run:
name: Check git diff
command: |
git --no-pager diff go.mod go.sum
git --no-pager diff --quiet go.mod go.sum
build-all:
executor: golang
steps:
Expand Down Expand Up @@ -188,9 +192,6 @@ jobs:
command: make deps lotus
no_output_timeout: 30m
- download-params
- go/install-gotestsum:
gobin: $HOME/.local/bin
version: 0.5.2
- run:
name: go test
environment:
Expand All @@ -215,8 +216,6 @@ jobs:
- when:
condition: << parameters.codecov-upload >>
steps:
- go/install: {package: bash}
- go/install: {package: curl}
- run:
shell: /bin/bash -eo pipefail
command: |
Expand Down Expand Up @@ -255,9 +254,6 @@ jobs:
cd extern/test-vectors
git fetch
git checkout origin/<< parameters.vectors-branch >>
- go/install-gotestsum:
gobin: $HOME/.local/bin
version: 0.5.2
- run:
name: install statediff globally
command: |
Expand Down Expand Up @@ -370,8 +366,8 @@ jobs:
- run:
name: Install go
command: |
curl -O https://dl.google.com/go/go1.16.4.darwin-amd64.pkg && \
sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
curl -O https://dl.google.com/go/go1.17.9.darwin-amd64.pkg && \
sudo installer -pkg go1.17.9.darwin-amd64.pkg -target /
- run:
name: Install pkg-config
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
Expand Down Expand Up @@ -512,9 +508,6 @@ jobs:
executor:
type: executor
default: golang
golangci-lint-version:
type: string
default: 1.27.0
concurrency:
type: string
default: '2'
Expand All @@ -533,13 +526,10 @@ jobs:
- run:
command: make deps
no_output_timeout: 30m
- go/install-golangci-lint:
gobin: $HOME/.local/bin
version: << parameters.golangci-lint-version >>
- run:
name: Lint
command: |
$HOME/.local/bin/golangci-lint run -v --timeout 2m \
golangci-lint run -v --timeout 2m \
--concurrency << parameters.concurrency >> << parameters.args >>
lint-all:
<<: *lint
Expand Down Expand Up @@ -912,4 +902,4 @@ workflows:
only:
- master
jobs:
- publish-packer-snap
- publish-packer-snap
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- uses: actions/setup-go@v1
with:
go-version: '1.16.4'
go-version: '1.17.9'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
7 changes: 5 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ skip-dirs:

issues:
exclude:
- "func name will be used as test\\.Test.* by other packages, and that stutters; consider calling this"
- "by other packages, and that stutters; consider calling this"
- "Potential file inclusion via variable"
- "should have( a package)? comment"
- "Error return value of `logging.SetLogLevel` is not checked"
Expand All @@ -37,6 +37,9 @@ issues:
- "string .* has .* occurrences, make it a constant"
- "a blank import should be only in a main or test package, or have a comment justifying it"
- "package comment should be of the form"
- "Potential hardcoded credentials"
- "Use of weak random number generator"
- "xerrors.* is deprecated"

exclude-use-default: false
exclude-rules:
Expand All @@ -51,7 +54,7 @@ issues:
- path: build/params_.*\.go
linters:
- golint

- path: api/apistruct/struct.go
linters:
- golint
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile.lotus
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16.4 AS builder-deps
FROM golang:1.17.9-buster AS builder-deps
MAINTAINER Lotus Development Team

RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
Expand Down Expand Up @@ -61,8 +61,9 @@ COPY --from=builder /usr/lib/x86_64-linux-gnu/libnuma.so.1 /lib/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libhwloc.so.5 /lib/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /lib/

RUN useradd -r -u 532 -U fc

RUN useradd -r -u 532 -U fc \
&& mkdir -p /etc/OpenCL/vendors \
&& echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd

###
FROM base AS lotus
Expand Down Expand Up @@ -251,4 +252,5 @@ VOLUME /var/lib/lotus-wallet
EXPOSE 1234
EXPOSE 2345
EXPOSE 3456
EXPOSE 1777
EXPOSE 1777

Loading

0 comments on commit bccdbea

Please sign in to comment.