Skip to content

Commit

Permalink
Update api from election post to winning post and window post (#69)
Browse files Browse the repository at this point in the history
* update api from election post to winning post

* add winning post api

* generate new CGO bindings

* happy clippyg

* cleanup and add test for window post

* windWOW.bizgit add .

* basic adjustments to the go interface

* gofmt

* fix go tests

* fix constants conversions

* upate api

* update to latest version

* regenerate CGO bindings + drop unused struct which referenced non… (#73)

* use latest specs-actors

* generate new CGO bindings

* delete now-dead types

* fix warnings from oddly-formed format string

* drop EligibleSectors field, which wasn't used / didn't exist

* circleci to use go-paramfetch to download (instead of paramcache to generate)

* linter said i had to delete you. sorry, toSectors

* clippy made me do it

* clippy says conversion wasn't necessary

* clippy says reading to end of file is naughty

* disable pesky gomodules for binary build

* so annoying

* write a dumb property test for GenerateWinningPoStSectorChallenge to ensure i'm not crazy

* add failing property test

* copy values from one memory space to the other

Co-authored-by: laser <[email protected]>
  • Loading branch information
dignifiedquire and laser committed Apr 10, 2020
1 parent 355e5e5 commit 870251c
Show file tree
Hide file tree
Showing 20 changed files with 1,890 additions and 1,336 deletions.
24 changes: 8 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
- configure_environment_variables
- prepare
- build_project
- ensure_paramcache_available
- restore_parameter_cache
- obtain_filecoin_parameters
- save_parameter_cache
Expand Down Expand Up @@ -278,10 +277,12 @@ commands:
echo 'export PATH="${HOME}/.cargo/bin:${HOME}/.bin:${PATH}"' >> $BASH_ENV
obtain_filecoin_parameters:
steps:
- run:
name: Obtain filecoin groth parameters
command: ./paramcache --params-for-sector-sizes='2048'
no_output_timeout: 60m
- run: |
DIR=$(pwd)
cd $(mktemp -d)
GOPATH=/tmp GO111MODULE=off go get github.com/filecoin-project/go-paramfetch/paramfetch
GOPATH=/tmp GO111MODULE=off go build -o go-paramfetch github.com/filecoin-project/go-paramfetch/paramfetch
./go-paramfetch 2048 "${DIR}/parameters.json"
build_project:
steps:
- run:
Expand All @@ -290,15 +291,6 @@ commands:
- run:
name: Build project without CGO
command: env CGO_ENABLED=0 go build .
ensure_paramcache_available:
steps:
- run:
name: Ensure paramcache is installed to project root
command: |
test -f ./paramcache \
|| (rustup run --install nightly cargo install filecoin-proofs --force --git=https://github.com/filecoin-project/rust-fil-proofs.git --rev=4e1ef67224eb29dc8a19a4bc31ff7b0d4c7b717f --bin=paramcache --root=./ \
&& mv ./bin/paramcache ./paramcache)
no_output_timeout: 60m
ensure_generated_cgo_up_to_date:
steps:
- run:
Expand Down Expand Up @@ -332,10 +324,10 @@ commands:
steps:
- restore_cache:
keys:
- v24a-proof-params-{{ arch }}
- v25a-proof-params-{{ arch }}
save_parameter_cache:
steps:
- save_cache:
key: v24a-proof-params-{{ arch }}
key: v25a-proof-params-{{ arch }}
paths:
- "~/filecoin-proof-parameters/"
8 changes: 4 additions & 4 deletions cgoleakdetect/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ func (p panicOnFailureTestHelper) AssertEqual(expected, actual interface{}, msgA

func (p panicOnFailureTestHelper) AssertNoError(err error, msgAndArgs ...interface{}) bool {
if err != nil {
panic(fmt.Sprintf("there was an error: %+v, %+v, %+v", err, msgAndArgs))
panic(fmt.Sprintf("there was an error: %+v, %+v", err, msgAndArgs))
}

return true
}

func (p panicOnFailureTestHelper) AssertTrue(value bool, msgAndArgs ...interface{}) bool {
if !value {
panic(fmt.Sprintf("not true: %+v, %+v, %+v", value, msgAndArgs))
panic(fmt.Sprintf("not true: %+v, %+v", value, msgAndArgs))
}

return true
Expand All @@ -52,12 +52,12 @@ func (p panicOnFailureTestHelper) RequireEqual(expected interface{}, actual inte

func (p panicOnFailureTestHelper) RequireNoError(err error, msgAndArgs ...interface{}) {
if err != nil {
panic(fmt.Sprintf("there was an error: %+v, %+v, %+v", err, msgAndArgs))
panic(fmt.Sprintf("there was an error: %+v, %+v", err, msgAndArgs))
}
}

func (p panicOnFailureTestHelper) RequireTrue(value bool, msgAndArgs ...interface{}) {
if !value {
panic(fmt.Sprintf("not true: %+v, %+v, %+v", value, msgAndArgs))
panic(fmt.Sprintf("not true: %+v, %+v", value, msgAndArgs))
}
}
Loading

0 comments on commit 870251c

Please sign in to comment.