Skip to content

Commit

Permalink
rename reorgEventsReader to reorgEventsNotifier
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Nov 7, 2024
1 parent 87af748 commit c0acac1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions execution/gethexec/blockmetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type BlockMetadataFetcher interface {
BlockMetadataAtCount(count arbutil.MessageIndex) (arbostypes.BlockMetadata, error)
BlockNumberToMessageIndex(blockNum uint64) (arbutil.MessageIndex, error)
MessageIndexToBlockNumber(messageNum arbutil.MessageIndex) uint64
SetReorgEventsReader(reorgEventsReader chan struct{})
SetReorgEventsNotifier(reorgEventsNotifier chan struct{})
}

type BulkBlockMetadataFetcher struct {
Expand All @@ -38,7 +38,7 @@ func NewBulkBlockMetadataFetcher(bc *core.BlockChain, fetcher BlockMetadataFetch
if cacheSize != 0 {
cache = lru.NewSizeConstrainedCache[arbutil.MessageIndex, arbostypes.BlockMetadata](cacheSize)
reorgDetector = make(chan struct{})
fetcher.SetReorgEventsReader(reorgDetector)
fetcher.SetReorgEventsNotifier(reorgDetector)
}
return &BulkBlockMetadataFetcher{
bc: bc,
Expand Down
16 changes: 8 additions & 8 deletions execution/gethexec/executionengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ type ExecutionEngine struct {
resequenceChan chan []*arbostypes.MessageWithMetadata
createBlocksMutex sync.Mutex

newBlockNotifier chan struct{}
reorgEventsReader chan struct{}
latestBlockMutex sync.Mutex
latestBlock *types.Block
newBlockNotifier chan struct{}
reorgEventsNotifier chan struct{}
latestBlockMutex sync.Mutex
latestBlock *types.Block

nextScheduledVersionCheck time.Time // protected by the createBlocksMutex

Expand Down Expand Up @@ -135,8 +135,8 @@ func (s *ExecutionEngine) backlogL1GasCharged() uint64 {
s.cachedL1PriceData.msgToL1PriceData[0].l1GasCharged)
}

func (s *ExecutionEngine) SetReorgEventsReader(reorgEventsReader chan struct{}) {
s.reorgEventsReader = reorgEventsReader
func (s *ExecutionEngine) SetReorgEventsNotifier(reorgEventsNotifier chan struct{}) {
s.reorgEventsNotifier = reorgEventsNotifier
}

func (s *ExecutionEngine) MarkFeedStart(to arbutil.MessageIndex) {
Expand Down Expand Up @@ -258,9 +258,9 @@ func (s *ExecutionEngine) Reorg(count arbutil.MessageIndex, newMessages []arbost
return nil, err
}

if s.reorgEventsReader != nil {
if s.reorgEventsNotifier != nil {
select {
case s.reorgEventsReader <- struct{}{}:
case s.reorgEventsNotifier <- struct{}{}:
default:
}
}
Expand Down

0 comments on commit c0acac1

Please sign in to comment.