Skip to content

[FEAT] XRPL 잔고 Redis 캐싱 + my-business 프로필 노출 #33

Description

@Takch02

배경

현재 GET /my-business/profile은 지갑 주소(wallet.address)만 반환하고
실제 XRP 잔고는 포함되지 않습니다.

POST /payvalidateEscrowFunds가 매번 XRPL 노드에
직접 쿼리하여 잔고를 확인합니다. 결제가 몰릴 경우 XRPL 노드
응답 지연이 결제 개시 응답 시간에 직접 영향을 줍니다.

목표

  • XRPL 잔고를 Redis에 단기 캐싱하여 XRPL 노드 쿼리 횟수 감소
  • GET /my-business/profile 응답에 walletBalance 필드 추가

캐시 설계

  • 키: xrpl:balance:{walletAddress}
  • TTL: 30초 (잔고는 트랜잭션마다 변하므로 짧게)
  • 조회: 캐시 hit → 즉시 반환 / miss → XRPL 노드 쿼리 후 캐시 저장

적용 지점

  1. validateEscrowFunds — 잔고 조회 시 캐시 우선 확인
  2. GET /my-business/profile — walletBalance 필드 추가
    캐시 있으면 즉시, 없으면 XRPL 조회 후 캐시 저장

캐시 무효화

결제가 ACTIVE로 전환될 때 (EscrowCreateProcessor.markActive 이후)
해당 buyer 지갑의 캐시 키를 삭제 → 다음 조회 시 최신 잔고 반영

체크리스트

  • XrplService에 getAccountBalance(address) + 캐시 레이어 추가
  • validateEscrowFunds 캐시 적용
  • my-business profile 응답에 walletBalance 추가
  • markActive 후 캐시 무효화
  • XRPL 노드 다운 시 캐시 miss → 에러 핸들링 (결제 개시 차단 여부 결정 필요)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions