hardhat-gas-reporter icon indicating copy to clipboard operation
hardhat-gas-reporter copied to clipboard

Support Other EVM-Compatible Chains?

Open xanderdunn opened this issue 2 years ago • 5 comments

Absolutely phenomenal hardhat plugin!

I'm using hardhat to develop smart contracts on the Avalanche C-Chain, which is EVM-compatible. I'd love to be able to display usd (avg) prices for the Avalanche blockchain rather than the Ethereum blockchain. Is this currently supported? What would it take to report prices in AVAX->USD rather than ETH->USD?

xanderdunn avatar Nov 15 '21 17:11 xanderdunn

I've confused block limit with transaction gas limit.

Ethereum's block limit is Block limit: 30000000 gas, as shown by this plugin. I'm not sure what Avalanche's block limit is. If it's different, this would need to be a configuration option.

Avalanche indicates its gas limit is 8,000,000 here. I believe that is the per-transaction gas limit.

xanderdunn avatar Nov 15 '21 17:11 xanderdunn

I'm not sure if Avalanche has significantly different opcode pricing that Ethereum.

However, I'd be very interested in seeing some support for Ethereum L2s like Arbitrum and Optimism. L2s have the unique attribute of having disproportionately expensive calldata compared to other costs.

dmihal avatar Dec 08 '21 00:12 dmihal

@dmihal Are you running your tests against an Optimism client? Is their receipt in a special format?

cgewecke avatar Dec 08 '21 00:12 cgewecke

@cgewecke, nope just testing against the normal hardhat node

Optimism L2 gas is roughly the same as Ethereum L2 gas, however Optimism and Arbitrum add additional fees for calldata (which much be posted to Ethereum L1)

I wonder if this could be simulated by adding an extra charge based on the length of the tx calldata.

dmihal avatar Dec 15 '21 11:12 dmihal

I wonder if this could be simulated by adding an extra charge based on the length of the tx calldata.

@dmihal Oh! Smart idea .... agree we should definitely do that if it's possible.

Am planning to profile gas usage for a work-related project this month and will look at this....

cgewecke avatar Dec 15 '21 14:12 cgewecke

Any news on this?

azerpas avatar Oct 26 '22 20:10 azerpas

The latest version (2.0) adds support for L2s (starting with Optimism). Arbitrum support is in the pipeline and being tracked via #181.

Closing in favor of #181

https://github.com/cgewecke/hardhat-gas-reporter/releases/tag/v2.0.0

cgewecke avatar Mar 14 '24 04:03 cgewecke