Skip to content

starknet_committer: extract commit plan to commit_or_load#13999

Merged
ArielElp merged 1 commit into
mainfrom
ariel/commit_or_load
May 31, 2026
Merged

starknet_committer: extract commit plan to commit_or_load#13999
ArielElp merged 1 commit into
mainfrom
ariel/commit_or_load

Conversation

@ArielElp
Copy link
Copy Markdown
Contributor

@ArielElp ArielElp commented May 7, 2026

No description provided.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Contributor Author

ArielElp commented May 7, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch from de52d79 to c3b74da Compare May 7, 2026 12:40
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from 26338f3 to 5337544 Compare May 7, 2026 12:40
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch from c3b74da to 7eb2f0e Compare May 14, 2026 08:43
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch 2 times, most recently from 110f567 to c65f356 Compare May 18, 2026 11:56
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch 2 times, most recently from 82e9411 to ff1915d Compare May 18, 2026 13:52
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from c65f356 to 79c4633 Compare May 18, 2026 13:52
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch from ff1915d to 1a13989 Compare May 19, 2026 06:55
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch 2 times, most recently from 22b07fe to 85fb96f Compare May 19, 2026 07:08
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch from 1a13989 to 1fd4ef8 Compare May 19, 2026 07:08
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from 8111fe7 to d8145ef Compare May 26, 2026 10:48
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch from 6bcc7c0 to 57671ad Compare May 26, 2026 11:42
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from d8145ef to 051f86a Compare May 26, 2026 11:42
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch from 57671ad to b5ab234 Compare May 26, 2026 13:03
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from 051f86a to 07c4218 Compare May 26, 2026 13:03
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch from b5ab234 to a2756a6 Compare May 26, 2026 13:11
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from 07c4218 to 2110c62 Compare May 26, 2026 13:11
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch from a2756a6 to d645ed9 Compare May 27, 2026 07:23
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from 2110c62 to b4c438c Compare May 27, 2026 07:23
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from b4c438c to c7b7cfa Compare May 27, 2026 09:45
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch 2 times, most recently from 9dad213 to 83bf995 Compare May 27, 2026 11:52
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from c7b7cfa to 546ab30 Compare May 27, 2026 11:52
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch from 83bf995 to d5690c8 Compare May 27, 2026 12:00
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from 546ab30 to 2568de5 Compare May 27, 2026 12:00
@ArielElp ArielElp force-pushed the ariel/index_db_read_and_write_proofs branch from d5690c8 to c15a08f Compare May 27, 2026 12:20
@ArielElp ArielElp force-pushed the ariel/commit_or_load branch from 2568de5 to ec0eac3 Compare May 27, 2026 12:20
Copy link
Copy Markdown
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

@dorimedini-starkware reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ArielElp).


crates/apollo_committer/src/committer.rs line 98 at r2 (raw file):

    /// `height` is already committed; return the stored global root without writing.
    Historical { global_root: GlobalRoot },
    /// `height` is the chain tip; inputs are validated and ready to commit.

Suggestion:

/// `height` is the next uncommitted offset;

crates/apollo_committer/src/committer.rs line 207 at r2 (raw file):

                update_metrics(height, &block_measurements.block_measurement);
                self.update_offset(next_offset);
                Ok(CommitBlockResponse { global_root })

no changes here, right? cut-paste?

Code quote:

                // Happy flow. Commits the state diff and returns the computed global root.
                debug!(
                    "Committing block number {height} with state diff {state_diff_commitment:?}"
                );
                let mut block_measurements = SingleBlockMeasurements::default();
                block_measurements.start_measurement(Action::EndToEnd);
                let CommitStateDiffOutput { filled_forest, global_root, deleted_nodes } =
                    self.commit_state_diff(state_diff, &mut block_measurements).await?;
                let next_offset = height.unchecked_next();
                let metadata = HashMap::from([
                    (
                        ForestMetadataType::CommitmentOffset,
                        DbValue(DbBlockNumber(next_offset).serialize().to_vec()),
                    ),
                    (
                        ForestMetadataType::StateRoot(DbBlockNumber(height)),
                        serialize_felt_no_packing(global_root.0),
                    ),
                    (
                        ForestMetadataType::StateDiffHash(DbBlockNumber(height)),
                        serialize_felt_no_packing(state_diff_commitment.0.0),
                    ),
                ]);
                info!(
                    "For block number {height}, writing filled forest to storage with metadata: \
                     {metadata:?}, delete {} nodes",
                    deleted_nodes.len()
                );
                block_measurements.start_measurement(Action::Write);
                let n_write_entries = self
                    .forest_storage
                    .write_with_metadata(&filled_forest, metadata, deleted_nodes)
                    .await
                    .map_err(|err| self.map_internal_error(err))?;
                block_measurements.attempt_to_stop_measurement(Action::Write, n_write_entries).ok();
                block_measurements.attempt_to_stop_measurement(Action::EndToEnd, 0).ok();
                update_metrics(height, &block_measurements.block_measurement);
                self.update_offset(next_offset);
                Ok(CommitBlockResponse { global_root })

Copy link
Copy Markdown
Contributor Author

@ArielElp ArielElp left a comment

Choose a reason for hiding this comment

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

@ArielElp made 2 comments.
Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware and yoavGrs).


crates/apollo_committer/src/committer.rs line 207 at r2 (raw file):

Previously, dorimedini-starkware wrote…

no changes here, right? cut-paste?

yes


crates/apollo_committer/src/committer.rs line 98 at r2 (raw file):

    /// `height` is already committed; return the stored global root without writing.
    Historical { global_root: GlobalRoot },
    /// `height` is the chain tip; inputs are validated and ready to commit.

Done.

Copy link
Copy Markdown
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

@dorimedini-starkware reviewed 1 file and all commit messages, and resolved 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ArielElp).

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 28, 2026

Merge activity

  • May 28, 2:58 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

Copy link
Copy Markdown
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

@dorimedini-starkware reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ArielElp).

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.

4 participants