Skip to content

DART v1 updates#2

Open
Neopallium wants to merge 16 commits intomainfrom
dart_v1_updates
Open

DART v1 updates#2
Neopallium wants to merge 16 commits intomainfrom
dart_v1_updates

Conversation

@Neopallium
Copy link
Copy Markdown
Collaborator

Use a 10K inner proof size limit. Also use BoundedVec for list of public keys in a few more proofs.

@Neopallium Neopallium requested review from Copilot and lovesh and removed request for lovesh April 30, 2026 11:25
Copy link
Copy Markdown

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

This PR introduces an explicit inner-proof byte-size bound (10 KiB) and expands use of bounded collections across several proof types, making proof serialization more predictable and safer for constrained environments.

Changes:

  • Add MAX_INNER_PROOF_SIZE = 10 * 1024 and thread it through DartLimits as MaxInnerProofSize.
  • Introduce BoundedCanonical<T, S> to store canonically-serialized inner proofs in a BoundedVec<u8, S> and update many proofs to use it.
  • Convert additional public-input collections (e.g., key lists) from Vec to BoundedVec and propagate T: DartLimits generics through proof/host-protocol APIs and tests/benches.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tests/sender_affirmation_verify_test.rs Updates test call sites for new generic proof types.
src/serde_impl.rs Adds serde human-hex support for BoundedVec<u8, _>.
src/error.rs Refactors/extends error variants for new bounds-related failures.
src/bp/mod.rs Adds MaxInnerProofSize to DartLimits, renames limits type, and updates tests for new generics.
src/bp/mint_split.rs Makes finish generic over T: DartLimits and returns bounded-inner proof type.
src/bp/leg/proofs.rs Threads T: DartLimits into settlement leg affirmation proofs and bounds mediator inner proof.
src/bp/leg/instant.rs Threads T: DartLimits into instant settlement affirmations.
src/bp/leg.rs Threads T: DartLimits into settlement leg proof types and bounds inner proof sizes.
src/bp/keys.rs Bounds inner key-registration proofs and maps key-list overflow to new error.
src/bp/key_distribution_proof.rs Uses BoundedVec for recipient public keys and bounds inner proof bytes.
src/bp/fee_split.rs Makes fee split host protocol finish methods generic over T and uses bounded inner proofs.
src/bp/fee.rs Makes fee proofs generic over T and bounds inner proof sizes; updates batched proof container types.
src/bp/encode.rs Introduces BoundedCanonical wrapper for bounded canonical serialization.
src/bp/batched.rs Updates batched proof enum variants to carry T: DartLimits-parameterized proofs.
src/bp/asset.rs Makes minting proof generic over T and stores inner proof bytes via BoundedCanonical.
src/bp/affirmation_proofs.rs Threads T through affirmation split host protocol finish and proof structs; bounds inner proofs.
src/bp/account_reg_split.rs Makes registration split finish generic over T and returns T-parameterized proof.
src/bp/account.rs Makes account registration proof generic over T and bounds inner proof bytes.
dart-testing-cli/src/lib.rs Updates CLI code paths to specify ::<()> for new generic proof APIs.
dart-common/src/lib.rs Adds MAX_INNER_PROOF_SIZE constant (10 KiB).
benches/proof_benchmark.rs Updates benchmark call sites for new generic proof APIs.
benches/fee_payments.rs Updates fee benchmarks for new generic proof APIs.

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

Comment thread src/error.rs
Comment thread src/serde_impl.rs
Comment thread src/bp/leg/instant.rs Outdated
Comment thread src/bp/affirmation_proofs.rs Outdated
Comment thread src/bp/leg/proofs.rs
Comment thread src/bp/encode.rs Outdated
Comment thread src/error.rs Outdated
Comment thread src/bp/mod.rs
Comment thread src/bp/asset.rs Outdated
Comment thread src/bp/affirmation_proofs.rs Outdated
@Neopallium Neopallium changed the title Add inner proof size limit. DART v1 updates May 3, 2026
Copy link
Copy Markdown

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

Copilot reviewed 39 out of 46 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

dart-testing-cli/src/lib.rs:468

  • Schema change adds a NOT NULL height column via CREATE TABLE IF NOT EXISTS .... If an existing DB already has these tables (without height), this will not migrate them, and later inserts/queries that reference height will fail. Consider adding a migration (e.g., ALTER TABLE ... ADD COLUMN height ... DEFAULT ...) or make the column nullable with a default for backward compatibility.
        // Asset tree roots table
        self.conn.execute(
            "CREATE TABLE IF NOT EXISTS asset_root_history (
                id INTEGER PRIMARY KEY AUTOINCREMENT,
                block_number INTEGER NOT NULL,
                height INTEGER NOT NULL,
                root_data BLOB NOT NULL
            )",
            [],
        )?;

        // Account tree roots table
        self.conn.execute(
            "CREATE TABLE IF NOT EXISTS account_root_history (
                id INTEGER PRIMARY KEY AUTOINCREMENT,
                block_number INTEGER NOT NULL,
                height INTEGER NOT NULL,
                root_data BLOB NOT NULL
            )",
            [],
        )?;

Comment thread src/bp/account.rs
Comment thread tests/common/mod.rs
Comment thread tests/common/mod.rs
Comment thread tests/common/mod.rs
Comment thread dart-testing-cli/src/sqlite_curve_tree.rs
Comment thread tests/serialized_objects_test/split.rs
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.

3 participants