mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2024-12-26 00:05:17 +00:00
Compare commits
3 Commits
04c7064aaf
...
82885da195
Author | SHA1 | Date | |
---|---|---|---|
|
82885da195 | ||
|
4b48d25fb4 | ||
|
b352184dc6 |
6
DockerfileStandard
Normal file
6
DockerfileStandard
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM rust
|
||||||
|
VOLUME ["/data"]
|
||||||
|
COPY . .
|
||||||
|
RUN apt-get update && apt-get install -y clang cmake build-essential pkg-config libssl-dev
|
||||||
|
RUN cargo build --release
|
||||||
|
CMD ["./target/release/zgs_node", "--config", "run/config-testnet-standard.toml", "--log", "run/log_config"]
|
6
DockerfileTurbo
Normal file
6
DockerfileTurbo
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM rust
|
||||||
|
VOLUME ["/data"]
|
||||||
|
COPY . .
|
||||||
|
RUN apt-get update && apt-get install -y clang cmake build-essential pkg-config libssl-dev
|
||||||
|
RUN cargo build --release
|
||||||
|
CMD ["./target/release/zgs_node", "--config", "run/config-testnet-turbo.toml", "--log", "run/log_config"]
|
@ -38,4 +38,6 @@ lazy_static::lazy_static! {
|
|||||||
pub static ref FINALIZE_TX_WITH_HASH: Arc<dyn Timer> = register_timer("log_store_log_manager_finalize_tx_with_hash");
|
pub static ref FINALIZE_TX_WITH_HASH: Arc<dyn Timer> = register_timer("log_store_log_manager_finalize_tx_with_hash");
|
||||||
|
|
||||||
pub static ref DATA_TO_MERKLE_LEAVES_SIZE: Arc<dyn Gauge<usize>> = GaugeUsize::register("log_store_data_to_merkle_leaves_size");
|
pub static ref DATA_TO_MERKLE_LEAVES_SIZE: Arc<dyn Gauge<usize>> = GaugeUsize::register("log_store_data_to_merkle_leaves_size");
|
||||||
|
|
||||||
|
pub static ref TX_BY_SEQ_NUMBER: Arc<dyn Timer> = register_timer("log_store_tx_store_get_tx_by_seq_number");
|
||||||
}
|
}
|
||||||
|
@ -118,11 +118,13 @@ impl TransactionStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_tx_by_seq_number(&self, seq: u64) -> Result<Option<Transaction>> {
|
pub fn get_tx_by_seq_number(&self, seq: u64) -> Result<Option<Transaction>> {
|
||||||
|
let start_time = Instant::now();
|
||||||
if seq >= self.next_tx_seq() {
|
if seq >= self.next_tx_seq() {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
let value = try_option!(self.kvdb.get(COL_TX, &seq.to_be_bytes())?);
|
let value = try_option!(self.kvdb.get(COL_TX, &seq.to_be_bytes())?);
|
||||||
let tx = Transaction::from_ssz_bytes(&value).map_err(Error::from)?;
|
let tx = Transaction::from_ssz_bytes(&value).map_err(Error::from)?;
|
||||||
|
metrics::TX_BY_SEQ_NUMBER.update_since(start_time);
|
||||||
Ok(Some(tx))
|
Ok(Some(tx))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user