Skip to content

Commit

Permalink
minor edits and renames
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed Oct 7, 2023
1 parent 18616c4 commit f804c7f
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion arbnode/inbox_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (t *InboxTracker) GetBatchCount() (uint64, error) {
return count, nil
}

func (t *InboxTracker) FindL1BatchForMessage(pos arbutil.MessageIndex) (uint64, error) {
func (t *InboxTracker) FindInboxBatchContainingMessage(pos arbutil.MessageIndex) (uint64, error) {
batchCount, err := t.GetBatchCount()
if err != nil {
return 0, err
Expand Down
4 changes: 2 additions & 2 deletions arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 +1115,8 @@ func (n *Node) FetchBatch(ctx context.Context, batchNum uint64) ([]byte, error)
return n.InboxReader.GetSequencerMessageBytes(ctx, batchNum)
}

func (n *Node) FindL1BatchForMessage(message arbutil.MessageIndex) (uint64, error) {
return n.InboxTracker.FindL1BatchForMessage(message)
func (n *Node) FindInboxBatchContainingMessage(message arbutil.MessageIndex) (uint64, error) {
return n.InboxTracker.FindInboxBatchContainingMessage(message)
}

func (n *Node) GetBatchParentChainBlock(seqNum uint64) (uint64, error) {
Expand Down
2 changes: 1 addition & 1 deletion execution/gethexec/executionengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (s *ExecutionEngine) EnableReorgSequencing() {
s.reorgSequencing = true
}

func (s *ExecutionEngine) SetTransactionStreamer(consensus execution.FullConsensusClient) {
func (s *ExecutionEngine) SetConsensus(consensus execution.FullConsensusClient) {
if s.Started() {
panic("trying to set transaction consensus after start")
}
Expand Down
17 changes: 9 additions & 8 deletions execution/gethexec/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func CreateExecutionNode(
if err != nil {
return nil, err
}
} else {
} else if config.Sequencer.Enable {
log.Warn("sequencer enabled without l1 client")
}

Expand Down Expand Up @@ -198,14 +198,15 @@ func CreateExecutionNode(
syncMon := NewSyncMonitor(execEngine)

var classicOutbox *ClassicOutboxRetriever
classicMsgDb, err := stack.OpenDatabase("classic-msg", 0, 0, "", true)
if err != nil {
if l2BlockChain.Config().ArbitrumChainParams.GenesisBlockNum > 0 {

if l2BlockChain.Config().ArbitrumChainParams.GenesisBlockNum > 0 {
classicMsgDb, err := stack.OpenDatabase("classic-msg", 0, 0, "", true)
if err != nil {
log.Warn("Classic Msg Database not found", "err", err)
classicOutbox = nil
} else {
classicOutbox = NewClassicOutboxRetriever(classicMsgDb)
}
classicOutbox = nil
} else {
classicOutbox = NewClassicOutboxRetriever(classicMsgDb)
}

apis := []rpc.API{{
Expand Down Expand Up @@ -379,7 +380,7 @@ func (n *ExecutionNode) ForwardTo(url string) error {
}

func (n *ExecutionNode) SetConsensusClient(consensus execution.FullConsensusClient) {
n.ExecEngine.SetTransactionStreamer(consensus)
n.ExecEngine.SetConsensus(consensus)
n.SyncMonitor.SetConsensusInfo(consensus)
}

Expand Down
2 changes: 1 addition & 1 deletion execution/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type FullExecutionClient interface {
// BatchFetcher is required for any execution node
type BatchFetcher interface {
FetchBatch(ctx context.Context, batchNum uint64) ([]byte, error)
FindL1BatchForMessage(message arbutil.MessageIndex) (uint64, error)
FindInboxBatchContainingMessage(message arbutil.MessageIndex) (uint64, error)
GetBatchParentChainBlock(seqNum uint64) (uint64, error)
}

Expand Down
2 changes: 1 addition & 1 deletion execution/nodeInterface/NodeInterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (n NodeInterface) FindBatchContainingBlock(c ctx, evm mech, blockNum uint64
if fetcher == nil {
return 0, errors.New("batch fetcher not set")
}
batch, err := fetcher.FindL1BatchForMessage(msgIndex)
batch, err := fetcher.FindInboxBatchContainingMessage(msgIndex)
return batch, err
}

Expand Down
2 changes: 1 addition & 1 deletion staker/l1_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (v *L1Validator) generateNodeAction(
batchNum = localBatchCount - 1
validatedCount = messageCount
} else {
batchNum, err = v.inboxTracker.FindL1BatchForMessage(validatedCount - 1)
batchNum, err = v.inboxTracker.FindInboxBatchContainingMessage(validatedCount - 1)
if err != nil {
return nil, false, err
}
Expand Down
4 changes: 2 additions & 2 deletions staker/stateless_block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type InboxTrackerInterface interface {
GetBatchMessageCount(seqNum uint64) (arbutil.MessageIndex, error)
GetBatchAcc(seqNum uint64) (common.Hash, error)
GetBatchCount() (uint64, error)
FindL1BatchForMessage(pos arbutil.MessageIndex) (uint64, error)
FindInboxBatchContainingMessage(pos arbutil.MessageIndex) (uint64, error)
}

type TransactionStreamerInterface interface {
Expand Down Expand Up @@ -297,7 +297,7 @@ func (v *StatelessBlockValidator) GlobalStatePositionsAtCount(count arbutil.Mess
if count == 1 {
return GlobalStatePosition{}, GlobalStatePosition{1, 0}, nil
}
batch, err := v.inboxTracker.FindL1BatchForMessage(count - 1)
batch, err := v.inboxTracker.FindInboxBatchContainingMessage(count - 1)
if err != nil {
return GlobalStatePosition{}, GlobalStatePosition{}, err
}
Expand Down

0 comments on commit f804c7f

Please sign in to comment.