Skip to content

Commit 870251c

Browse files
Update api from election post to winning post and window post (#69)
* 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]>
1 parent 355e5e5 commit 870251c

File tree

20 files changed

+1890
-1336
lines changed

20 files changed

+1890
-1336
lines changed

.circleci/config.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ jobs:
4646
- configure_environment_variables
4747
- prepare
4848
- build_project
49-
- ensure_paramcache_available
5049
- restore_parameter_cache
5150
- obtain_filecoin_parameters
5251
- save_parameter_cache
@@ -278,10 +277,12 @@ commands:
278277
echo 'export PATH="${HOME}/.cargo/bin:${HOME}/.bin:${PATH}"' >> $BASH_ENV
279278
obtain_filecoin_parameters:
280279
steps:
281-
- run:
282-
name: Obtain filecoin groth parameters
283-
command: ./paramcache --params-for-sector-sizes='2048'
284-
no_output_timeout: 60m
280+
- run: |
281+
DIR=$(pwd)
282+
cd $(mktemp -d)
283+
GOPATH=/tmp GO111MODULE=off go get github.com/filecoin-project/go-paramfetch/paramfetch
284+
GOPATH=/tmp GO111MODULE=off go build -o go-paramfetch github.com/filecoin-project/go-paramfetch/paramfetch
285+
./go-paramfetch 2048 "${DIR}/parameters.json"
285286
build_project:
286287
steps:
287288
- run:
@@ -290,15 +291,6 @@ commands:
290291
- run:
291292
name: Build project without CGO
292293
command: env CGO_ENABLED=0 go build .
293-
ensure_paramcache_available:
294-
steps:
295-
- run:
296-
name: Ensure paramcache is installed to project root
297-
command: |
298-
test -f ./paramcache \
299-
|| (rustup run --install nightly cargo install filecoin-proofs --force --git=https://github.com/filecoin-project/rust-fil-proofs.git --rev=4e1ef67224eb29dc8a19a4bc31ff7b0d4c7b717f --bin=paramcache --root=./ \
300-
&& mv ./bin/paramcache ./paramcache)
301-
no_output_timeout: 60m
302294
ensure_generated_cgo_up_to_date:
303295
steps:
304296
- run:
@@ -332,10 +324,10 @@ commands:
332324
steps:
333325
- restore_cache:
334326
keys:
335-
- v24a-proof-params-{{ arch }}
327+
- v25a-proof-params-{{ arch }}
336328
save_parameter_cache:
337329
steps:
338330
- save_cache:
339-
key: v24a-proof-params-{{ arch }}
331+
key: v25a-proof-params-{{ arch }}
340332
paths:
341333
- "~/filecoin-proof-parameters/"

cgoleakdetect/runner.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ func (p panicOnFailureTestHelper) AssertEqual(expected, actual interface{}, msgA
3030

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

3636
return true
3737
}
3838

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

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

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

5959
func (p panicOnFailureTestHelper) RequireTrue(value bool, msgAndArgs ...interface{}) {
6060
if !value {
61-
panic(fmt.Sprintf("not true: %+v, %+v, %+v", value, msgAndArgs))
61+
panic(fmt.Sprintf("not true: %+v, %+v", value, msgAndArgs))
6262
}
6363
}

0 commit comments

Comments
 (0)