Skip to content

Commit

Permalink
Remove unused code (#4732)
Browse files Browse the repository at this point in the history
* remove fixtures/proof-params/parameters.json

* remove unused api code

* remove pkg/types
  • Loading branch information
simlecode authored Jan 20, 2022
1 parent 6aa06db commit 8f0a0cf
Show file tree
Hide file tree
Showing 244 changed files with 25 additions and 33,065 deletions.
19 changes: 0 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ jobs:
fingerprints:
- "1e:73:c5:15:75:e0:e4:98:54:3c:2b:9e:e8:94:14:2e"
- checkout
- clone_lotus
- update_submodules
# Save the Git SHA of the rust-fil-proofs submodule so that we can use it when creating a cache key
- generate_rust_submodules_checksums
Expand All @@ -200,9 +199,6 @@ jobs:
cmd: "lint"
- go_build:
cmd: "build"
#- go_build:
# cmd: "gen-api"
#- check_file_change
# place the filecoin binary in PATH for IPTB
- go_build:
cmd: "install"
Expand Down Expand Up @@ -753,21 +749,6 @@ commands:
name: fetch all tags
command: |
git fetch --all
clone_lotus:
steps:
- run:
name: Clone lotus
command: |
mkdir -p ${GOPATH}/pkg/mod/github.com/filecoin-project
cd ${GOPATH}/pkg/mod/github.com/filecoin-project
git clone -b v1.12.0 https://github.com/filecoin-project/lotus.git
check_file_change:
steps:
- run:
name: Check api file change
command: |
cd /go/src/github.com/filecoin-project/venus
bash ./scripts/check_api_file_change.sh
go_build:
parameters:
cmd:
Expand Down
9 changes: 4 additions & 5 deletions CODEWALK.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Other patterns, we've evolving for our needs:
- go-ipfs relies heavily on shell-based integration testing; we aim to rely heavily on unit testing and Go-based integration tests.
- The go-ipfs package structure involves a deep hierarchy of dependent implementations;
we're moving towards a more Go-idiomatic approach with narrow interfaces defined in consuming packages (see [Patterns](#patterns).
- The term "block" is heavily overloaded: a blockchain block ([`types/block.go`](https://github.com/filecoin-project/venus/tree/master/pkg/types/block.go)),
but also content-id-addressed blocks in the block service.
- The term "block" is heavily overloaded: a blockchain block ([`types/block.go`](https://github.com/filecoin-project/venus/tree/master/venus-shared/types/block_header.go)),
but also content-id-addressed blocks in the block service.
Blockchain blocks are stored in block service blocks, but are not the same thing.

## Architecture overview
Expand Down Expand Up @@ -178,7 +178,7 @@ It is expected that other implementations will match the behaviour of the Go act
An ABI describes how inputs and outputs to the VM are encoded.
Future work will replace this implementation with a "real" VM.

The [Actor](https://github.com/filecoin-project/venus/blob/master/pkg/types/actor.go) struct is the base implementation of actors, with fields common to all of them.
The [Actor](https://github.com/filecoin-project/venus/blob/master/venus-shared/internal/actor.go) struct is the base implementation of actors, with fields common to all of them.

- `Code` is a CID identifying the actor code, but since these actors are implemented in Go, is actually some fixed bytes acting as an identifier.
This identifier selects the kind of actor implementation when a message is sent to its address.
Expand Down Expand Up @@ -252,7 +252,7 @@ If a miner is elected, they have the right to mine a block in that round.

Given the probabilistic nature of mining new blocks, more than one block may be mined in any given round.
Hence, a new block might have more than one parent block.
The parents form a set, which we call a [tipset](https://github.com/filecoin-project/venus/blob/master/pkg/types/tipset.go).
The parents form a set, which we call a [tipset](https://github.com/filecoin-project/venus/blob/master/venus-shared/types/tipset.go).
All the blocks in a tipset are at the same height and share the same parents.
Tipsets contain one or more blocks.
A null block count indicates the absence of any blocks mined in a previous round.
Expand Down Expand Up @@ -374,7 +374,6 @@ The `functional-tests` directory contains some Go and Bash scripts which perform
These are not daemon tests, but run separately.

Some packages have a `testing.go` file with helpers for setting up tests involving that package’s types.
The [`types/testing.go`](https://github.com/filecoin-project/venus/blob/master/pkg/types/testing.go) file has some more generally useful constructors.
There is also a top-level [`testhelpers`](https://github.com/filecoin-project/venus/blob/master/pkg/testhelpers) package with higher level helpers, often used by daemon tests.

We’re in process of creating the venus Automation and Systems Toolkit (FAST) [library](https://github.com/filecoin-project/venus/tree/master/tools/fast).
Expand Down
30 changes: 11 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,6 @@ clean:
rm -rf ./extern/filecoin-ffi
rm -rf ./extern/test-vectors

gen-api:
go run ./tools/gen/api/proxygen.go
gofmt -s -l -w ./app/client/full.go
gofmt -s -l -w ./app/client/v0api/full.go

v2-gen-api:
cd ./venus-devtool/ && go run ./api-gen/
gofmt -s -l -w ./venus-shared/api/chain/v0/proxy_gen.go;
gofmt -s -l -w ./venus-shared/api/chain/v1/proxy_gen.go

v0APIDoc = ../venus-shared/api/v0-api-document.md
v1APIDoc = ../venus-shared/api/v1-api-document.md
api-docs:
cd ./venus-devtool/ && go run ./api-docs-gen/cmd ../venus-shared/api/chain/v0/fullnode.go FullNode v0 ../venus-shared/api/chain/v0 $(v0APIDoc)
cd ./venus-devtool/ && go run ./api-docs-gen/cmd ../venus-shared/api/chain/v1/fullnode.go FullNode v1 ../venus-shared/api/chain/v1 $(v1APIDoc)

compare-api:
go run ./tools/gen/api/proxygen.go compare

gen-asset:
go-bindata -pkg=asset -o ./fixtures/asset/asset.go ./fixtures/_assets/car/ ./fixtures/_assets/proof-params/ ./fixtures/_assets/arch-diagram.monopic
gofmt -s -l -w ./fixtures/asset/asset.go
Expand All @@ -64,6 +45,17 @@ inline-gen:
test-venus-shared:
cd venus-shared && go test -covermode=set ./...

gen-api:
cd ./venus-devtool/ && go run ./api-gen/
gofmt -s -l -w ./venus-shared/api/chain/v0/proxy_gen.go;
gofmt -s -l -w ./venus-shared/api/chain/v1/proxy_gen.go

v0APIDoc = ../venus-shared/api/v0-api-document.md
v1APIDoc = ../venus-shared/api/v1-api-document.md
api-docs:
cd ./venus-devtool/ && go run ./api-docs-gen/cmd ../venus-shared/api/chain/v0/fullnode.go FullNode v0 ../venus-shared/api/chain/v0 $(v0APIDoc)
cd ./venus-devtool/ && go run ./api-docs-gen/cmd ../venus-shared/api/chain/v1/fullnode.go FullNode v1 ../venus-shared/api/chain/v1 $(v1APIDoc)

compatible-all: compatible-api compatible-actor

compatible-api: api-checksum api-diff
Expand Down
20 changes: 0 additions & 20 deletions app/client/apiface/blockservice.go

This file was deleted.

20 changes: 0 additions & 20 deletions app/client/apiface/blockstore.go

This file was deleted.

213 changes: 0 additions & 213 deletions app/client/apiface/chain.go

This file was deleted.

10 changes: 0 additions & 10 deletions app/client/apiface/config.go

This file was deleted.

4 changes: 0 additions & 4 deletions app/client/apiface/discovery.go

This file was deleted.

Loading

0 comments on commit 8f0a0cf

Please sign in to comment.