-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(da): fix inconsistence issue between re-exec blocks locally and r…
…ooch network (#3077) * fix(rooch-executor): update log levels to info for reload MoveOS Updated log levels in `ExecutorActor` and `ReaderExecutorActor` from `debug` to `info` for better visibility during gas upgrade events. This ensures important operational messages are more prominent in logs. * feat(rooch-db): add get_execution_info_by_order command Introduce a new command to retrieve execution info by order. This feature supports querying transaction-related data based on order numbers for added flexibility in database operations. * fix(rooch-da): integrate event handling via EventBus for `rooch da exec` and other fix 1. add `EventBus` and `EventActor` support for event-driven architecture. 2. fix rollback issue caused by execution tx immediately after rollback. now we force restart process after rollback 3. fix restart issue caused by wrong next_block_number 4. add sequence_info in moveos_tx.ctx 5. add log improvements and refined block/transaction ordering logic.
- Loading branch information
Showing
9 changed files
with
95 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
crates/rooch/src/commands/db/commands/get_execution_info_by_order.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) RoochNetwork | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use crate::commands::da::commands::TxDAIndexer; | ||
use crate::commands::db::commands::init; | ||
use clap::Parser; | ||
use rooch_config::R_OPT_NET_HELP; | ||
use rooch_types::error::RoochResult; | ||
use rooch_types::rooch_network::RoochChainID; | ||
use std::path::PathBuf; | ||
|
||
/// Get ExecutionInfo by order | ||
#[derive(Debug, Parser)] | ||
pub struct GetExecutionInfoByOrderCommand { | ||
#[clap(long)] | ||
pub order: u64, | ||
|
||
#[clap( | ||
long = "order-hash-path", | ||
help = "Path to tx_order:tx_hash:block_number file" | ||
)] | ||
pub order_hash_path: PathBuf, | ||
|
||
#[clap(long = "data-dir", short = 'd')] | ||
/// Path to data dir, this dir is base dir, the final data_dir is base_dir/chain_network_name | ||
pub base_data_dir: Option<PathBuf>, | ||
|
||
/// If local chainid, start the service with a temporary data store. | ||
/// All data will be deleted when the service is stopped. | ||
#[clap(long, short = 'n', help = R_OPT_NET_HELP)] | ||
pub chain_id: Option<RoochChainID>, | ||
} | ||
|
||
impl GetExecutionInfoByOrderCommand { | ||
pub fn execute(self) -> RoochResult<()> { | ||
let (_root, rooch_db, _start_time) = init(self.base_data_dir, self.chain_id); | ||
let moveos_store = rooch_db.moveos_store.clone(); | ||
let tx_da_indexer = TxDAIndexer::load_from_file( | ||
self.order_hash_path.clone(), | ||
moveos_store.transaction_store, | ||
)?; | ||
|
||
let tx_order = self.order; | ||
|
||
let execution_info = tx_da_indexer.get_execution_info_by_order(tx_order)?; | ||
match execution_info { | ||
Some(_) => { | ||
println!("{}:{:?}", tx_order, execution_info.unwrap()); | ||
} | ||
None => { | ||
tracing::warn!("tx_order {} execution_info not found", tx_order); | ||
} | ||
} | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters