diff --git a/api/api_gateway.go b/api/api_gateway.go index 29cd8ce24..862c6ddb5 100644 --- a/api/api_gateway.go +++ b/api/api_gateway.go @@ -33,6 +33,7 @@ type Gateway interface { ChainHead(ctx context.Context) (*types.TipSet, error) ChainGetBlockMessages(context.Context, cid.Cid) (*BlockMessages, error) ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error) + ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*HeadChange, error) ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) ChainGetTipSetAfterHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) diff --git a/api/proxy_gen.go b/api/proxy_gen.go index f2dc7c560..c03b83531 100644 --- a/api/proxy_gen.go +++ b/api/proxy_gen.go @@ -480,6 +480,8 @@ type GatewayStruct struct { ChainGetMessage func(p0 context.Context, p1 cid.Cid) (*types.Message, error) `` + ChainGetPath func(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*HeadChange, error) `` + ChainGetTipSet func(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) `` ChainGetTipSetAfterHeight func(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) `` @@ -3039,6 +3041,17 @@ func (s *GatewayStub) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Me return nil, ErrNotSupported } +func (s *GatewayStruct) ChainGetPath(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*HeadChange, error) { + if s.Internal.ChainGetPath == nil { + return *new([]*HeadChange), ErrNotSupported + } + return s.Internal.ChainGetPath(p0, p1, p2) +} + +func (s *GatewayStub) ChainGetPath(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*HeadChange, error) { + return *new([]*HeadChange), ErrNotSupported +} + func (s *GatewayStruct) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) { if s.Internal.ChainGetTipSet == nil { return nil, ErrNotSupported diff --git a/build/openrpc/full.json.gz b/build/openrpc/full.json.gz index 4892e0901..610a0591a 100644 Binary files a/build/openrpc/full.json.gz and b/build/openrpc/full.json.gz differ diff --git a/build/openrpc/miner.json.gz b/build/openrpc/miner.json.gz index b119be722..ce3a4562f 100644 Binary files a/build/openrpc/miner.json.gz and b/build/openrpc/miner.json.gz differ diff --git a/build/openrpc/worker.json.gz b/build/openrpc/worker.json.gz index 06d91c92a..84b1b1b1d 100644 Binary files a/build/openrpc/worker.json.gz and b/build/openrpc/worker.json.gz differ diff --git a/build/params_2k.go b/build/params_2k.go index efa38dc0c..479bd3b82 100644 --- a/build/params_2k.go +++ b/build/params_2k.go @@ -1,3 +1,4 @@ +//go:build debug || 2k // +build debug 2k package build diff --git a/build/params_butterfly.go b/build/params_butterfly.go index 4f4cc756d..1477c363a 100644 --- a/build/params_butterfly.go +++ b/build/params_butterfly.go @@ -1,3 +1,4 @@ +//go:build butterflynet // +build butterflynet package build diff --git a/build/params_calibnet.go b/build/params_calibnet.go index df334a516..bafed3015 100644 --- a/build/params_calibnet.go +++ b/build/params_calibnet.go @@ -1,3 +1,4 @@ +//go:build calibnet // +build calibnet package build diff --git a/build/params_debug.go b/build/params_debug.go index f679c9178..e977cda05 100644 --- a/build/params_debug.go +++ b/build/params_debug.go @@ -1,3 +1,4 @@ +//go:build debug // +build debug package build diff --git a/build/params_interop.go b/build/params_interop.go index 921dd0981..0040bb9d0 100644 --- a/build/params_interop.go +++ b/build/params_interop.go @@ -1,3 +1,4 @@ +//go:build interopnet // +build interopnet package build diff --git a/build/params_mainnet.go b/build/params_mainnet.go index 1c9b69462..1e9996082 100644 --- a/build/params_mainnet.go +++ b/build/params_mainnet.go @@ -1,10 +1,5 @@ -// +build !debug -// +build !2k -// +build !testground -// +build !calibnet -// +build !nerpanet -// +build !butterflynet -// +build !interopnet +//go:build !debug && !2k && !testground && !calibnet && !nerpanet && !butterflynet && !interopnet +// +build !debug,!2k,!testground,!calibnet,!nerpanet,!butterflynet,!interopnet package build diff --git a/build/params_nerpanet.go b/build/params_nerpanet.go index 5eef25cb2..b7beb5953 100644 --- a/build/params_nerpanet.go +++ b/build/params_nerpanet.go @@ -1,3 +1,4 @@ +//go:build nerpanet // +build nerpanet package build diff --git a/build/params_shared_vals.go b/build/params_shared_vals.go index db198e4aa..f3b6cb6a2 100644 --- a/build/params_shared_vals.go +++ b/build/params_shared_vals.go @@ -1,3 +1,4 @@ +//go:build !testground // +build !testground package build diff --git a/build/params_testground.go b/build/params_testground.go index 204c74e67..0bb984a27 100644 --- a/build/params_testground.go +++ b/build/params_testground.go @@ -1,3 +1,4 @@ +//go:build testground // +build testground // This file makes hardcoded parameters (const) configurable as vars. diff --git a/build/tools.go b/build/tools.go index 57b6e7d1f..adebe34dd 100644 --- a/build/tools.go +++ b/build/tools.go @@ -1,4 +1,5 @@ -//+build tools +//go:build tools +// +build tools package build diff --git a/chain/types/message_fuzz.go b/chain/types/message_fuzz.go index 4ef5f6ba2..b57bfe452 100644 --- a/chain/types/message_fuzz.go +++ b/chain/types/message_fuzz.go @@ -1,4 +1,5 @@ -//+build gofuzz +//go:build gofuzz +// +build gofuzz package types diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index 31fc738e5..6aa62be51 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -1,3 +1,4 @@ +//go:build !nodaemon // +build !nodaemon package main diff --git a/cmd/lotus/daemon_nodaemon.go b/cmd/lotus/daemon_nodaemon.go index a11d92c6c..7cf12dac4 100644 --- a/cmd/lotus/daemon_nodaemon.go +++ b/cmd/lotus/daemon_nodaemon.go @@ -1,3 +1,4 @@ +//go:build nodaemon // +build nodaemon package main diff --git a/cmd/lotus/debug_advance.go b/cmd/lotus/debug_advance.go index 4e74a995f..8af4f3660 100644 --- a/cmd/lotus/debug_advance.go +++ b/cmd/lotus/debug_advance.go @@ -1,3 +1,4 @@ +//go:build debug // +build debug package main diff --git a/extern/sector-storage/ffiwrapper/prover_cgo.go b/extern/sector-storage/ffiwrapper/prover_cgo.go index 3ad73c81c..1ca22083d 100644 --- a/extern/sector-storage/ffiwrapper/prover_cgo.go +++ b/extern/sector-storage/ffiwrapper/prover_cgo.go @@ -1,4 +1,5 @@ -//+build cgo +//go:build cgo +// +build cgo package ffiwrapper diff --git a/extern/sector-storage/ffiwrapper/sealer_cgo.go b/extern/sector-storage/ffiwrapper/sealer_cgo.go index 820c53c4b..59770ec9a 100644 --- a/extern/sector-storage/ffiwrapper/sealer_cgo.go +++ b/extern/sector-storage/ffiwrapper/sealer_cgo.go @@ -1,4 +1,5 @@ -//+build cgo +//go:build cgo +// +build cgo package ffiwrapper diff --git a/extern/sector-storage/ffiwrapper/verifier_cgo.go b/extern/sector-storage/ffiwrapper/verifier_cgo.go index 95724bb7c..ff35ddc1f 100644 --- a/extern/sector-storage/ffiwrapper/verifier_cgo.go +++ b/extern/sector-storage/ffiwrapper/verifier_cgo.go @@ -1,4 +1,5 @@ -//+build cgo +//go:build cgo +// +build cgo package ffiwrapper diff --git a/extern/sector-storage/fsutil/dealloc_other.go b/extern/sector-storage/fsutil/dealloc_other.go index 4f8347951..ff373d97d 100644 --- a/extern/sector-storage/fsutil/dealloc_other.go +++ b/extern/sector-storage/fsutil/dealloc_other.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux package fsutil diff --git a/gateway/node.go b/gateway/node.go index 84b616f26..69a9d8731 100644 --- a/gateway/node.go +++ b/gateway/node.go @@ -40,6 +40,7 @@ type TargetAPI interface { ChainHasObj(context.Context, cid.Cid) (bool, error) ChainHead(ctx context.Context) (*types.TipSet, error) ChainNotify(context.Context) (<-chan []*api.HeadChange, error) + ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*api.HeadChange, error) ChainReadObj(context.Context, cid.Cid) ([]byte, error) GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error) MpoolPushUntrusted(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error) @@ -216,6 +217,10 @@ func (gw *Node) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, erro return gw.target.ChainNotify(ctx) } +func (gw *Node) ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*api.HeadChange, error) { + return gw.target.ChainGetPath(ctx, from, to) +} + func (gw *Node) ChainReadObj(ctx context.Context, c cid.Cid) ([]byte, error) { return gw.target.ChainReadObj(ctx, c) } diff --git a/lib/ulimit/ulimit_freebsd.go b/lib/ulimit/ulimit_freebsd.go index 7e50436f3..a5ff35707 100644 --- a/lib/ulimit/ulimit_freebsd.go +++ b/lib/ulimit/ulimit_freebsd.go @@ -1,3 +1,4 @@ +//go:build freebsd // +build freebsd package ulimit diff --git a/lib/ulimit/ulimit_test.go b/lib/ulimit/ulimit_test.go index ad27a163a..ecd777e3d 100644 --- a/lib/ulimit/ulimit_test.go +++ b/lib/ulimit/ulimit_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package ulimit diff --git a/lib/ulimit/ulimit_unix.go b/lib/ulimit/ulimit_unix.go index a351236dc..ac9f4ca90 100644 --- a/lib/ulimit/ulimit_unix.go +++ b/lib/ulimit/ulimit_unix.go @@ -1,3 +1,4 @@ +//go:build darwin || linux || netbsd || openbsd // +build darwin linux netbsd openbsd package ulimit