zks_getL1BatchDetails | zkSync Era

The zks_getL1BatchDetails API method offers a comprehensive look into a specific batch's details on Layer 1. By inputting a batch number, developers can retrieve a wealth of information, including transaction hashes, execution details, gas prices, and the batch's overall status.

πŸ‘

Get your own node endpoint today

Start for free and elevate your app to production levels immediately. No credit card required.

Sign up with your GitHub, X, Google, or Microsoft account for immediate access.

Parameters

  • batch β€” an L1BatchNumber that specifies the batch number on Layer 1 for which details are being requested.

Response

Upon execution, the zks_getL1BatchDetails method returns a detailed object encompassing various aspects of the specified batch:

  • baseSystemContractsHashes β€” contains hashes for key system contracts, offering insight into the infrastructure underpinning the transactions within the batch.
    • bootloader β€” the hash of the bootloader contract, a fundamental component in initializing contract execution.
    • default_aa β€” the hash of the default account abstraction contract, facilitating user interactions with contracts.
  • commitTxHash β€” the transaction hash for the commitment phase on the network, highlighting the first step in the transaction lifecycle.
  • committedAt β€” the ISO 8601 timestamp marking the commitment of the transaction to the network, providing a precise timeline.
  • executeTxHash β€” the hash of the executed transaction, indicating the application of the transaction's effects on the zkSync network.
  • executedAt β€” the ISO 8601 timestamp for when the transaction execution took place, marking the conclusion of its network effects.
  • l1GasPrice β€” shows the gas price on Layer 1 at the time of the transaction, reflecting the execution cost on Ethereum.
  • l1TxCount β€” the count of transactions in this batch on Layer 1, offering insight into the batch's complexity.
  • l2FairGasPrice β€” the fair gas price within the zkSync network, guiding transaction cost efficiency on Layer 2.
  • l2TxCount β€” the number of transactions processed in the zkSync network for this batch, indicating its activity level.
  • number β€” the unique number of the batch.
  • proveTxHash β€” the hash of the transaction providing proof on Layer 1, essential for validating the batch's integrity and finality.
  • provenAt β€” the ISO 8601 timestamp when the proof transaction was verified on Layer 1, marking a crucial step in batch validation.
  • rootHash β€” the root hash of the network state post-transaction, key for ensuring the consistency and integrity of the network state.
  • status β€” the current status of the batch, providing immediate insight into its processing stage and overall health.
  • timestamp β€” a UNIX timestamp that marks the exact time of batch processing, serving as a universal reference point.

Use case

A smart contract developer optimizing a decentralized finance (DeFi) platform on zkSync could use the zks_getL1BatchDetails method to analyze gas usage across different batches. By examining details like gas prices, transaction counts, and execution times, the developer can identify patterns of high gas costs.

Try the zks_getL1BatchDetails RPC method yourself

Language
Click Try It! to start a request and see the response here!