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
— anL1BatchNumber
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
zks_getL1BatchDetails
RPC method yourself