@@ -126,18 +126,25 @@ func (s *L2Verifiers) restoreState(ctx context.Context, l2EthOracles *snapshotpb
126
126
Time : v .LastBlock .BlockTime ,
127
127
}
128
128
}
129
+ // do it once just in case
130
+ verifier .restoreLastEthBlock (ctx , lastBlock )
129
131
130
- var patchBlock * types.EthBlock
131
- if v .Misc .PatchBlock != nil {
132
- lastBlock = & types.EthBlock {
133
- Height : v .Misc .PatchBlock .BlockHeight ,
134
- Time : v .Misc .PatchBlock .BlockTime ,
132
+ // only run this if the misc exists, which might
133
+ // not be the case on a new upgrade after it's
134
+ // introduced
135
+ if v .Misc != nil {
136
+ var patchBlock * types.EthBlock
137
+ if v .Misc .PatchBlock != nil {
138
+ lastBlock = & types.EthBlock {
139
+ Height : v .Misc .PatchBlock .BlockHeight ,
140
+ Time : v .Misc .PatchBlock .BlockTime ,
141
+ }
135
142
}
136
- }
137
143
138
- verifier .restoreLastEthBlock (ctx , lastBlock )
139
- verifier .restorePatchBlock (ctx , patchBlock )
140
- verifier .restoreSeen (v .Misc .Buckets )
144
+ verifier .restoreLastEthBlock (ctx , lastBlock )
145
+ verifier .restorePatchBlock (ctx , patchBlock )
146
+ verifier .restoreSeen (v .Misc .Buckets )
147
+ }
141
148
142
149
pending := []* ethcall.ContractCallEvent {}
143
150
0 commit comments