Skip to content

Commit

Permalink
Rename StateTransitionData and StateTransition (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyusufatik authored Nov 5, 2024
1 parent df7519e commit 4f86cea
Show file tree
Hide file tree
Showing 21 changed files with 176 additions and 194 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/citrea/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ rustc_version_runtime = { workspace = true }
# bitcoin-e2e dependencies
bitcoin.workspace = true
bitcoincore-rpc.workspace = true
citrea-e2e = { git = "https://github.com/chainwayxyz/citrea-e2e", rev = "07914ec" }
citrea-e2e = { git = "https://github.com/chainwayxyz/citrea-e2e", rev = "faf3414" }

[build-dependencies]
sp1-helper = { version = "3.0.0", default-features = false }
Expand Down
6 changes: 3 additions & 3 deletions bin/citrea/tests/bitcoin_e2e/batch_prover_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl TestCase for BasicProverTest {

{
// print some debug info about state diff
let state_diff = &proofs[0].state_transition.state_diff;
let state_diff = &proofs[0].proof_output.state_diff;
let state_diff_size: usize = state_diff
.iter()
.map(|(k, v)| k.len() + v.as_ref().map(|v| v.len()).unwrap_or_default())
Expand Down Expand Up @@ -231,7 +231,7 @@ impl TestCase for SkipPreprovenCommitmentsTest {
assert!(proofs
.first()
.unwrap()
.state_transition
.proof_output
.preproven_commitments
.is_empty());

Expand Down Expand Up @@ -302,7 +302,7 @@ impl TestCase for SkipPreprovenCommitmentsTest {
proofs
.first()
.unwrap()
.state_transition
.proof_output
.preproven_commitments
.len(),
1
Expand Down
24 changes: 9 additions & 15 deletions bin/citrea/tests/e2e/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use citrea_evm::smart_contracts::SimpleStorageContract;
use citrea_stf::genesis_config::GenesisPaths;
use reth_primitives::{Address, BlockNumberOrTag, U256};
use sov_mock_da::{MockAddress, MockDaService};
use sov_rollup_interface::rpc::{LastVerifiedProofResponse, SoftConfirmationStatus};
use sov_rollup_interface::rpc::{LastVerifiedBatchProofResponse, SoftConfirmationStatus};
use sov_rollup_interface::services::da::DaService;
use tokio::task::JoinHandle;

Expand Down Expand Up @@ -207,7 +207,7 @@ async fn test_all_flow() {
.await
.unwrap();

let LastVerifiedProofResponse {
let LastVerifiedBatchProofResponse {
proof: last_proof,
height: proof_l1_height,
} = full_node_test_client
Expand All @@ -219,15 +219,9 @@ async fn test_all_flow() {

assert_eq!(proof_l1_height, 4);
assert_eq!(last_proof.proof, full_node_proof[0].proof);
assert_eq!(
last_proof.state_transition,
full_node_proof[0].state_transition
);
assert_eq!(last_proof.proof_output, full_node_proof[0].proof_output);

assert_eq!(
prover_proof.state_transition,
full_node_proof[0].state_transition
);
assert_eq!(prover_proof.proof_output, full_node_proof[0].proof_output);

full_node_test_client
.ledger_get_soft_confirmation_status(5)
Expand Down Expand Up @@ -299,7 +293,7 @@ async fn test_all_flow() {
.await
.unwrap();

let LastVerifiedProofResponse {
let LastVerifiedBatchProofResponse {
proof: last_proof,
height: proof_l1_height,
} = full_node_test_client
Expand All @@ -309,14 +303,14 @@ async fn test_all_flow() {
assert_eq!(proof_l1_height, 6);
assert_eq!(last_proof.proof, full_node_proof_data[0].proof);
assert_eq!(
last_proof.state_transition,
full_node_proof_data[0].state_transition
last_proof.proof_output,
full_node_proof_data[0].proof_output
);

assert_eq!(prover_proof_data.proof, full_node_proof_data[0].proof);
assert_eq!(
prover_proof_data.state_transition,
full_node_proof_data[0].state_transition
prover_proof_data.proof_output,
full_node_proof_data[0].proof_output
);

let balance = full_node_test_client
Expand Down
10 changes: 2 additions & 8 deletions bin/citrea/tests/e2e/proving.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,7 @@ async fn full_node_verify_proof_and_store() {
.unwrap();
assert_eq!(prover_proof.proof, full_node_proof[0].proof);

assert_eq!(
prover_proof.state_transition,
full_node_proof[0].state_transition
);
assert_eq!(prover_proof.proof_output, full_node_proof[0].proof_output);

full_node_test_client
.ledger_get_soft_confirmation_status(5)
Expand Down Expand Up @@ -343,10 +340,7 @@ async fn test_prover_prove_rpc() {
.unwrap();
assert_eq!(prover_proof.proof, full_node_proof[0].proof);

assert_eq!(
prover_proof.state_transition,
full_node_proof[0].state_transition
);
assert_eq!(prover_proof.proof_output, full_node_proof[0].proof_output);

full_node_test_client
.ledger_get_soft_confirmation_status(5)
Expand Down
8 changes: 4 additions & 4 deletions bin/citrea/tests/test_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use reth_rpc_types::trace::geth::{GethDebugTracingOptions, GethTrace};
use reth_rpc_types::RichBlock;
use sequencer_client::GetSoftConfirmationResponse;
use sov_rollup_interface::rpc::{
BatchProofResponse, LastVerifiedProofResponse, SequencerCommitmentResponse,
SoftConfirmationResponse, SoftConfirmationStatus, VerifiedProofResponse,
BatchProofResponse, LastVerifiedBatchProofResponse, SequencerCommitmentResponse,
SoftConfirmationResponse, SoftConfirmationStatus, VerifiedBatchProofResponse,
};

pub const SEND_ETH_GAS: u128 = 21001;
Expand Down Expand Up @@ -546,7 +546,7 @@ impl TestClient {
pub(crate) async fn ledger_get_verified_batch_proofs_by_slot_height(
&self,
height: u64,
) -> Option<Vec<VerifiedProofResponse>> {
) -> Option<Vec<VerifiedBatchProofResponse>> {
self.http_client
.request(
"ledger_getVerifiedBatchProofsBySlotHeight",
Expand All @@ -558,7 +558,7 @@ impl TestClient {

pub(crate) async fn ledger_get_last_verified_batch_proof(
&self,
) -> Option<LastVerifiedProofResponse> {
) -> Option<LastVerifiedBatchProofResponse> {
self.http_client
.request("ledger_getLastVerifiedBatchProof", rpc_params![])
.await
Expand Down
8 changes: 4 additions & 4 deletions crates/batch-prover/src/da_block_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ where
)
.await;

let (sequencer_commitments, state_transitions) = match data_to_prove {
Ok((commitments, transitions)) => (commitments, transitions),
let (sequencer_commitments, inputs) = match data_to_prove {
Ok((commitments, inputs)) => (commitments, inputs),
Err(e) => match e {
L1ProcessingError::NoSeqCommitments { l1_height } => {
info!("No sequencer commitment found at height {}", l1_height,);
Expand Down Expand Up @@ -243,7 +243,7 @@ where
self.code_commitments_by_spec.clone(),
l1_block.clone(),
sequencer_commitments,
state_transitions,
inputs,
)
.await?;
} else {
Expand Down Expand Up @@ -332,7 +332,7 @@ async fn sync_l1<Da>(
}
}

pub(crate) async fn get_state_transition_data_from_commitments<
pub(crate) async fn get_batch_proof_circuit_input_from_commitments<
Da: DaService,
DB: BatchProverLedgerOps,
Witness: DeserializeOwned,
Expand Down
Loading

0 comments on commit 4f86cea

Please sign in to comment.