From 805670dd7ede494e55ea1c098551278a7bca1d64 Mon Sep 17 00:00:00 2001 From: georgehao Date: Tue, 25 Nov 2025 12:16:21 +0800 Subject: [PATCH] fix bridge history GetL2UnclaimedWithdrawalsByAddress --- bridge-history-api/internal/logic/history_logic.go | 5 +++++ bridge-history-api/internal/orm/cross_message.go | 2 +- common/version/version.go | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bridge-history-api/internal/logic/history_logic.go b/bridge-history-api/internal/logic/history_logic.go index ee52ce3ac5..466d0ff1c0 100644 --- a/bridge-history-api/internal/logic/history_logic.go +++ b/bridge-history-api/internal/logic/history_logic.go @@ -97,6 +97,11 @@ func (h *HistoryLogic) GetL2UnclaimedWithdrawalsByAddress(ctx context.Context, a return nil, 0, errors.New("unexpected error") } + if len(txHistoryInfos) == 0 { + log.Error("failed to get L2 claimable withdrawals by address len = 0", "address", address) + return nil, 0, errors.New("unexpected error") + } + return h.processAndCacheTxHistoryInfo(ctx, cacheKey, txHistoryInfos, page, pageSize) } diff --git a/bridge-history-api/internal/orm/cross_message.go b/bridge-history-api/internal/orm/cross_message.go index 91d670d8e8..05e6eecfcf 100644 --- a/bridge-history-api/internal/orm/cross_message.go +++ b/bridge-history-api/internal/orm/cross_message.go @@ -157,7 +157,7 @@ func (c *CrossMessage) GetL2UnclaimedWithdrawalsByAddress(ctx context.Context, s db = db.Where("tx_status in (?)", []types.TxStatusType{types.TxStatusTypeSent, types.TxStatusTypeFailedRelayed, types.TxStatusTypeRelayTxReverted}) db = db.Where("sender = ?", sender) db = db.Order("block_timestamp desc") - db = db.Limit(500) + db = db.Limit(10000) if err := db.Find(&messages).Error; err != nil { return nil, fmt.Errorf("failed to get L2 claimable withdrawal messages by sender address, sender: %v, error: %w", sender, err) } diff --git a/common/version/version.go b/common/version/version.go index 3cc24959cb..9c2210a466 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.7.1" +var tag = "v4.7.2" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok {