Skip to content

feat: Better DB transaction API - #3005

Open
kpp wants to merge 13 commits into
nightlyfrom
kpp/db_tx_api
Open

feat: Better DB transaction API#3005
kpp wants to merge 13 commits into
nightlyfrom
kpp/db_tx_api

Conversation

@kpp

@kpp kpp commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

Linked Issues

Copilot AI review requested due to automatic review settings October 30, 2025 01:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new LedgerTx struct that provides a transaction-like API for batching multiple ledger database operations together. The implementation uses ManuallyDrop to ensure that schema changes are not silently dropped without being explicitly committed or rejected.

  • Adds LedgerTx struct with ManuallyDrop<SchemaBatch> wrapper
  • Provides methods to add state diffs and L2 blocks to a transaction
  • Implements explicit commit and reject methods for transaction control

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

Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
@codecov

codecov Bot commented Oct 30, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.53350% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.7%. Comparing base (7562f51) to head (7096c4b).
⚠️ Report is 14 commits behind head on nightly.

Files with missing lines Patch % Lines
...reign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs 68.1% 7 Missing ⚠️
crates/fullnode/src/da_block_handler.rs 97.0% 6 Missing ⚠️
crates/light-client-prover/src/da_block_handler.rs 93.1% 2 Missing ⚠️
crates/batch-prover/src/l2_syncer.rs 88.8% 1 Missing ⚠️
crates/fullnode/src/l2_syncer.rs 85.7% 1 Missing ⚠️
...sdk/full-node/db/sov-schema-db/src/schema_batch.rs 92.3% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
bin/citrea/src/rollup/mod.rs 86.3% <ø> (ø)
crates/batch-prover/src/l1_syncer.rs 94.7% <100.0%> (+0.5%) ⬆️
crates/batch-prover/src/lib.rs 98.6% <100.0%> (-0.2%) ⬇️
crates/batch-prover/src/prover.rs 97.6% <100.0%> (+<0.1%) ⬆️
crates/batch-prover/src/rpc.rs 93.4% <100.0%> (+0.3%) ⬆️
crates/common/src/l2.rs 71.9% <ø> (-1.2%) ⬇️
crates/fullnode/src/lib.rs 98.4% <100.0%> (-0.1%) ⬇️
crates/light-client-prover/src/rpc.rs 98.3% <100.0%> (-0.1%) ⬇️
crates/light-client-prover/src/services.rs 100.0% <100.0%> (ø)
crates/sequencer/src/runner.rs 92.7% <100.0%> (+1.1%) ⬆️
... and 9 more

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kpp kpp self-assigned this Oct 31, 2025
Copilot AI review requested due to automatic review settings October 31, 2025 06:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

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


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

Comment thread crates/sovereign-sdk/full-node/db/sov-schema-db/src/lib.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-schema-db/src/lib.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Copilot AI review requested due to automatic review settings November 14, 2025 06:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 18 out of 20 changed files in this pull request and generated 9 comments.


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

Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-schema-db/src/iterator.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Comment thread crates/fullnode/src/da_block_handler.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-schema-db/src/lib.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-schema-db/src/lib.rs Outdated
Comment thread crates/batch-prover/src/rpc.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs
Copilot AI review requested due to automatic review settings November 21, 2025 04:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 21 out of 23 changed files in this pull request and generated 9 comments.


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

Comment thread crates/sovereign-sdk/full-node/db/sov-schema-db/src/lib.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-schema-db/src/lib.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-schema-db/src/iterator.rs Outdated
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
Comment thread crates/batch-prover/src/rpc.rs Outdated
Comment thread crates/light-client-prover/src/da_block_handler.rs
Comment thread crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs Outdated
@kpp
kpp requested review from Copilot and removed request for Copilot November 27, 2025 23:32
@kpp
kpp marked this pull request as ready for review December 5, 2025 06:31
@kpp
kpp requested a review from a team as a code owner December 5, 2025 06:31
@kpp kpp changed the title [WIP] Better DB transaction API feat: Better DB transaction API Dec 12, 2025
@github-actions

Copy link
Copy Markdown

⚠️ Changelog entry missing

No changes detected in CHANGELOG.md.

Recommendation:

feat: Better DB transaction API

Please add an entry to the CHANGELOG.md or dismiss this if the change doesn't require documentation.

To dismiss: Reply with /skip-changelog in any comment.

@exeokan exeokan self-assigned this Mar 2, 2026
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.

Better DB transaction API

3 participants