Barnard Patch Release: Transaction Gas Cost Estimation Endpoint
This patch upgrade for Barnard introduces a powerful new endpoint for transaction gas cost estimation, enabling developers and users to accurately predict gas usage through transaction simulation.
Upgrade for Endpoint: /transaction/cost
The /transaction/cost
endpoint allows users to estimate the gas required for executing a given transaction against the current on-chain state. It performs a non-persistent, read-only simulation of the transaction, returning precise gas consumption data without affecting the actual blockchain.
Key Features:
- Simulation-based Gas Estimation: Accurately predict the gas required for any transaction by simulating execution against the current blockchain state.
- Smart Contract Compatibility: The endpoint fully simulates smart contract calls, including internal logic paths, storage effects, and emitted events.
- Sandboxed Execution: Transaction simulations run in a secure, isolated environment, ensuring no impact on the actual blockchain state.
Important Considerations:
- Correct Nonce Required: The endpoint requires the correct nonce to simulate transaction behavior accurately. An incorrect or outdated nonce will result in simulation failure.
- Variable Gas Usage: For smart contracts with variable logic paths, the simulation reflects only the specific logic path triggered during the current simulation.
- Gas Estimation Variability: Actual gas usage may vary if the blockchain state changes between the time of estimation and the actual execution of the transaction.
Upgrade Information:
This is an optional upgrade primarily beneficial for observer nodes. No governance vote or mandatory epoch activation is required.
Resources:
- Full binary release notes: https://github.com/multiversx/mx-chain-go/releases/tag/v1.10.5
- Mainnet Configuration: https://github.com/multiversx/mx-chain-mainnet-config/releases/tag/v1.10.5.0
- Documentation: https://docs.multiversx.com/sdk-and-tools/rest-api/transactions/#estimate-cost-of-transaction
The Barnard Patch is live on public testnet and devnet, ready for validators, builders, and community members to explore and integrate.
Do you need more information?
Discover the Ecosystem

