Skip to content

Commit

Permalink
Remove attestation server
Browse files Browse the repository at this point in the history
The attestation server was a concept that was abandoned during the implementation of the BFT block puller.
It is now dead code.

The aim of the attestation server was to pull only headers from the delivery server. It was implemented in a simpler fashion by augmenting the
`seekInfo.ContentType` with `ab.SeekInfo_HEADER_WITH_SIG`
which causes the desired behavior (see common/deliver/deliver.go L338).

Signed-off-by: Yoav Tock <[email protected]>
  • Loading branch information
tock-ibm authored and denyeart committed Feb 4, 2025
1 parent 7ba0024 commit 1325059
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 386 deletions.
18 changes: 0 additions & 18 deletions common/deliver/deliver.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,21 +413,3 @@ func (h *Handler) validateChannelHeader(ctx context.Context, chdr *cb.ChannelHea
func noExpiration(_ []byte) time.Time {
return time.Time{}
}

func (h *Handler) HandleAttestation(ctx context.Context, srv *Server, env *cb.Envelope) error {
status, err := h.deliverBlocks(ctx, srv, env)
if err != nil {
return err
}

err = srv.SendStatusResponse(status)
if status != cb.Status_SUCCESS {
return err
}
if err != nil {
addr := util.ExtractRemoteAddress(ctx)
logger.Warningf("Error sending to %s: %s", addr, err)
return err
}
return nil
}
24 changes: 0 additions & 24 deletions common/deliver/deliver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,16 +764,6 @@ var _ = Describe("Deliver", func() {
Expect(resp).To(Equal(cb.Status_SUCCESS))
})

It("HandleAttestation sends requested block", func() {
err := handler.HandleAttestation(context.Background(), server, envelope)
Expect(err).NotTo(HaveOccurred())
Expect(fakeResponseSender.SendBlockResponseCallCount()).To(Equal(1))
b, _, _, _ := fakeResponseSender.SendBlockResponseArgsForCall(0)
Expect(b).To(ProtoEqual(&cb.Block{
Header: &cb.BlockHeader{Number: 100},
}))
})

Context("when sending the success status fails", func() {
BeforeEach(func() {
fakeResponseSender.SendStatusResponseReturns(errors.New("send-success-fails"))
Expand All @@ -783,11 +773,6 @@ var _ = Describe("Deliver", func() {
err := handler.Handle(context.Background(), server)
Expect(err).To(MatchError("send-success-fails"))
})

It("HandleAttestation returns the error", func() {
err := handler.HandleAttestation(context.Background(), server, envelope)
Expect(err).To(MatchError("send-success-fails"))
})
})

Context("when receive fails", func() {
Expand Down Expand Up @@ -831,15 +816,6 @@ var _ = Describe("Deliver", func() {
resp := fakeResponseSender.SendStatusResponseArgsForCall(0)
Expect(resp).To(Equal(cb.Status_BAD_REQUEST))
})

It("sends a bad envelope to HandleAttestation", func() {
err := handler.HandleAttestation(context.Background(), server, envelope)
Expect(err).NotTo(HaveOccurred())

Expect(fakeResponseSender.SendStatusResponseCallCount()).To(Equal(1))
resp := fakeResponseSender.SendStatusResponseArgsForCall(0)
Expect(resp).To(Equal(cb.Status_BAD_REQUEST))
})
})

Context("when unmarshalling the channel header fails", func() {
Expand Down
106 changes: 0 additions & 106 deletions orderer/common/server/attestationserver.go

This file was deleted.

Loading

0 comments on commit 1325059

Please sign in to comment.