Skip to content

Commit

Permalink
Merge pull request #1766 from OffchainLabs/transactionstreamer-genesi…
Browse files Browse the repository at this point in the history
…sBlockNumber

Drop returning error from GenesisBlockNumber
  • Loading branch information
anodar authored Jul 18, 2023
2 parents 676bef3 + 8152bfb commit ac0a2de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions arbnode/transaction_streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,8 @@ func (s *TransactionStreamer) WriteMessageFromSequencer(pos arbutil.MessageIndex
return nil
}

func (s *TransactionStreamer) GetGenesisBlockNumber() (uint64, error) {
return s.chainConfig.ArbitrumChainParams.GenesisBlockNum, nil
func (s *TransactionStreamer) GenesisBlockNumber() uint64 {
return s.chainConfig.ArbitrumChainParams.GenesisBlockNum
}

// PauseReorgs until a matching call to ResumeReorgs (may be called concurrently)
Expand Down
11 changes: 2 additions & 9 deletions nodeInterface/NodeInterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ func (n NodeInterface) FindBatchContainingBlock(c ctx, evm mech, blockNum uint64
if err != nil {
return 0, err
}
genesis, err := node.TxStreamer.GetGenesisBlockNumber()
if err != nil {
return 0, err
}
return findBatchContainingBlock(node, genesis, blockNum)
return findBatchContainingBlock(node, node.TxStreamer.GenesisBlockNumber(), blockNum)
}

func (n NodeInterface) GetL1Confirmations(c ctx, evm mech, blockHash bytes32) (uint64, error) {
Expand All @@ -84,10 +80,7 @@ func (n NodeInterface) GetL1Confirmations(c ctx, evm mech, blockHash bytes32) (u
return 0, errors.New("unknown block hash")
}
blockNum := header.Number.Uint64()
genesis, err := node.TxStreamer.GetGenesisBlockNumber()
if err != nil {
return 0, err
}
genesis := node.TxStreamer.GenesisBlockNumber()
batch, err := findBatchContainingBlock(node, genesis, blockNum)
if err != nil {
if errors.Is(err, blockInGenesis) {
Expand Down

0 comments on commit ac0a2de

Please sign in to comment.