From e3807a59f5a761d292c2aaa8a3578f3d83db378e Mon Sep 17 00:00:00 2001 From: otaliptus Date: Mon, 25 Mar 2024 11:38:29 +0300 Subject: [PATCH] Change name --- .../demo-rollup/bitcoin_rollup_config.toml | 2 +- .../demo-rollup/celestia_rollup_config.toml | 2 +- .../mock_dockerized_rollup_config.toml | 2 +- examples/demo-rollup/mock_rollup_config.toml | 2 +- .../demo-rollup/mocknet_rollup_config.toml | 2 +- examples/demo-rollup/tests/e2e/mod.rs | 28 +++++++++---------- .../demo-rollup/tests/evm/archival_state.rs | 2 +- examples/demo-rollup/tests/evm/gas_price.rs | 2 +- examples/demo-rollup/tests/evm/mod.rs | 6 ++-- examples/demo-rollup/tests/evm/tracing.rs | 2 +- examples/demo-rollup/tests/mempool/mod.rs | 2 +- .../tests/sequencer_commitments/mod.rs | 2 +- .../soft_confirmation_rule_enforcer/mod.rs | 2 +- examples/demo-rollup/tests/test_helpers.rs | 4 +-- full-node/chainway-sequencer/src/sequencer.rs | 3 +- full-node/db/sov-db/src/ledger_db/mod.rs | 4 +-- full-node/sov-stf-runner/src/config.rs | 8 +++--- full-node/sov-stf-runner/src/runner.rs | 8 +++--- .../tests/runner_initialization_tests.rs | 4 +-- .../tests/runner_reorg_tests.rs | 4 +-- .../sov-modules-rollup-blueprint/src/lib.rs | 2 +- 21 files changed, 46 insertions(+), 47 deletions(-) diff --git a/examples/demo-rollup/bitcoin_rollup_config.toml b/examples/demo-rollup/bitcoin_rollup_config.toml index fb5a8c7b0..746db006c 100644 --- a/examples/demo-rollup/bitcoin_rollup_config.toml +++ b/examples/demo-rollup/bitcoin_rollup_config.toml @@ -1,6 +1,6 @@ sequencer_public_key = "0000000000000000000000000000000000000000000000000000000000000000" min_soft_confirmations_per_commitment = 1000 -ignore_tx_body = true +include_tx_body = false [da] node_url = "http://localhost:38332" diff --git a/examples/demo-rollup/celestia_rollup_config.toml b/examples/demo-rollup/celestia_rollup_config.toml index 0d9f99e04..22368d078 100644 --- a/examples/demo-rollup/celestia_rollup_config.toml +++ b/examples/demo-rollup/celestia_rollup_config.toml @@ -1,4 +1,4 @@ -ignore_tx_body = true +include_tx_body = false [da] # The JWT used to authenticate with the celestia light client. Instructions for generating this token can be found in the README diff --git a/examples/demo-rollup/mock_dockerized_rollup_config.toml b/examples/demo-rollup/mock_dockerized_rollup_config.toml index 4b54169a8..668fa583e 100644 --- a/examples/demo-rollup/mock_dockerized_rollup_config.toml +++ b/examples/demo-rollup/mock_dockerized_rollup_config.toml @@ -1,5 +1,5 @@ sequencer_public_key = "204040e364c10f2bec9c1fe500a1cd4c247c89d650a01ed7e82caba867877c21" -ignore_tx_body = true +include_tx_body = false [da] sender_address = "0000000000000000000000000000000000000000000000000000000000000000" diff --git a/examples/demo-rollup/mock_rollup_config.toml b/examples/demo-rollup/mock_rollup_config.toml index 94defad95..040cdb09a 100644 --- a/examples/demo-rollup/mock_rollup_config.toml +++ b/examples/demo-rollup/mock_rollup_config.toml @@ -1,5 +1,5 @@ sequencer_public_key = "204040e364c10f2bec9c1fe500a1cd4c247c89d650a01ed7e82caba867877c21" -ignore_tx_body = true +include_tx_body = false [da] sender_address = "0000000000000000000000000000000000000000000000000000000000000000" diff --git a/examples/demo-rollup/mocknet_rollup_config.toml b/examples/demo-rollup/mocknet_rollup_config.toml index 97d6e5710..a5e83f8d1 100644 --- a/examples/demo-rollup/mocknet_rollup_config.toml +++ b/examples/demo-rollup/mocknet_rollup_config.toml @@ -1,6 +1,6 @@ sequencer_public_key = "204040e364c10f2bec9c1fe500a1cd4c247c89d650a01ed7e82caba867877c21" min_soft_confirmations_per_commitment = 1000 -ignore_tx_body = true +include_tx_body = false [da] sender_address = "0000000000000000000000000000000000000000000000000000000000000000" diff --git a/examples/demo-rollup/tests/e2e/mod.rs b/examples/demo-rollup/tests/e2e/mod.rs index 0bbbda27d..4cec0ac9c 100644 --- a/examples/demo-rollup/tests/e2e/mod.rs +++ b/examples/demo-rollup/tests/e2e/mod.rs @@ -55,7 +55,7 @@ async fn initialize_test( NodeMode::SequencerNode, None, config.seq_min_soft_confirmations, - false, + true, ) .await; }); @@ -76,7 +76,7 @@ async fn initialize_test( NodeMode::FullNode(seq_port), None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -110,7 +110,7 @@ async fn test_soft_batch_save() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, None, config.seq_min_soft_confirmations, - false, + true, ) .await; }); @@ -140,7 +140,7 @@ async fn test_soft_batch_save() -> Result<(), anyhow::Error> { NodeMode::FullNode(seq_port), None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -163,7 +163,7 @@ async fn test_soft_batch_save() -> Result<(), anyhow::Error> { NodeMode::FullNode(full_node_port), None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - true, + false, ) .await; }); @@ -246,7 +246,7 @@ async fn test_delayed_sync_ten_blocks() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -277,7 +277,7 @@ async fn test_delayed_sync_ten_blocks() -> Result<(), anyhow::Error> { NodeMode::FullNode(seq_port), None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -339,7 +339,7 @@ async fn test_close_and_reopen_full_node() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -360,7 +360,7 @@ async fn test_close_and_reopen_full_node() -> Result<(), anyhow::Error> { NodeMode::FullNode(seq_port), Some("demo_data_test_close_and_reopen_full_node"), DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -440,7 +440,7 @@ async fn test_close_and_reopen_full_node() -> Result<(), anyhow::Error> { NodeMode::FullNode(seq_port), Some("demo_data_test_close_and_reopen_full_node_copy"), DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -493,7 +493,7 @@ async fn test_get_transaction_by_hash() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -513,7 +513,7 @@ async fn test_get_transaction_by_hash() -> Result<(), anyhow::Error> { NodeMode::FullNode(seq_port), None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -747,7 +747,7 @@ async fn test_reopen_sequencer() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, Some("demo_data_test_reopen_sequencer"), DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -791,7 +791,7 @@ async fn test_reopen_sequencer() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, Some("demo_data_test_reopen_sequencer_copy"), DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); diff --git a/examples/demo-rollup/tests/evm/archival_state.rs b/examples/demo-rollup/tests/evm/archival_state.rs index ec5cd2d39..738c05925 100644 --- a/examples/demo-rollup/tests/evm/archival_state.rs +++ b/examples/demo-rollup/tests/evm/archival_state.rs @@ -30,7 +30,7 @@ async fn test_archival_state() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); diff --git a/examples/demo-rollup/tests/evm/gas_price.rs b/examples/demo-rollup/tests/evm/gas_price.rs index c007aa40c..fef8e2170 100644 --- a/examples/demo-rollup/tests/evm/gas_price.rs +++ b/examples/demo-rollup/tests/evm/gas_price.rs @@ -33,7 +33,7 @@ async fn test_gas_price_increase() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); diff --git a/examples/demo-rollup/tests/evm/mod.rs b/examples/demo-rollup/tests/evm/mod.rs index 21e74db68..33179d7cd 100644 --- a/examples/demo-rollup/tests/evm/mod.rs +++ b/examples/demo-rollup/tests/evm/mod.rs @@ -35,7 +35,7 @@ async fn web3_rpc_tests() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -81,7 +81,7 @@ async fn evm_tx_tests() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); @@ -116,7 +116,7 @@ async fn test_eth_get_logs() -> Result<(), anyhow::Error> { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); diff --git a/examples/demo-rollup/tests/evm/tracing.rs b/examples/demo-rollup/tests/evm/tracing.rs index 7f29c4e10..91b178428 100644 --- a/examples/demo-rollup/tests/evm/tracing.rs +++ b/examples/demo-rollup/tests/evm/tracing.rs @@ -33,7 +33,7 @@ async fn tracing_tests() -> Result<(), Box> { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); diff --git a/examples/demo-rollup/tests/mempool/mod.rs b/examples/demo-rollup/tests/mempool/mod.rs index e161ca0ba..32129f2b3 100644 --- a/examples/demo-rollup/tests/mempool/mod.rs +++ b/examples/demo-rollup/tests/mempool/mod.rs @@ -27,7 +27,7 @@ async fn initialize_test() -> (JoinHandle<()>, Box) { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); diff --git a/examples/demo-rollup/tests/sequencer_commitments/mod.rs b/examples/demo-rollup/tests/sequencer_commitments/mod.rs index 36687a176..3a76636c2 100644 --- a/examples/demo-rollup/tests/sequencer_commitments/mod.rs +++ b/examples/demo-rollup/tests/sequencer_commitments/mod.rs @@ -35,7 +35,7 @@ async fn sequencer_sends_commitments_to_da_layer() { NodeMode::SequencerNode, None, 4, - false, + true, ) .await; }); diff --git a/examples/demo-rollup/tests/soft_confirmation_rule_enforcer/mod.rs b/examples/demo-rollup/tests/soft_confirmation_rule_enforcer/mod.rs index ac4760c07..157235fc3 100644 --- a/examples/demo-rollup/tests/soft_confirmation_rule_enforcer/mod.rs +++ b/examples/demo-rollup/tests/soft_confirmation_rule_enforcer/mod.rs @@ -28,7 +28,7 @@ async fn too_many_l2_block_per_l1_block() { NodeMode::SequencerNode, None, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, - false, + true, ) .await; }); diff --git a/examples/demo-rollup/tests/test_helpers.rs b/examples/demo-rollup/tests/test_helpers.rs index d49341989..c4bf5346d 100644 --- a/examples/demo-rollup/tests/test_helpers.rs +++ b/examples/demo-rollup/tests/test_helpers.rs @@ -36,7 +36,7 @@ pub async fn start_rollup( node_mode: NodeMode, db_path: Option<&str>, min_soft_confirmations_per_commitment: u64, - ignore_tx_body: bool, + include_tx_body: bool, ) { let mut path = db_path.map(Path::new); let mut temp_dir: Option = None; @@ -75,7 +75,7 @@ pub async fn start_rollup( } NodeMode::SequencerNode => None, }, - ignore_tx_body, + include_tx_body, }; let sequencer_config = SequencerConfig { diff --git a/full-node/chainway-sequencer/src/sequencer.rs b/full-node/chainway-sequencer/src/sequencer.rs index 067834e21..4cc28be54 100644 --- a/full-node/chainway-sequencer/src/sequencer.rs +++ b/full-node/chainway-sequencer/src/sequencer.rs @@ -443,8 +443,7 @@ where self.state_root = next_state_root; - self.ledger_db - .commit_soft_batch(soft_batch_receipt, false)?; + self.ledger_db.commit_soft_batch(soft_batch_receipt, true)?; self.mempool .remove_transactions(self.db_provider.last_block_tx_hashes()); diff --git a/full-node/db/sov-db/src/ledger_db/mod.rs b/full-node/db/sov-db/src/ledger_db/mod.rs index 722fe74d2..5430bb5eb 100644 --- a/full-node/db/sov-db/src/ledger_db/mod.rs +++ b/full-node/db/sov-db/src/ledger_db/mod.rs @@ -245,7 +245,7 @@ impl LedgerDB { pub fn commit_soft_batch( &self, batch_receipt: SoftBatchReceipt, - ignore_tx_body: bool, + include_tx_body: bool, ) -> Result<(), anyhow::Error> { // Create a scope to ensure that the lock is released before we commit to the db let mut current_item_numbers = { @@ -284,7 +284,7 @@ impl LedgerDB { // Rollup full nodes don't need to store the tx body as they already store evm body // Sequencer full nodes need to store the tx body as they are the only ones that have it - if ignore_tx_body { + if !include_tx_body { tx_to_store.body = None; } diff --git a/full-node/sov-stf-runner/src/config.rs b/full-node/sov-stf-runner/src/config.rs index 0e3232cbb..1f76f994c 100644 --- a/full-node/sov-stf-runner/src/config.rs +++ b/full-node/sov-stf-runner/src/config.rs @@ -61,8 +61,8 @@ pub struct RollupConfig { pub sequencer_public_key: Vec, /// Prover service configuration. pub prover_service: ProverServiceConfig, - /// Saves sequencer soft batches if set to false - pub ignore_tx_body: bool, + /// Saves sequencer soft batches if set to true + pub include_tx_body: bool, } /// Reads toml file as a specific type. @@ -99,7 +99,7 @@ mod tests { fn test_correct_config() { let config = r#" sequencer_public_key = "0000000000000000000000000000000000000000000000000000000000000000" - ignore_tx_body = false + include_tx_body = true [da] celestia_rpc_auth_token = "SECRET_RPC_TOKEN" celestia_rpc_address = "http://localhost:11111/" @@ -146,7 +146,7 @@ mod tests { prover_service: ProverServiceConfig { aggregated_proof_block_jump: 22, }, - ignore_tx_body: false, + include_tx_body: true, }; assert_eq!(config, expected); } diff --git a/full-node/sov-stf-runner/src/runner.rs b/full-node/sov-stf-runner/src/runner.rs index a34834595..8a6d65808 100644 --- a/full-node/sov-stf-runner/src/runner.rs +++ b/full-node/sov-stf-runner/src/runner.rs @@ -60,7 +60,7 @@ where sequencer_client: Option, sequencer_pub_key: Vec, phantom: std::marker::PhantomData, - ignore_tx_body: bool, + include_tx_body: bool, } /// Represents the possible modes of execution for a zkVM program @@ -123,7 +123,7 @@ where prover_service: Option, sequencer_client: Option, sequencer_pub_key: Vec, - ignore_tx_body: bool, + include_tx_body: bool, ) -> Result { let rpc_config = runner_config.rpc_config; @@ -172,7 +172,7 @@ where sequencer_client, sequencer_pub_key, phantom: std::marker::PhantomData, - ignore_tx_body, + include_tx_body, }) } @@ -499,7 +499,7 @@ where }; self.ledger_db - .commit_soft_batch(soft_batch_receipt, self.ignore_tx_body)?; + .commit_soft_batch(soft_batch_receipt, self.include_tx_body)?; self.ledger_db .extend_l2_range_of_l1_slot( SlotNumber(filtered_block.header().height()), diff --git a/full-node/sov-stf-runner/tests/runner_initialization_tests.rs b/full-node/sov-stf-runner/tests/runner_initialization_tests.rs index 057e7bb3a..1f369b6c2 100644 --- a/full-node/sov-stf-runner/tests/runner_initialization_tests.rs +++ b/full-node/sov-stf-runner/tests/runner_initialization_tests.rs @@ -83,7 +83,7 @@ fn initialize_runner( aggregated_proof_block_jump: 1, }, sequencer_client: None, - ignore_tx_body: false, + include_tx_body: true, }; let da_service = MockDaService::new(address); @@ -123,7 +123,7 @@ fn initialize_runner( Some(prover_service), None, vec![0u8; 32], - false, + true, ) .unwrap() } diff --git a/full-node/sov-stf-runner/tests/runner_reorg_tests.rs b/full-node/sov-stf-runner/tests/runner_reorg_tests.rs index 7635e01cc..79cc11cbb 100644 --- a/full-node/sov-stf-runner/tests/runner_reorg_tests.rs +++ b/full-node/sov-stf-runner/tests/runner_reorg_tests.rs @@ -139,7 +139,7 @@ async fn runner_execution( aggregated_proof_block_jump: 1, }, sequencer_client: None, - ignore_tx_body: false, + include_tx_body: true, }; let ledger_db = LedgerDB::with_path(path).unwrap(); @@ -177,7 +177,7 @@ async fn runner_execution( Some(prover_service), None, vec![0u8; 32], - false, + true, ) .unwrap(); diff --git a/module-system/sov-modules-rollup-blueprint/src/lib.rs b/module-system/sov-modules-rollup-blueprint/src/lib.rs index ffecfe398..2e6b2a126 100644 --- a/module-system/sov-modules-rollup-blueprint/src/lib.rs +++ b/module-system/sov-modules-rollup-blueprint/src/lib.rs @@ -294,7 +294,7 @@ pub trait RollupBlueprint: Sized + Send + Sync { prover_service, sequencer_client, rollup_config.sequencer_public_key, - rollup_config.ignore_tx_body, + rollup_config.include_tx_body, )?; Ok(Rollup {