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

fix: support SyncIncomingBlocks #62

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ type Proxy interface {
// network through this node
SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error //perm:write

// SyncIncomingBlocks returns a channel streaming incoming, potentially not
// yet synced block headers.
SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error) //perm:read

// MethodGroup: Mpool
// The Mpool methods are for interacting with the message pool. The message pool
// manages all incoming and outgoing 'messages' going over the network.
Expand Down Expand Up @@ -582,10 +586,6 @@ type UnSupport interface {
// nodes.
ChainExportRangeInternal(ctx context.Context, head, tail types.TipSetKey, cfg api.ChainExportConfig) error //perm:admin

// SyncIncomingBlocks returns a channel streaming incoming, potentially not
// yet synced block headers.
SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error) //perm:read

// SyncCheckpoint marks a blocks as checkpointed, meaning that it won't ever fork away from it.
SyncCheckpoint(ctx context.Context, tsk types.TipSetKey) error //perm:admin

Expand Down
9 changes: 9 additions & 0 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,15 @@ func (p *Proxy) StateWaitMsg(in0 context.Context, in1 cid.Cid, in2 uint64, in3 a
return cli.StateWaitMsg(in0, in1, in2, in3, in4)
}

func (p *Proxy) SyncIncomingBlocks(in0 context.Context) (out0 <-chan *types.BlockHeader, err error) {
cli, err := p.Select(types.EmptyTSK)
if err != nil {
err = fmt.Errorf("api SyncIncomingBlocks %v", err)
return
}
return cli.SyncIncomingBlocks(in0)
}

func (p *Proxy) SyncState(in0 context.Context) (out0 *api1.SyncState, err error) {
cli, err := p.Select(types.EmptyTSK)
if err != nil {
Expand Down
9 changes: 0 additions & 9 deletions proxy/unsupport.go
Original file line number Diff line number Diff line change
Expand Up @@ -1237,15 +1237,6 @@ func (p *UnSupport) SyncCheckpoint(in0 context.Context, in1 types.TipSetKey) (er
return cli.SyncCheckpoint(in0, in1)
}

func (p *UnSupport) SyncIncomingBlocks(in0 context.Context) (out0 <-chan *types.BlockHeader, err error) {
cli, err := p.Select(types.EmptyTSK)
if err != nil {
err = fmt.Errorf("api SyncIncomingBlocks %v", err)
return
}
return cli.SyncIncomingBlocks(in0)
}

func (p *UnSupport) SyncMarkBad(in0 context.Context, in1 cid.Cid) (err error) {
cli, err := p.Select(types.EmptyTSK)
if err != nil {
Expand Down
Loading