Skip to content

Conversation

@MarcosNicolau
Copy link
Member

@MarcosNicolau MarcosNicolau commented Dec 18, 2025

Description

Adds support for multiple databases and retry logic to the following components:

  • PaymentsPoller
  • Gateway
  • ProofAggregator

To enable this, a new module/struct called DbOrchestrator was introduced. It is responsible for handling retry logic and selecting the appropriate database. The DbOrchestrator exposes two methods:

  • Write: Orders the databases by prioritizing those that have previously succeeded, placing them at the beginning of the list.
  • Read: Orders the databases by deprioritizing those that have previously failed, placing them at the end of the list.

This design reflects the architecture where there is a single primary database for writes, while all other databases are read-only.

How to test

  1. Start ethereum package:
make ethereum_package_start
  1. Start gateway
make agg_mode_gateway_start_ethereum_package
  1. Start poller:
make agg_mode_payments_poller_start_ethereum_package
  1. Send proofs:
make agg_mode_gateway_send_payment
make agg_mode_gateway_send_sp1_proof
  1. Start proof aggregator:
make proof_aggregator_start_ethereum_package

Type of change

Please delete options that are not relevant.

  • New feature
  • Bug fix
  • Optimization
  • Refactor

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change crates/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

@MarcosNicolau MarcosNicolau self-assigned this Dec 18, 2025
@MarcosNicolau MarcosNicolau force-pushed the feat/support-multiple-dbs branch from 430d4db to 5340365 Compare December 18, 2025 19:02
@MarcosNicolau MarcosNicolau marked this pull request as ready for review December 19, 2025 20:50
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