Developers Forum for XinFin XDC Network

Omkar Mestry
Omkar Mestry

Posted on

EVM Compatible XDC Network’s Upgraded Security and Memory features on Apothem Platform.

EVM Compatible XDC Network’s Upgraded Security and Memory features on Apothem Platform.

Upgrading the feasibility of XinFin(XDC) network which covers Security issues and Memory leak issues.

Introduction to XDC Network and Apothem Network.

The XDC Network is a global, open-source, delegated proof of stake consensus network (XDPoS), which enables hybrid relay bridges, instant block finality and interoperability with ISO 20022 financial messaging standards. The network’s hybrid (private/public) architecture is designed to support institutional use in trade finance and asset tokenization. Featuring interoperable smart contracts, 2,000 transactions per-second, and Ethereum Virtual Machine compatibility, the XDC Network provides a scalable infrastructure for enterprises and independent community contributors.

Apothem Network (Testnet) is the network used by smart contract developers to test smart contracts and protocol upgrades before deployment to the mainnet. Any upgrade to the XinFin XDC Network blockchain is first implemented on the Apothem Test Network, a simulation of the XinFin XDC Network, giving developers and other community members a chance to test the system before real assets are involved.

Now Let’s discuss what issues the team has fixed, which will be on the Apothem Network.

internal/ethapi: EstimateGas and Call handle revert error

Mentioned first issue was, XDC blockchain didn’t show the revert error before sending the tx with no one wallet/interface(metamask, XDCpay, Remix…). There is no way to see the error before sending the transaction.

In the current version XDPoSChain, it always returns the message: “gas required exceeds allowance or always failing transaction”. If solidity contract function reverts when metamask or other client calls method eth.estimateGas. Therefore, neither the user nor the wallet programme can predict when a revert will occur or get a revert message when one does. This is the main problem in the complaint by xcantera. The latest Pull Request parses and returns the revert message/reason for both of and eth.estimateGas. This PR is tested on a private network and now it will be tested on Apothem testnet.

test with apothem RPC



curl -X POST -H “Content-Type: application/json” -d ‘








“data”: “0x55241077000000000000000000000000000000000000000000000000000000000000000a”,








“jsonrpc”: “2.0”,

“id”: 1,

“error”: {

“code”: -32000,

“message”: “gas required exceeds allowance or always failing transaction”


Enter fullscreen mode Exit fullscreen mode

Now, Users can see that this fix will be live on the XDC Apothem Network first.

Merged link:

Fixed memory leak when sending tx, vote, block etc to peers.
A memory leak reduces the performance of the peer by reducing the amount of available memory. Eventually, in the worst case, too much of the available memory may become allocated and all or part of the system or device stops working correctly, the application fails, or the system slows down vastly due to thrashing.

The memory leak issue is based on original v1/eth code that has been Merged and it will be live on XDC Apothem Network with the Latest Merge.

Both the issues will be live on XDC Apothem Network in the first week of January 2023.

Discuss any technical developments on the XDC Network Technical forum XDC.Dev

Discussion (0)