Skip to content

Commit

Permalink
Merge pull request #10713 from filecoin-project/steb/fix-event-subscr…
Browse files Browse the repository at this point in the history
…iption

fix: events: don't set GC confidence to 1
  • Loading branch information
arajasek authored Apr 26, 2023
2 parents 88ff21a + c84c07e commit eb0b1c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions chain/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Events struct {
*hcEvents
}

func NewEventsWithConfidence(ctx context.Context, api EventAPI, gcConfidence abi.ChainEpoch) (*Events, error) {
func newEventsWithGCConfidence(ctx context.Context, api EventAPI, gcConfidence abi.ChainEpoch) (*Events, error) {
cache := newCache(api, gcConfidence)

ob := newObserver(cache, gcConfidence)
Expand All @@ -63,5 +63,5 @@ func NewEventsWithConfidence(ctx context.Context, api EventAPI, gcConfidence abi

func NewEvents(ctx context.Context, api EventAPI) (*Events, error) {
gcConfidence := 2 * build.ForkLengthThreshold
return NewEventsWithConfidence(ctx, api, gcConfidence)
return newEventsWithGCConfidence(ctx, api, gcConfidence)
}
2 changes: 1 addition & 1 deletion node/modules/actorevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func EthEventAPI(cfg config.FevmConfig) func(helpers.MetricsCtx, repo.LockedRepo

lc.Append(fx.Hook{
OnStart: func(context.Context) error {
ev, err := events.NewEventsWithConfidence(ctx, &evapi, ChainHeadConfidence)
ev, err := events.NewEvents(ctx, &evapi)
if err != nil {
return err
}
Expand Down
4 changes: 1 addition & 3 deletions node/modules/ethmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ func EthModuleAPI(cfg config.FevmConfig) func(helpers.MetricsCtx, repo.LockedRep
}
}

const ChainHeadConfidence = 1

ctx := helpers.LifecycleCtx(mctx, lc)
lc.Append(fx.Hook{
OnStart: func(context.Context) error {
ev, err := events.NewEventsWithConfidence(ctx, &evapi, ChainHeadConfidence)
ev, err := events.NewEvents(ctx, &evapi)
if err != nil {
return err
}
Expand Down

0 comments on commit eb0b1c9

Please sign in to comment.