File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 99 "github.com/ethereum/go-ethereum/common"
1010 "github.com/ethereum/go-ethereum/log"
1111
12+ "github.com/offchainlabs/nitro/arbutil"
1213 "github.com/offchainlabs/nitro/execution"
1314)
1415
@@ -127,12 +128,13 @@ func (s *SyncMonitor) SetConsensusInfo(consensus execution.ConsensusInfo) {
127128}
128129
129130func (s * SyncMonitor ) BlockMetadataByNumber (blockNum uint64 ) (common.BlockMetadata , error ) {
130- count , err := s .exec .BlockNumberToMessageIndex ( blockNum )
131- if err != nil {
132- return nil , err
131+ genesis := s .exec .GetGenesisBlockNumber ( )
132+ if blockNum < genesis { // Arbitrum classic block
133+ return nil , nil
133134 }
135+ pos := arbutil .MessageIndex (blockNum - genesis )
134136 if s .consensus != nil {
135- return s .consensus .BlockMetadataAtCount (count + 1 )
137+ return s .consensus .BlockMetadataAtCount (pos + 1 )
136138 }
137139 log .Debug ("FullConsensusClient is not accessible to execution, BlockMetadataByNumber will return nil" )
138140 return nil , nil
You can’t perform that action at this time.
0 commit comments