Conversation
...and before integrating quicknode webhooks instead
956f140 to
0891368
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a complete infrastructure-as-code system for monitoring Safe multisig wallets on multiple blockchain networks.
Overview
This PR introduces a complete Terraform-managed alerting infrastructure for monitoring Safe multisig wallets across multiple blockchain networks (Celo, Ethereum). The system automatically monitors 16 different Safe contract events and routes them to appropriate Discord channels based on event type (security alerts vs operational events).
Key Components
Infrastructure Modules:
discord-channel-manager/- Creates Discord channels and webhooks via Terraform REST API provideronchain-event-listeners/- Manages QuickNode webhooks with JavaScript filter functionsonchain-event-handler/- TypeScript Cloud Function that processes webhooks, verifies signatures, and sends Discord messagessentry-alerts/- Sentry error monitoring integration with automatic Discord channel creationEvent Monitoring:
How to Review
1. Review Infrastructure Architecture
main.tffor module orchestration and resource dependenciesREADME.mdfor architecture decisions:discord-channel-manager/README.md- Discord infrastructure approachonchain-event-listeners/README.md- QuickNode webhook managementonchain-event-handler/README.md- Cloud Function deploymentsentry-alerts/README.md- Sentry integration2. Review Code Quality
Key files to review:
onchain-event-handler/src/process-events.ts- Core event processing logiconchain-event-handler/src/verify-quicknode-signature.ts- Security-critical signature verificationonchain-event-handler/src/event-formatters/- Discord message formatting3. Test Terraform Plan (Dry Run)
Copy example vars
cp terraform.tfvars.example terraform.tfvars
Edit terraform.tfvars with test values (use dummy values for secrets)
Then run plan
terraform init
terraform plan
Verify:
4. Review Security Implementation
Focus areas:
onchain-event-handler/src/verify-quicknode-signature.ts- Signature verification logiconchain-event-handler/src/validate-quicknode-webhook.ts- Webhook validationonchain-event-handler/main.tf5. Documentation Review
6. Manual Testing (If Deploying)
Test Steps:
0. Set up Terraform
./scripts/set-up-terraform.shterraform applycurl $(terraform output -raw cloud_function_url)scripts/manage-quicknode-webhook.sh)scripts/test-local.shNote: Full manual testing requires actual GCP/Discord/QuickNode credentials. For code review, focus on architecture, code quality, and security implementation.