Struct zksync_dal::eth_sender_dal::EthSenderDal

source ·
pub struct EthSenderDal<'a, 'c> { /* private fields */ }

Implementations§

source§

impl EthSenderDal<'_, '_>

source

pub async fn get_inflight_txs( &mut self, operator_address: Option<Address>, ) -> Result<Vec<EthTx>>

source

pub async fn get_eth_l1_batches(&mut self) -> Result<L1BatchEthSenderStats>

source

pub async fn get_eth_tx(&mut self, eth_tx_id: u32) -> Result<Option<EthTx>>

source

pub async fn get_new_eth_txs( &mut self, limit: u64, operator_address: &Option<Address>, ) -> Result<Vec<EthTx>>

source

pub async fn get_unsent_txs(&mut self) -> Result<Vec<TxHistoryToSend>>

source

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>

source

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>>

source

pub async fn set_sent_at_block( &mut self, eth_txs_history_id: u32, sent_at_block: u32, ) -> Result<()>

source

pub async fn remove_tx_history(&mut self, eth_txs_history_id: u32) -> Result<()>

source

pub async fn confirm_tx(&mut self, tx_hash: H256, gas_used: U256) -> Result<()>

source

pub async fn get_confirmed_tx_hash_by_eth_tx_id( &mut self, eth_tx_id: u32, ) -> Result<Option<H256>>

source

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.

source

pub async fn get_tx_history_to_check( &mut self, eth_tx_id: u32, ) -> Result<Vec<TxHistory>>

source

pub async fn get_block_number_on_first_sent_attempt( &mut self, eth_tx_id: u32, ) -> Result<Option<u32>>

source

pub async fn get_last_sent_eth_tx( &mut self, eth_tx_id: u32, ) -> Result<Option<TxHistory>>

source

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 be Some. For requesting the none of the main operator this parameter should be set to None.
source

pub async fn mark_failed_transaction(&mut self, eth_tx_id: u32) -> Result<()>

source

pub async fn get_number_of_failed_transactions(&mut self) -> Result<i64>

source

pub async fn clear_failed_transactions(&mut self) -> Result<()>

source

pub async fn delete_eth_txs( &mut self, last_batch_to_keep: L1BatchNumber, ) -> Result<()>

Trait Implementations§

source§

impl<'a, 'c> Debug for EthSenderDal<'a, 'c>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FutureExt for T

source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more