From c84c07eb74e1c55b0c5b193b3a50432dbb301d89 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 20 Apr 2023 14:44:16 -0700 Subject: [PATCH] fix: events: don't set GC confidence to 1 The function/parameter were poorly named and should never have been exposed. "GC" confidence should always be the same, this parameter doesn't let us actually set the _confidence_, just the point before which we no longer support reverts. fixes #10706 --- chain/events/events.go | 4 ++-- node/modules/actorevent.go | 2 +- node/modules/ethmodule.go | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/chain/events/events.go b/chain/events/events.go index 86aded64d..c68b62a64 100644 --- a/chain/events/events.go +++ b/chain/events/events.go @@ -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) @@ -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) } diff --git a/node/modules/actorevent.go b/node/modules/actorevent.go index 55a79a59a..68a6990ce 100644 --- a/node/modules/actorevent.go +++ b/node/modules/actorevent.go @@ -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 } diff --git a/node/modules/ethmodule.go b/node/modules/ethmodule.go index eba6c54d1..074e911e2 100644 --- a/node/modules/ethmodule.go +++ b/node/modules/ethmodule.go @@ -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 }