Skip to content

feat: event-driven lighthouse implementation#579

Closed
otsybizov wants to merge 1 commit intomainnet-stagingfrom
feat/event-driven-lighthouse
Closed

feat: event-driven lighthouse implementation#579
otsybizov wants to merge 1 commit intomainnet-stagingfrom
feat/event-driven-lighthouse

Conversation

@otsybizov
Copy link
Contributor

🤖 Linear

Closes CONG-XXX

Copilot AI review requested due to automatic review settings March 13, 2026 01:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements an event-driven Lighthouse execution model by introducing a BullMQ-based queue adapter, wiring Cartographer webhooks to enqueue Lighthouse work, and adding a dedicated Lighthouse “handler” service/infra to run workers plus periodic jobs.

Changes:

  • Added @chimera-monorepo/mqclient (BullMQ wrapper) and integrated it into Cartographer handler (enqueue) and Lighthouse (workers + schedulers).
  • Added Solana/Tron webhook pipeline templates + configs, and enhanced subgraph deployment tooling to auto-detect version labels and optionally deploy webhooks.
  • Introduced mainnet-staging Terraform + CI changes for a new Lighthouse handler ECS service and a Redis queue cache.

Reviewed changes

Copilot reviewed 58 out of 59 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
yarn.lock Adds BullMQ/Redis-related dependencies and new workspace package entries.
packages/subgraph/src/common/network.ts Adds chainId mappings for megaeth-mainnet and plasma-mainnet.
packages/subgraph/src/cartographer-webhooks/tron-webhook.template.yaml New Goldsky pipeline template for Tron raw logs → webhook.
packages/subgraph/src/cartographer-webhooks/solana-webhook.template.yaml New Goldsky pipeline template for Solana instructions → webhook.
packages/subgraph/scripts/utils.ts Adds helper to query Goldsky for latest subgraph label (and optionally increment).
packages/subgraph/scripts/deploy.ts Adds auto-label detection and optional webhook deployment post-subgraph deploy.
packages/subgraph/scripts/deploy-webhooks.ts Refactors webhook deploy script into reusable function + adds Solana/Tron pipeline support and auto-labeling.
packages/subgraph/package.json Updates deploy scripts to use auto-labeling and --with-webhooks; simplifies webhook deploy scripts.
packages/subgraph/config/everclear-tron-webhooks-staging.json New Tron staging webhook pipeline config.
packages/subgraph/config/everclear-tron-webhooks-production.json New Tron production webhook pipeline config.
packages/subgraph/config/everclear-spoke-webhooks-staging.json Updates spoke webhook configs for megaeth-mainnet / plasma-mainnet network naming.
packages/subgraph/config/everclear-spoke-staging.json Adds spoke subgraph configs for plasma + megaeth (staging).
packages/subgraph/config/everclear-spoke-production.json Adds spoke subgraph configs for plasma + megaeth (production).
packages/subgraph/config/everclear-solana-webhooks-staging.json New Solana staging webhook pipeline config.
packages/subgraph/config/everclear-solana-webhooks-production.json New Solana production webhook pipeline config.
packages/subgraph/README.md Documents new deploy flows and CLI options.
packages/contracts/deployments/staging/9745/SpokeGateway.json Adds staging deployment artifact for domain 9745.
packages/contracts/deployments/staging/9745/FeeAdapter.json Adds staging deployment artifact for domain 9745.
packages/contracts/deployments/staging/4326/SpokeGateway.json Adds staging deployment artifact for domain 4326.
packages/contracts/deployments/staging/4326/FeeAdapter.json Adds staging deployment artifact for domain 4326.
packages/contracts/deployments/production/9745/SpokeGateway.json Adds production deployment artifact for domain 9745.
packages/contracts/deployments/production/324/FeeAdapter.json Updates production deployment address for domain 324 FeeAdapter.
packages/agents/lighthouse/tsconfig.build.json Adds project reference to mqclient.
packages/agents/lighthouse/src/tasks/invoice/processDepositsAndInvoices.ts Fixes variable naming typo (configuedconfigured).
packages/agents/lighthouse/src/tasks/clearing/processExpiredIntents.ts Fixes docstring spelling and keeps early-return behavior with improved logging.
packages/agents/lighthouse/src/server.ts New Fastify server + BullMQ workers and repeatable jobs for Lighthouse handler mode.
packages/agents/lighthouse/src/context.ts Refactors context initialization for reuse by handler mode; updates task wrapper behavior.
packages/agents/lighthouse/src/config.ts Extends config schema to include handler service, redisUrl, and adminToken.
packages/agents/lighthouse/package.json Adds handler start script and dependencies (mqclient, fastify).
packages/agents/cartographer/handler/tsconfig.build.json Adds project reference to mqclient.
packages/agents/cartographer/handler/test/processors/tronLogProcessor.spec.ts New unit tests for Tron topic→queue routing.
packages/agents/cartographer/handler/test/processors/solanaInstructionProcessor.spec.ts New unit tests for Solana discriminator→queue routing.
packages/agents/cartographer/handler/src/webhooks/webhookHandler.ts Adds webhook routes for Solana/Tron and integrates new processors.
packages/agents/cartographer/handler/src/processors/tronLogProcessor.ts New processor mapping Tron log topics to Lighthouse queues.
packages/agents/cartographer/handler/src/processors/solanaInstructionProcessor.ts New processor decoding Solana instruction data and mapping discriminators to queues.
packages/agents/cartographer/handler/src/processors/monitorProcessor.ts Notifies Lighthouse queues for settlement/fill message events.
packages/agents/cartographer/handler/src/processors/invoiceProcessor.ts Notifies Lighthouse invoice queue on invoice/deposit events.
packages/agents/cartographer/handler/src/processors/intentProcessor.ts Notifies Lighthouse intent/fill queues on intent-related events.
packages/agents/cartographer/handler/src/notify.ts New BullMQ enqueue helper with queue init/close + basic dedupe.
packages/agents/cartographer/handler/src/init.ts Adds optional redisUrl to handler config from env.
packages/agents/cartographer/handler/src/index.ts Initializes/closes BullMQ notification queues; fixes backfill timeout naming/cleanup.
packages/agents/cartographer/handler/package.json Adds mqclient + bs58 dependencies.
packages/adapters/mqclient/tsconfig.json Adds TypeScript project config for mqclient package.
packages/adapters/mqclient/tsconfig.build.json Adds composite build config for mqclient package.
packages/adapters/mqclient/src/index.ts Implements BullMQ producer/worker helpers and queue name constants.
packages/adapters/mqclient/package.json Introduces new workspace package for BullMQ integration.
package.json Registers packages/adapters/mqclient workspace.
ops/mainnet/staging/core/variables.tf Adds lighthouse_handler_image_tag variable.
ops/mainnet/staging/core/outputs.tf Exposes Redis URL output for the Lighthouse queue cache.
ops/mainnet/staging/core/main.tf Adds ECS service for lighthouse handler and provisions a Redis cache for queueing.
ops/mainnet/staging/core/config.tf Adds environment variables for lighthouse handler service, including REDIS_URL.
ops/mainnet/staging/backend/main.tf Adds remote state reference to core outputs.
ops/mainnet/staging/backend/config.tf Passes REDIS_URL to cartographer handler service env.
docker/lighthouse-handler/Dockerfile New Docker image build for Lighthouse handler runtime.
.github/workflows/build-test-deploy.yml Adds CI build/push for lighthouse-handler image and wires it into mainnet-staging terraform job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@otsybizov otsybizov closed this Mar 13, 2026
@otsybizov otsybizov deleted the feat/event-driven-lighthouse branch March 13, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants