Skip to content

Commit

Permalink
go/worker/common/committee: Remove unused node hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
peternose committed Nov 6, 2023
1 parent 7f970bd commit 9c22113
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 52 deletions.
11 changes: 0 additions & 11 deletions go/worker/client/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,6 @@ func (n *Node) Initialized() <-chan struct{} {
return n.initCh
}

// HandlePeerTx is guarded by CrossNode.
func (n *Node) HandlePeerTx(context.Context, []byte) error {
// Nothing to do here.
return nil
}

// HandleEpochTransitionLocked is guarded by CrossNode.
func (n *Node) HandleEpochTransitionLocked(*committee.EpochSnapshot) {
// Nothing to do here.
}

// HandleNewBlockEarlyLocked is guarded by CrossNode.
func (n *Node) HandleNewBlockEarlyLocked(*runtime.BlockInfo) {
// Nothing to do here.
Expand Down
13 changes: 0 additions & 13 deletions go/worker/common/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ var (
// NodeHooks defines a worker's duties at common events.
// These are called from the runtime's common node's worker.
type NodeHooks interface {
// HandlePeerTx handles a transaction received from a (non-local) peer.
HandlePeerTx(ctx context.Context, tx []byte) error

// Guarded by CrossNode.
HandleEpochTransitionLocked(*EpochSnapshot)
// Guarded by CrossNode.
HandleNewBlockEarlyLocked(*runtime.BlockInfo)
// Guarded by CrossNode.
Expand Down Expand Up @@ -365,9 +360,6 @@ func (n *Node) handleEpochTransitionLocked(height int64) {
}

epochNumber.With(n.getMetricLabels()).Set(float64(epoch.epochNumber))
for _, hooks := range n.hooks {
hooks.HandleEpochTransitionLocked(epoch)
}
}

// Guarded by n.CrossNode.
Expand All @@ -377,11 +369,6 @@ func (n *Node) handleSuspendLocked(int64) {
// Suspend group.
n.Group.Suspend()

epoch := n.Group.GetEpochSnapshot()
for _, hooks := range n.hooks {
hooks.HandleEpochTransitionLocked(epoch)
}

// If the runtime has been suspended, we need to switch to checking the latest registry
// descriptor instead of the active one as otherwise we may miss deployment updates and never
// register, keeping the runtime suspended.
Expand Down
6 changes: 0 additions & 6 deletions go/worker/common/committee/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ func (h *txMsgHandler) HandleMessage(ctx context.Context, _ signature.PublicKey,
}
}

// Dispatch to any transaction handlers.
for _, hooks := range h.n.hooks {
if err := hooks.HandlePeerTx(ctx, tx); err != nil {
return err
}
}
return nil
}

Expand Down
12 changes: 0 additions & 12 deletions go/worker/compute/executor/committee/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ import (
// Ensure Node implements NodeHooks.
var _ committee.NodeHooks = (*Node)(nil)

// HandlePeerTx implements NodeHooks.
func (n *Node) HandlePeerTx(context.Context, []byte) error {
// Nothing to do here.
return nil
}

// HandleEpochTransitionLocked implements NodeHooks.
// Guarded by n.commonNode.CrossNode.
func (n *Node) HandleEpochTransitionLocked(*committee.EpochSnapshot) {
// Nothing to do here.
}

// HandleNewBlockEarlyLocked implements NodeHooks.
// Guarded by n.commonNode.CrossNode.
func (n *Node) HandleNewBlockEarlyLocked(*runtime.BlockInfo) {
Expand Down
10 changes: 0 additions & 10 deletions go/worker/storage/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,16 +337,6 @@ func (n *Node) GetLocalStorage() storageApi.LocalBackend {

// NodeHooks implementation.

func (n *Node) HandlePeerTx(context.Context, []byte) error {
// Nothing to do here.
return nil
}

// HandleEpochTransitionLocked is guarded by CrossNode.
func (n *Node) HandleEpochTransitionLocked(*committee.EpochSnapshot) {
// Nothing to do here.
}

// HandleNewBlockEarlyLocked is guarded by CrossNode.
func (n *Node) HandleNewBlockEarlyLocked(*runtime.BlockInfo) {
// Nothing to do here.
Expand Down

0 comments on commit 9c22113

Please sign in to comment.