Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial boost / fvm contract deals support #1183

Merged
merged 50 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
82b4238
fix docker builds to do `make hyperspacenet` for lotus
nonsense Feb 2, 2023
477e663
fixup
nonsense Feb 2, 2023
9e825cd
fixup
nonsense Feb 2, 2023
07ed679
fix env
nonsense Feb 2, 2023
d20d87e
remove lotus-test for now as it is mostly broken
nonsense Feb 2, 2023
0dc421a
fixup
nonsense Feb 2, 2023
5b830ef
fixup
nonsense Feb 2, 2023
046152f
fixup
nonsense Feb 2, 2023
d0c42d0
use same commit as lotus
nonsense Feb 2, 2023
303678e
bump filecoin-ffi
nonsense Feb 2, 2023
f8017b0
fixup
nonsense Feb 2, 2023
7831768
upgrade lotus
nonsense Feb 3, 2023
938c32e
fix SealerConfig
nonsense Feb 3, 2023
2149396
use nil SendSpec
nonsense Feb 3, 2023
6a26bb1
fix paths.StorageConfig
nonsense Feb 3, 2023
373fb09
add node start time
nonsense Feb 3, 2023
95a83db
env vars
nonsense Feb 6, 2023
a76f9ad
rename ExecuteDeal to ExecuteLibp2pDeal
nonsense Feb 8, 2023
274bdc8
rename HandleBoostDeals
nonsense Feb 8, 2023
aa2df33
refactor: move deal accept / reject logging to be part of deal execut…
dirkmc Feb 10, 2023
5b365a3
eth abi package
nonsense Feb 10, 2023
bb67bd9
fix conflicts
nonsense Feb 10, 2023
9707366
fixup
nonsense Feb 10, 2023
b4b21bb
feat: skip signature validation for f4 (fvm contract) addresses (#1178)
dirkmc Feb 13, 2023
b9c89be
pkg rewrite
nonsense Feb 13, 2023
f891679
feat: highlight f4 addresses in UI (#1179)
dirkmc Feb 13, 2023
276e2d9
feat: verify deal proposal for f4 address (#1181)
dirkmc Feb 14, 2023
4eaa8b9
lint
nonsense Feb 14, 2023
5829d54
subscribe to eth_ API and parse contract deal proposals (#1187)
nonsense Feb 15, 2023
cc373b4
fixup
nonsense Feb 15, 2023
9ea78e8
add garbage sig
nonsense Feb 15, 2023
1451bf8
skip client equality check
nonsense Feb 15, 2023
e756ac2
hack for label
nonsense Feb 15, 2023
a9b5356
re-enable sig verification
nonsense Feb 15, 2023
849dab4
remove eth/abi (#1201)
nonsense Feb 17, 2023
141e328
cleanup
nonsense Feb 17, 2023
dfdf3d5
add configurable contract deal monitor
nonsense Feb 22, 2023
763ae5b
use new event topic
nonsense Feb 22, 2023
6d14e2c
fixup
nonsense Feb 22, 2023
644d6c1
merge main to nonsense/hyperspace
nonsense Feb 22, 2023
8c9381e
check for deal uniqueness
nonsense Feb 22, 2023
d1ee464
add eth sub handler override
nonsense Feb 22, 2023
34937ac
fixup
nonsense Feb 22, 2023
b4f96be
tests fixup
nonsense Feb 22, 2023
0bbc2e7
add enabled config
nonsense Feb 22, 2023
0f4fa4d
run make gen
nonsense Feb 22, 2023
09fbb3b
extract contractdealproposal types
nonsense Feb 22, 2023
5a3f3f5
fix provider addr
nonsense Feb 22, 2023
5d1eeaf
ContractDealParamsV1 ; ExecuteDeal ; refactor parsing of values for s…
nonsense Feb 23, 2023
f52d0eb
revert CheckDealEquality
nonsense Feb 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmd/boostd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
"github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/api/v1api"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/filecoin-project/lotus/gateway"

lcliutil "github.com/filecoin-project/lotus/cli/util"
lotus_repo "github.com/filecoin-project/lotus/node/repo"

"net/http"
Expand Down Expand Up @@ -43,7 +46,8 @@ var runCmd = &cli.Command{
}()
}

fullnodeApi, ncloser, err := lcli.GetFullNodeAPIV1(cctx)
subCh := gateway.NewEthSubHandler()
nonsense marked this conversation as resolved.
Show resolved Hide resolved
fullnodeApi, ncloser, err := lcli.GetFullNodeAPIV1(cctx, lcliutil.FullNodeWithEthSubscribtionHandler(subCh))
if err != nil {
return fmt.Errorf("getting full node api: %w", err)
}
Expand Down Expand Up @@ -93,6 +97,7 @@ var runCmd = &cli.Command{
var boostApi api.Boost
stop, err := node.New(ctx,
node.BoostAPI(&boostApi),
node.Override(new(*gateway.EthSubHandler), subCh),
node.Override(new(dtypes.ShutdownChan), shutdownChan),
node.Base(),
node.Repo(r),
Expand Down
6 changes: 3 additions & 3 deletions docker/devnet/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## docker will invoke this file from ../../.. dir in order to access the code
#########################################################################################
ARG LOTUS_TEST_IMAGE=filecoin/lotus-test:latest
FROM ${LOTUS_TEST_IMAGE} as lotus-dev
FROM ${LOTUS_TEST_IMAGE} as lotus-test
#########################################################################################
FROM node:16.16-alpine3.15 AS react-builder

Expand Down Expand Up @@ -86,8 +86,8 @@ RUN ls -1 /lib/*/libhwloc.so.* | head -n 1 | xargs -n1 -I {} ln -s {} /lib/libhw

WORKDIR /app

COPY --from=lotus-dev /usr/local/bin/lotus /usr/local/bin/
COPY --from=lotus-dev /usr/local/bin/lotus-miner /usr/local/bin/
COPY --from=lotus-test /usr/local/bin/lotus /usr/local/bin/
COPY --from=lotus-test /usr/local/bin/lotus-miner /usr/local/bin/
## Test lotus starts
RUN lotus -v && lotus-miner -v
#########################################################################################
Expand Down
19 changes: 0 additions & 19 deletions docker/devnet/booster-bitswap/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions docker/devnet/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
- "1234:1234"
- "9090:9090"
environment:
- LOTUS_FEVM_ENABLEETHRPC=true
- LOTUS_API_LISTENADDRESS=/dns/lotus/tcp/1234/http
- LOTUS_LIBP2P_LISTENADDRESSES=/ip4/0.0.0.0/tcp/9090
restart: unless-stopped
Expand Down
1 change: 1 addition & 0 deletions docker/devnet/lotus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ EXPOSE 9090
ENV LOTUS_SKIP_GENESIS_CHECK=_yes_
ENV GENESIS_PATH=/var/lib/genesis
ENV SECTOR_SIZE=8388608
ENV LOTUS_FEVM_ENABLEETHRPC=true

VOLUME /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/genesis
Expand Down
34 changes: 17 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ require (
github.com/golang/mock v1.6.0
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0
github.com/graph-gophers/graphql-go v1.2.0
github.com/graph-gophers/graphql-go v1.3.0
github.com/graph-gophers/graphql-transport-ws v0.0.2
github.com/hashicorp/go-multierror v1.1.1
github.com/hnlq715/golang-lru v0.3.0
Expand Down Expand Up @@ -106,6 +106,7 @@ require (
go.uber.org/atomic v1.10.0
go.uber.org/fx v1.15.0
go.uber.org/multierr v1.8.0
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b
golang.org/x/sync v0.0.0-20220907140024-f12130a52804
golang.org/x/text v0.3.7
Expand All @@ -127,8 +128,10 @@ require (
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/akavel/rsrc v0.8.0 // indirect
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a // indirect
github.com/armon/go-metrics v0.3.9 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bep/debounce v1.2.1 // indirect
github.com/boltdb/bolt v1.3.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cilium/ebpf v0.7.0 // indirect
Expand All @@ -147,6 +150,7 @@ require (
github.com/drand/drand v1.3.0 // indirect
github.com/drand/kyber v1.1.7 // indirect
github.com/drand/kyber-bls12381 v0.2.1 // indirect
github.com/elastic/go-elasticsearch/v7 v7.14.0 // indirect
github.com/elastic/go-sysinfo v1.7.0 // indirect
github.com/elastic/go-windows v1.0.0 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
Expand Down Expand Up @@ -199,7 +203,12 @@ require (
github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1 // indirect
github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/go-hclog v0.16.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/raft v1.1.1 // indirect
github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/iancoleman/orderedmap v0.1.0 // indirect
github.com/icza/backscanner v0.0.0-20210726202459-ac2ffc679f94 // indirect
Expand Down Expand Up @@ -243,10 +252,13 @@ require (
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect
github.com/libp2p/go-libp2p-connmgr v0.4.0 // indirect
github.com/libp2p/go-libp2p-consensus v0.0.1 // indirect
github.com/libp2p/go-libp2p-core v0.20.1 // indirect
github.com/libp2p/go-libp2p-gorpc v0.4.0 // indirect
github.com/libp2p/go-libp2p-kbucket v0.5.0 // indirect
github.com/libp2p/go-libp2p-noise v0.5.0 // indirect
github.com/libp2p/go-libp2p-peerstore v0.8.0 // indirect
github.com/libp2p/go-libp2p-raft v0.1.8 // indirect
github.com/libp2p/go-libp2p-routing-helpers v0.2.3 // indirect
github.com/libp2p/go-libp2p-tls v0.5.0 // indirect
github.com/libp2p/go-maddr-filter v0.1.0 // indirect
Expand Down Expand Up @@ -304,7 +316,10 @@ require (
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect
github.com/twmb/murmur3 v1.1.6 // indirect
github.com/ugorji/go/codec v1.2.6 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.0.1 // indirect
github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba // indirect
Expand All @@ -320,7 +335,6 @@ require (
go.uber.org/dig v1.12.0 // indirect
go.uber.org/zap v1.23.0 // indirect
go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220920183852-bf014ff85ad5 // indirect
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
Expand All @@ -343,22 +357,8 @@ require (

require (
github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5 // indirect
github.com/armon/go-metrics v0.3.9 // indirect
github.com/boltdb/bolt v1.3.1 // indirect
github.com/elastic/go-elasticsearch/v7 v7.14.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/hashicorp/go-hclog v0.16.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/raft v1.1.1 // indirect
github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea // indirect
github.com/ipfs/go-block-format v0.1.1 // indirect
github.com/libp2p/go-libp2p-consensus v0.0.1 // indirect
github.com/libp2p/go-libp2p-gorpc v0.4.0 // indirect
github.com/libp2p/go-libp2p-raft v0.1.8 // indirect
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect
github.com/ugorji/go/codec v1.2.6 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
)
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/graph-gophers/graphql-go v1.2.0 h1:j3tCG0UcE+3f84OAw/4/6YQKyTr+r0yuUKtnxiu5OH4=
github.com/graph-gophers/graphql-go v1.2.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc=
github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0=
github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc=
github.com/graph-gophers/graphql-transport-ws v0.0.2 h1:DbmSkbIGzj8SvHei6n8Mh9eLQin8PtA8xY9eCzjRpvo=
github.com/graph-gophers/graphql-transport-ws v0.0.2/go.mod h1:5BVKvFzOd2BalVIBFfnfmHjpJi/MZ5rOj8G55mXvZ8g=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
Expand Down Expand Up @@ -686,8 +686,9 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
Expand Down
2 changes: 2 additions & 0 deletions itests/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors"
chaintypes "github.com/filecoin-project/lotus/chain/types"
ltypes "github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/gateway"
"github.com/filecoin-project/lotus/itests/kit"
lnode "github.com/filecoin-project/lotus/node"
lotus_config "github.com/filecoin-project/lotus/node/config"
Expand Down Expand Up @@ -314,6 +315,7 @@ func (f *TestFramework) Start() error {
node.Base(),
node.Repo(r),
node.Override(new(v1api.FullNode), fullnodeApi),
node.Override(new(*gateway.EthSubHandler), fullnodeApi.EthSubRouter),

node.Override(new(*ctladdr.AddressSelector), modules.AddressSelector(&lotus_config.MinerAddressConfig{
DealPublishControl: []string{
Expand Down
4 changes: 3 additions & 1 deletion node/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ const (

// boost should be started after legacy markets (HandleDealsKey)
HandleBoostDealsKey
HandleContractDealsKey
HandleProposalLogCleanerKey

// daemon
Expand Down Expand Up @@ -552,7 +553,8 @@ func ConfigBoost(cfg *config.Boost) Option {
Override(new(lotus_storagemarket.StorageProviderNode), lotus_storageadapter.NewProviderNodeAdapter(&legacyFees, &cfg.LotusDealmaking)),
Override(new(lotus_storagemarket.StorageProvider), modules.NewLegacyStorageProvider(cfg)),
Override(HandleDealsKey, modules.HandleLegacyDeals),
Override(HandleBoostDealsKey, modules.HandleBoostDeals),
Override(HandleBoostDealsKey, modules.HandleBoostLibp2pDeals),
Override(HandleContractDealsKey, modules.HandleContractDeals(&cfg.ContractDeals)),
Override(HandleProposalLogCleanerKey, modules.HandleProposalLogCleaner(time.Duration(cfg.Dealmaking.DealProposalLogDuration))),

// Boost storage deal filter
Expand Down
26 changes: 26 additions & 0 deletions node/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type Boost struct {
Wallets WalletsConfig
Graphql GraphqlConfig
Tracing TracingConfig
ContractDeals ContractDealsConfig

// Lotus configs
LotusDealmaking lotus_config.DealmakingConfig
Expand Down Expand Up @@ -247,6 +248,17 @@ type DealmakingConfig struct {
DealLogDurationDays int
}

type ContractDealsConfig struct {
// Whether to enable chain monitoring in order to accept contract deals
Enabled bool

// Allowlist for contracts that this SP should accept deals from
AllowlistContracts []string

// From address for eth_ state call
From string
}

type FeeConfig struct {
// The maximum fee to pay when sending the PublishStorageDeals message
MaxPublishDealsFee types.FIL
Expand Down
4 changes: 3 additions & 1 deletion node/impl/boost.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
lotus_storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-jsonrpc/auth"
lapi "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/gateway"
mktsdagstore "github.com/filecoin-project/lotus/markets/dagstore"
lotus_dtypes "github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/storage/sectorblocks"
Expand All @@ -46,7 +47,8 @@ type BoostAPI struct {
api.Common
api.Net

Full lapi.FullNode
Full lapi.FullNode
SubCh *gateway.EthSubHandler

Host host.Host

Expand Down
Loading