apollo_batcher: bootstrap PART 1#12680
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
7681d77 to
cf00af9
Compare
ef576ed to
6aaafd9
Compare
Itay-Tsabary-Starkware
left a comment
There was a problem hiding this comment.
@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
Itay-Tsabary-Starkware
left a comment
There was a problem hiding this comment.
@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 = truecrates/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
Itay-Tsabary-Starkware
left a comment
There was a problem hiding this comment.
@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,
}
Itay-Tsabary-Starkware
left a comment
There was a problem hiding this comment.
@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,
}
Itay-Tsabary-Starkware
left a comment
There was a problem hiding this comment.
@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_typescrate 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?
Itay-Tsabary-Starkware
left a comment
There was a problem hiding this comment.
@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>
6aaafd9 to
31f219f
Compare

No description provided.