Skip to content

Commit

Permalink
Clean up obsolete code in batch fetcher
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Pavlovic <[email protected]>
  • Loading branch information
matejpavlovic committed Apr 5, 2023
1 parent 579269e commit 4bb0f7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion pkg/batchfetcher/batchfetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ func NewModule(mc *ModuleConfig, epochNr t.EpochNr, clientProgress *clientprogre
// At the time of forwarding, submit the client progress to the checkpointing protocol.
f: func(_ *eventpb.Event) {
clientProgress.GarbageCollect()
//commonpbdsl.ClientProgress(m, mc.Checkpoint, clientProgress.ClientTrackers)
dsl.EmitEvent(m, bfevents.ClientProgress(
mc.Checkpoint.Then(t.ModuleID(fmt.Sprintf("%v", epochNr))),
clientProgress.Pb(),
Expand Down
17 changes: 3 additions & 14 deletions pkg/batchfetcher/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
bfpb "github.com/filecoin-project/mir/pkg/pb/batchfetcherpb"
"github.com/filecoin-project/mir/pkg/pb/commonpb"
"github.com/filecoin-project/mir/pkg/pb/eventpb"
"github.com/filecoin-project/mir/pkg/pb/requestpb"
t "github.com/filecoin-project/mir/pkg/types"
)

// These are specific events that are not automatically generated but are necessary for the batchfetcher to queue them and treat them in order
// These are specific events that are not automatically generated but are necessary for the batchfetcher
// to queue them and treat them in order.

// Event creates an eventpb.Event out of an batchfetcherpb.Event.
func Event(dest t.ModuleID, ev *bfpb.Event) *eventpb.Event {
return &eventpb.Event{
Expand All @@ -19,18 +20,6 @@ func Event(dest t.ModuleID, ev *bfpb.Event) *eventpb.Event {
}
}

// NewOrderedBatch notifies the application when an ordered batch containing transaction payloads
// has been fetched from the availability layer and is ready for execution.
func NewOrderedBatch(dest t.ModuleID, txs []*requestpb.Request) *eventpb.Event {
return Event(dest, &bfpb.Event{
Type: &bfpb.Event_NewOrderedBatch{
NewOrderedBatch: &bfpb.NewOrderedBatch{
Txs: txs,
},
},
})
}

func ClientProgress(dest t.ModuleID, progress *commonpb.ClientProgress) *eventpb.Event {
return Event(dest, &bfpb.Event{Type: &bfpb.Event_ClientProgress{ClientProgress: progress}})
}

0 comments on commit 4bb0f7e

Please sign in to comment.