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 9
9
"github.com/ethereum/go-ethereum/common"
10
10
"github.com/ethereum/go-ethereum/log"
11
11
12
+ "github.com/offchainlabs/nitro/arbutil"
12
13
"github.com/offchainlabs/nitro/execution"
13
14
)
14
15
@@ -127,12 +128,13 @@ func (s *SyncMonitor) SetConsensusInfo(consensus execution.ConsensusInfo) {
127
128
}
128
129
129
130
func (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
133
134
}
135
+ pos := arbutil .MessageIndex (blockNum - genesis )
134
136
if s .consensus != nil {
135
- return s .consensus .BlockMetadataAtCount (count + 1 )
137
+ return s .consensus .BlockMetadataAtCount (pos + 1 )
136
138
}
137
139
log .Debug ("FullConsensusClient is not accessible to execution, BlockMetadataByNumber will return nil" )
138
140
return nil , nil
You can’t perform that action at this time.
0 commit comments