Skip to content

apollo_batcher: bootstrap PART 1#12680

Closed
victorkstarkware wants to merge 1 commit intomain-v0.14.2from
02-17-apollo_batcher_bootstrap_part_1
Closed

apollo_batcher: bootstrap PART 1#12680
victorkstarkware wants to merge 1 commit intomain-v0.14.2from
02-17-apollo_batcher_bootstrap_part_1

Conversation

@victorkstarkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

victorkstarkware commented Feb 17, 2026

@github-actions
Copy link

github-actions bot commented Feb 17, 2026

Copy link
Collaborator

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

@Itay-Tsabary-Starkware made 1 comment.
Reviewable status: 0 of 13 files reviewed, 1 unresolved discussion (waiting on victorkstarkware).


-- commits line 2 at r1:
Please name the branch and the commit message according to the content that it adds

Code quote:

- 6aaafd9: apollo_batcher: bootstrap PART 1

Copy link
Collaborator

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

@Itay-Tsabary-Starkware made 2 comments.
Reviewable status: 0 of 13 files reviewed, 3 unresolved discussions (waiting on victorkstarkware).


crates/apollo_batcher/Cargo.toml line 37 at r1 (raw file):

async-trait.workspace = true
blockifier.workspace = true
blockifier_test_utils.workspace = true

We should not have test_utils crate as a dependency of a production code.
If there are prod-grade modules there then they should be moved to a proper location instead.

Code quote:

blockifier_test_utils.workspace = true

crates/apollo_batcher/src/bootstrap.rs line 651 at r1 (raw file):

        assert_ne!(sm1.strk_address(), ContractAddress::default());
    }
}

Please move all test code to a different file / module

Copy link
Collaborator

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

@Itay-Tsabary-Starkware made 1 comment.
Reviewable status: 0 of 13 files reviewed, 4 unresolved discussions (waiting on victorkstarkware).


crates/apollo_batcher/src/bootstrap.rs line 75 at r1 (raw file):

    /// Deterministic address of the STRK fee token contract.
    strk_address: ContractAddress,
}

This pr is way too large, please find a way to split it into meaningful smaller-responsibility prs

Code quote:

/// Manages the bootstrap process for initializing a fresh node with required contracts.
///
/// The bootstrap state is derived from actual storage contents (class declarations,
/// contract deployments, nonce values, and storage variables), making the state machine
/// idempotent and crash-safe regardless of how many blocks have been produced.
pub struct BootstrapStateMachine {
    bootstrap_enabled: bool,
    /// Sierra contract class for the account contract.
    account_contract_class: SierraContractClass,
    /// Class hash of the account contract (computed from the Sierra class).
    account_class_hash: ClassHash,
    /// Compiled class hash of the account contract.
    account_compiled_class_hash: CompiledClassHash,
    /// Sierra contract class for the ERC20 fee token contract.
    erc20_contract_class: SierraContractClass,
    /// Class hash of the ERC20 contract (computed from the Sierra class).
    erc20_class_hash: ClassHash,
    /// Compiled class hash of the ERC20 contract.
    erc20_compiled_class_hash: CompiledClassHash,
    /// Deterministic address of the funded account (computed from deploy account params).
    account_address: ContractAddress,
    /// Deterministic address of the STRK fee token contract.
    strk_address: ContractAddress,
}

Copy link
Collaborator

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

@Itay-Tsabary-Starkware made 1 comment.
Reviewable status: 0 of 13 files reviewed, 5 unresolved discussions (waiting on victorkstarkware).


crates/apollo_batcher_types/src/bootstrap_types.rs line 16 at r1 (raw file):

    /// Fourth phase: fund the account via the ERC20's `initial_funding`.
    FundAccount,
}

apollo_batcher_types crate is for infra communication with the batcher component.
Which other crates are intended to depend on this code?

Code quote:

use serde::{Deserialize, Serialize};

/// The state of the bootstrap process.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum BootstrapState {
    /// Bootstrap is not active (either disabled or already complete).
    NotInBootstrap,
    /// First phase: declare the account and ERC20 contract classes.
    DeclareContracts,
    /// Second phase: deploy the funded account.
    DeployAccount,
    /// Third phase: deploy the STRK ERC20 fee token.
    DeployToken,
    /// Fourth phase: fund the account via the ERC20's `initial_funding`.
    FundAccount,
}

Copy link
Collaborator

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

@Itay-Tsabary-Starkware made 1 comment.
Reviewable status: 0 of 13 files reviewed, 5 unresolved discussions (waiting on victorkstarkware).


crates/apollo_batcher_types/src/bootstrap_types.rs line 16 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

apollo_batcher_types crate is for infra communication with the batcher component.
Which other crates are intended to depend on this code?

Does it make sense to have a fn next here that returns the next state?

Copy link
Collaborator

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

@Itay-Tsabary-Starkware made 1 comment.
Reviewable status: 0 of 13 files reviewed, 6 unresolved discussions (waiting on victorkstarkware).


crates/blockifier_test_utils/resources/feature_contracts/cairo1/dummy_account.cairo line 2 at r1 (raw file):

#[starknet::contract(account)]
mod account {

Where is this copied from?

Code quote:

mod account {

Co-authored-by: Cursor <cursoragent@cursor.com>
@victorkstarkware victorkstarkware force-pushed the 02-17-apollo_batcher_bootstrap_part_1 branch from 6aaafd9 to 31f219f Compare February 22, 2026 16:32
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants