Fix issues 288 289 290 291#293
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 Walkthrough
WalkthroughIntroduces a centralized ChangesContract: ReentrancyGuard, Emergency Pause, CID field rename
Notifier Microservice
Sequence Diagram(s)sequenceDiagram
participant listenEvents
participant SorobanRPC
participant sendWebhook
participant Webhook
listenEvents->>SorobanRPC: getLatestLedger()
SorobanRPC-->>listenEvents: latestLedger (cursor init)
loop every 5 seconds
listenEvents->>SorobanRPC: getContractEvents(cursor)
SorobanRPC-->>listenEvents: events[]
loop for each event
listenEvents->>sendWebhook: sendWebhook(event)
sendWebhook->>Webhook: POST {event_type, contract_id, topic, value, timestamp}
alt success
Webhook-->>sendWebhook: 2xx
else failure with retries
Webhook-->>sendWebhook: error
sendWebhook->>sendWebhook: retry with exponential backoff (max 5)
end
end
listenEvents->>listenEvents: advance cursor to latestLedger
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Pull Request Description
This PR addresses the following features and security improvements:
services/notifierto subscribe to Soroban events and send webhooks. (closes Off-Chain Notification Event Webhooks via Indexer #288)Sessionstruct to useencrypted_notes_cidallowing experts to store encrypted session notes via IPFS. (closes Decentralized Session Notes & IPFS Encryption #289)securitymodule with aReentrancyGuardmodifier to prevent nested recursive invocations insettle_sessionandwithdraw_accrued. (closes Reentrancy Guard Modifier for External Contract Calls #290)emergency_pause()andemergency_unpause()to the contract controlled bySuperAdmin. Enhanced functions likestart_session,initialize_fixed_price_session, andreserve_sessionto check foris_emergency_paused. Withdrawals and settlements remain active during the pause to allow users to retrieve funds safely. (closes Emergency Pause ("Circuit Breaker") for Entire Contract #291)Summary by CodeRabbit
New Features
Bug Fixes