Skip to content

Commit

Permalink
Produce better error messages when failing to read the delayed inbox
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Feb 8, 2024
1 parent 8517340 commit 668393b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions arbnode/delayed.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ func (b *DelayedBridge) logsToDeliveredMessages(ctx context.Context, logs []type
msgKey := common.BigToHash(parsedLog.MessageIndex)
data, ok := messageData[msgKey]
if !ok {
return nil, errors.New("message not found")
return nil, fmt.Errorf("message %v data not found", parsedLog.MessageIndex)
}
if crypto.Keccak256Hash(data) != parsedLog.MessageDataHash {
return nil, errors.New("found message data with mismatched hash")
return nil, fmt.Errorf("found message %v data with mismatched hash", parsedLog.MessageIndex)
}

requestId := common.BigToHash(parsedLog.MessageIndex)
Expand Down
4 changes: 2 additions & 2 deletions arbnode/inbox_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,11 @@ func (t *InboxTracker) AddDelayedMessages(messages []*DelayedInboxMessage, hardR
}

if seqNum != pos {
return errors.New("unexpected delayed sequence number")
return fmt.Errorf("unexpected delayed sequence number %v, expected %v", seqNum, pos)
}

if nextAcc != message.BeforeInboxAcc {
return errors.New("previous delayed accumulator mismatch")
return fmt.Errorf("previous delayed accumulator mismatch for message %v", seqNum)
}
nextAcc = message.AfterInboxAcc()

Expand Down

0 comments on commit 668393b

Please sign in to comment.