Merge pull request #1368 from filecoin-project/feat/build-cleanup

build: Remove unused vars, fix debug build
This commit is contained in:
Whyrusleeping 2020-03-09 11:03:27 -07:00 committed by GitHub
commit 70552e3e0d
7 changed files with 26 additions and 45 deletions

View File

@ -107,6 +107,18 @@ jobs:
paths:
- linux
build-debug:
executor: golang
steps:
- install-deps
- prepare
- go/mod-download
- restore_cache:
name: restore go mod cache
key: v1-go-deps-{{ arch }}-{{ checksum "/home/circleci/project/go.mod" }}
- run:
command: make debug
test: &test
description: |
Run tests with gotestsum.
@ -242,6 +254,15 @@ jobs:
- "~/.rustup"
- "~/.cargo"
gofmt:
executor: golang
steps:
- install-deps
- prepare
- go/mod-download
- run:
command: "! go fmt ./... 2>&1 | read"
lint: &lint
description: |
Run golangci-lint.
@ -315,12 +336,14 @@ workflows:
- test:
codecov-upload: true
- mod-tidy-check
- gofmt
- test-short:
go-test-flags: "--timeout 10m --short"
filters:
tags:
only:
- /^v\d+\.\d+\.\d+$/
- build-debug
- build-all:
requires:
- test-short

View File

@ -17,11 +17,6 @@ const BlockDelay = 6
const PropagationDelay = 3
// FallbackPoStDelay is the number of epochs the miner needs to wait after
// ElectionPeriodStart before starting fallback post computation
//
// Epochs
const FallbackPoStDelay = 10
// SlashablePowerDelay is the number of epochs after ElectionPeriodStart, after
// which the miner is slashed
@ -29,11 +24,5 @@ const FallbackPoStDelay = 10
// Epochs
const SlashablePowerDelay = 20
// Epochs
const InteractivePoRepDelay = 2
// Epochs
const InteractivePoRepConfidence = 6
// Bytes
var MinimumMinerPower uint64 = 2 << 10 // 2KiB

View File

@ -2,8 +2,6 @@ package build
import (
"math/big"
"github.com/filecoin-project/specs-actors/actors/abi"
)
// Core network constants
@ -19,15 +17,6 @@ const DhtProtocolName = "/fil/kad/" + NetworkName
const UnixfsChunkSize uint64 = 1 << 20
const UnixfsLinksPerLevel = 1024
func SupportedSectorSize(ssize abi.SectorSize) bool {
for _, ss := range SectorSizes {
if ssize == ss {
return true
}
}
return false
}
const SectorChallengeRatioDiv = 25
// /////
@ -59,6 +48,9 @@ const WRatioDen = 2
// /////
// Proofs
// Epochs
const FallbackPoStConfidence = 6
// Epochs
const SealRandomnessLookback = Finality
@ -74,10 +66,6 @@ const MaxSealLookback = SealRandomnessLookbackLimit + 2000
// Epochs
const EcRandomnessLookback = 300
const PowerCollateralProportion = 5
const PerCapitaCollateralProportion = 1
const CollateralPrecision = 1000
// /////
// Devnet settings
@ -106,4 +94,3 @@ const BlsSignatureCacheSize = 40000
// Limits
const BlockMessageLimit = 512
const MinerMaxSectors = 1 << 48

View File

@ -17,9 +17,6 @@ const BlockDelay = 25
const PropagationDelay = 6
// Epochs
const FallbackPoStConfidence = 6
// SlashablePowerDelay is the number of epochs after ElectionPeriodStart, after
// which the miner is slashed
//

View File

@ -206,7 +206,6 @@ var initCmd = &cli.Command{
})
}
if err := lr.SetStorage(sc); err != nil {
return xerrors.Errorf("set storage config: %w", err)
}

View File

@ -53,15 +53,7 @@ func init() {
return xerrors.Errorf("StateMinerWorker: %w", err)
}
<<<<<<< HEAD
rand, err := api.ChainGetRandomness(ctx, head.Key(), crypto.DomainSeparationTag_TicketProduction, head.Height(), addr.Bytes())
=======
if ret.MsgRct.ExitCode != 0 {
return xerrors.Errorf("failed to get miner worker addr (exit code %d)", ret.MsgRct.ExitCode)
}
w, err := address.NewFromBytes(ret.MsgRct.Return)
>>>>>>> master
if err != nil {
return xerrors.Errorf("failed to get randomness: %w", err)
}

6
go.sum
View File

@ -107,8 +107,6 @@ github.com/filecoin-project/go-address v0.0.2-0.20200218010043-eb9bb40ed5be h1:T
github.com/filecoin-project/go-address v0.0.2-0.20200218010043-eb9bb40ed5be/go.mod h1:SAOwJoakQ8EPjwNIsiakIQKsoKdkcbx8U3IapgCg9R0=
github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200131012142-05d80eeccc5e h1:IOoff6yAZSJ5zHCPY2jzGNwQYQU6ygsRVe/cSnJrY+o=
github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200131012142-05d80eeccc5e/go.mod h1:boRtQhzmxNocrMxOXo1NYn4oUc1NGvR8tEa79wApNXg=
github.com/filecoin-project/go-bitfield v0.0.0-20200303181214-d40acc5ca3bf h1:aPOUgEkB2WaRirTPGBBl/OptnLm9ZYYiuinBgZS7ZJ4=
github.com/filecoin-project/go-bitfield v0.0.0-20200303181214-d40acc5ca3bf/go.mod h1:iodsLxOFZnqKtjj2zkgqzoGNrv6vUqj69AT/J8DKXEw=
github.com/filecoin-project/go-bitfield v0.0.0-20200309034705-8c7ac40bd550 h1:aockulLU8Qjkdj4FQz53WQpNosAIYk8DxRediRLkE5c=
github.com/filecoin-project/go-bitfield v0.0.0-20200309034705-8c7ac40bd550/go.mod h1:iodsLxOFZnqKtjj2zkgqzoGNrv6vUqj69AT/J8DKXEw=
github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 h1:av5fw6wmm58FYMgJeoB/lK9XXrgdugYiTqkdxjTy9k8=
@ -137,10 +135,6 @@ github.com/filecoin-project/specs-actors v0.0.0-20200226200336-94c9b92b2775/go.m
github.com/filecoin-project/specs-actors v0.0.0-20200302223606-0eaf97b10aaf/go.mod h1:0HAWYrvajFHDgRaKbF0rl+IybVLZL5z4gQ8koCMPhoU=
github.com/filecoin-project/specs-actors v0.0.0-20200305205312-53bb01da9aeb h1:9Ch6f/LYCh/BoriHfSp8sRX0OaO+9gQVK6x0vGl9o0s=
github.com/filecoin-project/specs-actors v0.0.0-20200305205312-53bb01da9aeb/go.mod h1:0HAWYrvajFHDgRaKbF0rl+IybVLZL5z4gQ8koCMPhoU=
github.com/filecoin-project/specs-actors v0.0.0-20200306043603-709a3ce21094 h1:iHTwtiM9/gGU1WL1GfDAY04dJcojSg8BK4TOaIqHVYQ=
github.com/filecoin-project/specs-actors v0.0.0-20200306043603-709a3ce21094/go.mod h1:0HAWYrvajFHDgRaKbF0rl+IybVLZL5z4gQ8koCMPhoU=
github.com/filecoin-project/specs-actors v0.0.0-20200309030613-1abadc4281f0 h1:DDnned7g8FvSG0eKWqbE0+E7VkaM6MmbG8wPiUmNCAY=
github.com/filecoin-project/specs-actors v0.0.0-20200309030613-1abadc4281f0/go.mod h1:WfdImbdSfZ9pWOX0ZUhmGRNvb2LpAPCUsCYAqYkkHlo=
github.com/filecoin-project/specs-actors v0.0.0-20200309035311-2490172c2e9f h1:dnF2E9U1JI2cb7oABDdgtfIfzvTyMyrbbTr7UUtqRKU=
github.com/filecoin-project/specs-actors v0.0.0-20200309035311-2490172c2e9f/go.mod h1:5WngRgTN5Eo4+0SjCBqLzEr2l6Mj45DrP2606gBhqI0=
github.com/filecoin-project/specs-storage v0.0.0-20200303233430-1a5a408f7513 h1:okBx3lPomwDxlPmRvyP078BwivDfdxNUlpCDhDD0ia8=