Skip to content

Commit

Permalink
Merge branch 'bold' into bold-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
amsanghi authored Nov 28, 2023
2 parents d9c661b + 038d8ac commit 373cbff
Show file tree
Hide file tree
Showing 43 changed files with 1,362 additions and 602 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ COPY ./scripts/download-machine.sh .
RUN ./download-machine.sh consensus-v10 0x6b94a7fc388fd8ef3def759297828dc311761e88d8179c7ee8d3887dc554f3c3
RUN ./download-machine.sh consensus-v10.1 0xda4e3ad5e7feacb817c21c8d0220da7650fe9051ece68a3f0b1c5d38bbb27b21
RUN ./download-machine.sh consensus-v10.2 0x0754e09320c381566cc0449904c377a52bd34a6b9404432e80afd573b67f7b17
RUN ./download-machine.sh consensus-v10.3 0xf559b6d4fa869472dabce70fe1c15221bdda837533dfd891916836975b434dec

FROM golang:1.20-bullseye as node-builder
WORKDIR /workspace
Expand Down
18 changes: 14 additions & 4 deletions arbnode/delayed.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ func (b *DelayedBridge) logsToDeliveredMessages(ctx context.Context, logs []type
}

messages := make([]*DelayedInboxMessage, 0, len(logs))
var lastParentChainBlockNumber uint64
var lastL1BlockNumber uint64
for _, parsedLog := range parsedLogs {
msgKey := common.BigToHash(parsedLog.MessageIndex)
data, ok := messageData[msgKey]
Expand All @@ -196,9 +198,17 @@ func (b *DelayedBridge) logsToDeliveredMessages(ctx context.Context, logs []type

requestId := common.BigToHash(parsedLog.MessageIndex)
parentChainBlockNumber := parsedLog.Raw.BlockNumber
l1BlockNumber, err := arbutil.CorrespondingL1BlockNumber(ctx, b.client, parentChainBlockNumber)
if err != nil {
return nil, err
var l1BlockNumber uint64
if lastParentChainBlockNumber == parentChainBlockNumber && lastParentChainBlockNumber > 0 {
l1BlockNumber = lastL1BlockNumber
} else {
var err error
l1BlockNumber, err = arbutil.CorrespondingL1BlockNumber(ctx, b.client, parentChainBlockNumber)
if err != nil {
return nil, err
}
lastParentChainBlockNumber = parentChainBlockNumber
lastL1BlockNumber = l1BlockNumber
}
msg := &DelayedInboxMessage{
BlockHash: parsedLog.Raw.BlockHash,
Expand All @@ -216,7 +226,7 @@ func (b *DelayedBridge) logsToDeliveredMessages(ctx context.Context, logs []type
},
ParentChainBlockNumber: parsedLog.Raw.BlockNumber,
}
err = msg.Message.FillInBatchGasCost(batchFetcher)
err := msg.Message.FillInBatchGasCost(batchFetcher)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions arbnode/inbox_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,11 @@ func (r *InboxReader) run(ctx context.Context, hadError bool) error {
} else if err != nil {
// Unknown error (database error?)
return err
} else if haveAcc == batch.BeforeInboxAcc {
} else if haveAcc == batch.AfterInboxAcc {
// Skip this batch, as we already have it in the database
sequencerBatches = sequencerBatches[1:]
} else {
// The first batch BeforeInboxAcc matches, but this batch doesn't,
// The first batch AfterInboxAcc matches, but this batch doesn't,
// so we'll successfully reorg it when we hit the addMessages
break
}
Expand Down
Loading

0 comments on commit 373cbff

Please sign in to comment.