feat: interact with proposer DB instead of RPC#328
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces database-driven proof request handling by adding a new proposer-db-client crate and integrating it into the proposer-service. The changes enable the system to persist proof requests to PostgreSQL and poll for completion status, providing an alternative to the existing RPC-based workflow.
Key Changes:
- New
proposer-db-clientcrate with database client, configuration, and error handling - Database integration in
proposer-servicewith configurable polling and fallback to RPC workflow - Updated dependencies to support PostgreSQL operations and data serialization
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/proposer-db-client/Cargo.toml | Defines dependencies for the new database client crate |
| crates/proposer-db-client/src/lib.rs | Module exports for database client functionality |
| crates/proposer-db-client/src/types.rs | Re-exports types from op-succinct-validity |
| crates/proposer-db-client/src/config.rs | Database configuration with connection pool and polling settings |
| crates/proposer-db-client/src/error.rs | Error types for database operations |
| crates/proposer-db-client/src/client.rs | Database client implementation with insert, query, and polling methods |
| crates/proposer-service/Cargo.toml | Adds database client and serialization dependencies |
| crates/proposer-service/src/config.rs | Adds optional database configuration field |
| crates/proposer-service/src/error.rs | Adds database error variant |
| crates/proposer-service/src/lib.rs | Implements database-driven proof workflow with RPC fallback |
| crates/proposer-service/src/tests/proposer_service_test_program.rs | Sets database field to None in test configuration |
| Cargo.toml | Adds workspace dependencies for database operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Introduce new proposer-db-client crate (config, client, types, error). Wire optional DB client into proposer-service: config, errors, init, and tests. Add sqlx/chrono/bigdecimal deps and workspace entries and update Cargo.lock.
8401c50 to
3250cc5
Compare
Add a helper to mock eth_chainId for L1/L2 and assert those mocks in tests. Relax JSON matching by switching several mockito::Matcher::Json checks to PartialJson to avoid strict ordering, and normalize JSON-RPC response ids to 0 in test responses. Update aggkit-prover-config test snapshots to include the new l2-consensus-layer-rpc-endpoint and snapshot metadata.
bcb3a2b to
5737bc8
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.
This pull request introduces a new
proposer-db-clientcrate for handling database operations related to proof requests, and integrates it into theproposer-service. The changes add database configuration and error handling, and update dependencies to support the new functionality. Below are the most important changes:These changes collectively enable the system to persist, query, and poll for proof requests in a PostgreSQL database, improving reliability and observability of proof generation workflows.
Fixes https://github.com/agglayer/pm/issues/264