Skip to content

Conversation

@0xOmarA
Copy link
Contributor

@0xOmarA 0xOmarA commented Jul 12, 2025

Summary

This PR allows for the gas to be estimated using alloy, which fixes some of the earlier issues we were seeing in the contract deployment.

Description

I was seeing some errors in the deployment of contracts and more specifically the following two errors:

  2025-07-12T18:33:54.129855Z ERROR revive_dt_core::driver: Failed to execute transaction when deploying the contract on node : "revive_dt_core::Geth", "Callable", server returned an error response: error code -32000: gas uint64 overflow
2025-07-12 19:13:38.836 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 5000000, encoded_len: 1944 actual_fee: 19441617794180 eth_fee: 25000000    
2025-07-12 19:13:38.836 DEBUG tokio-runtime-worker runtime::revive: eth fees 25000000 too low, actual fees: 19441617794180    
2025-07-12 19:13:38.840 ERROR tokio-runtime-worker sc_service::task_manager: Essential task `txpool-background` failed. Shutting down service.    

These two issues had different causes:

  1. When constructing transactions we put the gas values ourselves and they were not representative of how much is needed to deploy the contracts.
  2. We were using String::into_bytes to convert the hex-encoded contract code into bytes which utf-8 encodes the string instead of performing a hex-decode.

So, this PR does the following:

  1. Correctly uses hex::decode to decode the contract hex-encoded byte code into a vector of bytes.
  2. Allows for alloy to perform the gas estimation for us (by not providing the fields and letting it fill them in)

Copy link
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@0xOmarA 0xOmarA added this pull request to the merge queue Jul 14, 2025
Merged via the queue into main with commit 3e99d1c Jul 14, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants