Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set gcConfidence = 2 * constants.ForkLengthThreshold / 设置gcConfidence的值为2 * constants.ForkLengthThreshold #6113

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/submodule/eth/eth_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ type ethAPI struct {
}

func (a *ethAPI) start(ctx context.Context) error {
const ChainHeadConfidence = 1
ev, err := events.NewEventsWithConfidence(ctx, a.chain, ChainHeadConfidence)
ev, err := events.NewEvents(ctx, a.chain)
if err != nil {
return err
}
Expand Down
4 changes: 1 addition & 3 deletions app/submodule/eth/eth_event_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import (
"github.com/zyedidia/generic/queue"
)

const ChainHeadConfidence = 1

var _ v1.IETHEvent = (*ethEventAPI)(nil)

func newEthEventAPI(ctx context.Context, em *EthSubModule) (*ethEventAPI, error) {
Expand Down Expand Up @@ -128,7 +126,7 @@ func (e *ethEventAPI) Start(ctx context.Context) error {
// Start garbage collection for filters
go e.GC(ctx, time.Duration(e.em.cfg.FevmConfig.Event.FilterTTL))

ev, err := events.NewEventsWithConfidence(ctx, e.ChainAPI, ChainHeadConfidence)
ev, err := events.NewEvents(ctx, e.ChainAPI)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Events struct {
*hcEvents
}

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

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

func NewEvents(ctx context.Context, api IEvent) (*Events, error) {
gcConfidence := 2 * constants.ForkLengthThreshold
return NewEventsWithConfidence(ctx, api, gcConfidence)
return newEventsWithConfidence(ctx, api, gcConfidence)
}