feat: index public call requests from pending transactions#540
feat: index public call requests from pending transactions#540
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds support for extracting, storing, and indexing public call requests from pending L2 transactions via new API endpoints.
- Introduces three new GET endpoints to fetch public call requests by transaction hash, contract address, or sender address.
- Defines a new
tx_public_call_requesttable in the database schema with controllers to store, retrieve, and delete entries. - Integrates public call request handling into transaction storage and dropped‐transaction cleanup logic.
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| services/explorer-api/src/svcs/http-server/routes/paths_and_validation.ts | Added new path constants and Zod schema for public call requests |
| services/explorer-api/src/svcs/http-server/routes/index.ts | Registered new routes for public call request endpoints |
| services/explorer-api/src/svcs/http-server/routes/controllers/public-call.ts | Implemented controllers and OpenAPI specs for public call requests |
| services/explorer-api/src/svcs/http-server/routes/controllers/index.ts | Exported the new public-call controller |
| services/explorer-api/src/svcs/database/schema/l2tx/index.ts | Extended l2Tx relations to include many public call requests |
| services/explorer-api/src/svcs/database/schema/l2public-call/index.ts | Defined the tx_public_call_request table and relations |
| services/explorer-api/src/svcs/database/controllers/l2Tx/store.ts | Hooked into transaction storage to persist public call requests |
| services/explorer-api/src/svcs/database/controllers/l2Tx/get-tx.ts | Augmented transaction fetch to include stored public call requests |
| services/explorer-api/src/svcs/database/controllers/l2Public-call/store.ts | Created store logic to upsert public call requests |
| services/explorer-api/src/svcs/database/controllers/l2Public-call/get.ts | Added retrieval functions for public call requests |
| services/explorer-api/src/svcs/database/controllers/l2Public-call/delete.ts | Added deletion logic for public call requests |
| services/explorer-api/src/svcs/database/controllers/index.ts | Exported the new l2PublicCall controller namespace |
| services/explorer-api/src/events/received/on-dropped-txs.ts | Cleaned up public call requests when a transaction is dropped |
| services/explorer-api/migrations/meta/_journal.json | Updated journal metadata (note: no new migration script present) |
Comments suppressed due to low confidence (1)
services/explorer-api/src/svcs/database/schema/l2public-call/index.ts:1
- New table
tx_public_call_requestis defined but no corresponding migration script was added; ensure a migration is created to persist this schema in the database.
import { generateAztecAddressColumn } from "@chicmoz-pkg/backend-utils";
- Add callType (non_revertible/revertible/teardown) to PublicCallRequest schema - Extend ChicmozL2PendingTx with gas settings, gas used, expiration timestamp, fee payment method, and summary counts (note hashes, nullifiers, L2->L1 msgs, private logs) - Extract teardown call request alongside non-revertible and revertible calls - Fix await bug: tx.getTxHash() is synchronous in v4 - Add new columns to l2Tx DB table for all new fields - Add call_type enum column to tx_public_call_request table - Fix typo: getPublicCallRequessByAddressSchema -> getPublicCallRequestsByAddressSchema - Update OpenAPI schemas to include callType field - Generate migration 0011_flippant_thunderbolt for new table and columns
- Replace SetPublicAuthwitContractInteraction with wallet.createAuthWit using
CallIntent (call + getFunctionCall) for burn_private — private functions
require a local auth witness, not an on-chain public authwit
- Use .with({ authWitnesses }) instead of .withAuthWit (correct API)
- Enable SCENARIO_L1L2_PUBLIC_MESSAGING and SCENARIO_L1L2_PRIVATE_MESSAGING
- Set INIFINITE_LOOP=true to prevent CrashLoopBackOff in k8s
…(frontend)/index-public-data-from-pending-tx
…(frontend)/index-public-data-from-pending-tx
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 72 out of 73 changed files in this pull request and generated 9 comments.
Files not reviewed (1)
- .opencode/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| status: status as (typeof sourceVerificationJobs.$inferInsert)["status"], | ||
| error: error ?? null, | ||
| failureStage: failureStage ?? null, | ||
| failureStage: (failureStage ?? |
There was a problem hiding this comment.
Erm, don't know why this change is here?
There was a problem hiding this comment.
This change came in from main during the merge commit 3b8bcac — it's not part of the public call requests feature. It adds failureStage, compileOutput, and aztecVersion parameters to updateSourceVerificationJobStatus (moving aztecVersion from create-time to update-time). No action needed here.
There was a problem hiding this comment.
If it is the same as main then there should be no changes to this file - right?
There was a problem hiding this comment.
@copilot why is there a diff when it should be the same as main?
There was a problem hiding this comment.
Correct — it should not have differed. The merge commit 3b8bcac introduced a merge artifact where the type annotation diverged (Partial<typeof sourceVerificationJobs.$inferInsert> vs main's Record<string, unknown>). Fixed in commit f4b793b by checking out the file directly from main, so there is now zero diff between the branch and main for this file.
|
@copilot apply changes based on the comments in this thread |
…, Link, import type Co-authored-by: Mautjee <19729404+Mautjee@users.noreply.github.com>
Applied in commit d80b9d0:
|
…act) Agent-Logs-Url: https://github.com/aztec-scan/chicmoz/sessions/0ff603d5-271e-4369-95d0-6f899c1b13d8 Co-authored-by: Mautjee <19729404+Mautjee@users.noreply.github.com>
|
@copilot can you check the command and if they are still valid and close the commands that you have done |
All items from the review are complete and verified:
|
Add support for extracting and storing public call requests from pending transactions with new API endpoints