Skip to content

Commit

Permalink
split relayed failed to failed relayed and relayed tx reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed Dec 13, 2023
1 parent bb1a7f6 commit 5c1de26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (c *L2MessageFetcher) doFetchAndSaveEvents(ctx context.Context, from uint64
l2RevertedRelayedMessages = append(l2RevertedRelayedMessages, &orm.CrossMessage{
MessageHash: "0x" + common.Bytes2Hex(crypto.Keccak256(tx.AsL1MessageTx().Data)),
L2TxHash: tx.Hash().String(),
TxStatus: int(orm.TxStatusTypeRelayedFailed),
TxStatus: int(orm.TxStatusTypeRelayedTxReverted),
L2BlockNumber: receipt.BlockNumber.Uint64(),
MessageType: int(orm.MessageTypeL1SentMessage),
})
Expand Down
4 changes: 2 additions & 2 deletions bridge-history-api/internal/logic/watcher_event_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func ParseL1CrossChainEventLogs(ctx context.Context, logs []types.Log, blockTime
MessageHash: event.MessageHash.String(),
L1BlockNumber: vlog.BlockNumber,
L1TxHash: vlog.TxHash.String(),
TxStatus: int(orm.TxStatusTypeRelayedFailed),
TxStatus: int(orm.TxStatusTypeFailedRelayed),
MessageType: int(orm.MessageTypeL2SentMessage),
})
}
Expand Down Expand Up @@ -397,7 +397,7 @@ func ParseL2EventLogs(logs []types.Log, blockTimestampsMap map[uint64]uint64) ([
MessageHash: event.MessageHash.String(),
L2BlockNumber: vlog.BlockNumber,
L2TxHash: vlog.TxHash.String(),
TxStatus: int(orm.TxStatusTypeRelayedFailed),
TxStatus: int(orm.TxStatusTypeFailedRelayed),
MessageType: int(orm.MessageTypeL1SentMessage),
})
}
Expand Down
5 changes: 4 additions & 1 deletion bridge-history-api/internal/orm/cross_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ const (
TxStatusTypeSent
TxStatusTypeSentFailed
TxStatusTypeRelayed
TxStatusTypeRelayedFailed
// FailedRelayedMessage event: encoded tx failed, cannot retry. e.g., https://sepolia.scrollscan.com/tx/0xfc7d3ea5ec8dc9b664a5a886c3b33d21e665355057601033481a439498efb79a
TxStatusTypeFailedRelayed
// In some cases, user can retry with a larger gas limit. e.g., https://sepolia.scrollscan.com/tx/0x7323a7ba29492cb47d92206411be99b27896f2823cee0633a596b646b73f1b5b
TxStatusTypeRelayedTxReverted
TxStatusTypeSkipped
TxStatusTypeDropped
)
Expand Down

0 comments on commit 5c1de26

Please sign in to comment.