Struct zksync_dal::eth_sender_dal::EthSenderDal
source · pub struct EthSenderDal<'a, 'c> { /* private fields */ }
Implementations§
source§impl EthSenderDal<'_, '_>
impl EthSenderDal<'_, '_>
pub async fn get_inflight_txs( &mut self, operator_address: Option<Address>, ) -> Result<Vec<EthTx>>
pub async fn get_eth_l1_batches(&mut self) -> Result<L1BatchEthSenderStats>
pub async fn get_eth_tx(&mut self, eth_tx_id: u32) -> Result<Option<EthTx>>
pub async fn get_new_eth_txs( &mut self, limit: u64, operator_address: &Option<Address>, ) -> Result<Vec<EthTx>>
pub async fn get_unsent_txs(&mut self) -> Result<Vec<TxHistoryToSend>>
pub async fn save_eth_tx( &mut self, nonce: u64, raw_tx: Vec<u8>, tx_type: AggregatedActionType, contract_address: Address, predicted_gas_cost: u32, from_address: Option<Address>, blob_sidecar: Option<EthTxBlobSidecar>, ) -> Result<EthTx>
pub async fn insert_tx_history( &mut self, eth_tx_id: u32, base_fee_per_gas: u64, priority_fee_per_gas: u64, blob_base_fee_per_gas: Option<u64>, tx_hash: H256, raw_signed_tx: &[u8], sent_at_block: u32, ) -> Result<Option<u32>>
pub async fn set_sent_at_block( &mut self, eth_txs_history_id: u32, sent_at_block: u32, ) -> Result<()>
pub async fn remove_tx_history(&mut self, eth_txs_history_id: u32) -> Result<()>
pub async fn confirm_tx(&mut self, tx_hash: H256, gas_used: U256) -> Result<()>
pub async fn get_confirmed_tx_hash_by_eth_tx_id( &mut self, eth_tx_id: u32, ) -> Result<Option<H256>>
sourcepub async fn insert_bogus_confirmed_eth_tx(
&mut self,
l1_batch: L1BatchNumber,
tx_type: AggregatedActionType,
tx_hash: H256,
confirmed_at: DateTime<Utc>,
) -> Result<()>
pub async fn insert_bogus_confirmed_eth_tx( &mut self, l1_batch: L1BatchNumber, tx_type: AggregatedActionType, tx_hash: H256, confirmed_at: DateTime<Utc>, ) -> Result<()>
This method inserts a fake transaction into the database that would make the corresponding L1 batch to be considered committed/proven/executed.
The designed use case is the External Node usage, where we don’t really care about the actual transactions apart from the hash and the fact that tx was sent.
§Warning
After this method is used anywhere in the codebase, it is considered a bug to try to directly query eth_txs_history
or eth_txs
tables.
pub async fn get_tx_history_to_check( &mut self, eth_tx_id: u32, ) -> Result<Vec<TxHistory>>
pub async fn get_block_number_on_first_sent_attempt( &mut self, eth_tx_id: u32, ) -> Result<Option<u32>>
pub async fn get_last_sent_eth_tx( &mut self, eth_tx_id: u32, ) -> Result<Option<TxHistory>>
sourcepub async fn get_next_nonce(
&mut self,
from_address: Option<Address>,
) -> Result<Option<u64>>
pub async fn get_next_nonce( &mut self, from_address: Option<Address>, ) -> Result<Option<u64>>
Returns the next nonce for the operator account
§Params
from_address
: an optional value indicating that nonce must be returned for a custom operator address which is not the “main” one. For example, a separate custom operator sends the blob transactions. For such a case this should beSome
. For requesting the none of the main operator this parameter should be set toNone
.
pub async fn mark_failed_transaction(&mut self, eth_tx_id: u32) -> Result<()>
pub async fn get_number_of_failed_transactions(&mut self) -> Result<i64>
pub async fn clear_failed_transactions(&mut self) -> Result<()>
pub async fn delete_eth_txs( &mut self, last_batch_to_keep: L1BatchNumber, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'c> Freeze for EthSenderDal<'a, 'c>
impl<'a, 'c> !RefUnwindSafe for EthSenderDal<'a, 'c>
impl<'a, 'c> Send for EthSenderDal<'a, 'c>
impl<'a, 'c> Sync for EthSenderDal<'a, 'c>
impl<'a, 'c> Unpin for EthSenderDal<'a, 'c>
impl<'a, 'c> !UnwindSafe for EthSenderDal<'a, 'c>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request