Git Product home page Git Product logo

Comments (10)

hackfisher avatar hackfisher commented on September 26, 2024 1

The gas consumption of blocks in Darwinia is far less from the block gas target? Why the gas price is not decreasing? cc @boundless-forest

from darwinia.

RPate97 avatar RPate97 commented on September 26, 2024 1

I am confused that why the gas price will affect the contract deployment. Can you explain more? Is there some hardcoded gas price requirement in that repo?

Hey, Ryan from Sphinx here. I wanted to chime in with some info on this.

On most networks, the deterministic create2 factory is deployed at the address 0x4e59b44847b379578588920ca78fbf26c0b4956c. Having this create2 factory deployed at the same address across networks is helpful because it allows for other contracts to be deployed at consistent addresses (we rely on this heavily at Sphinx). This factory contract has become very popular because it can be permissionlessly deployed by anyone to the expected address on any network as long as it meets certain compatibility conditions.

This contract's deployment works by using a transaction signed with the account 0x3fab184622dc19b6109349b94811493bf2a45362 that does not include a chain ID. Since the transaction does not include a chain ID, it can be replayed on any EVM-compatible network without access to the deployer's private key. This makes the contract permissionlessly deployable on any network.

The downside of this setup is that the transaction has a fixed gas price (100 gwei) and gas limit (100k). If a network's gas price permanently exceeds 100 gwei or has opcode gas fee changes that result in the cost of deploying the factory exceeding 100k, then the factory cannot be deployed on that network.

Since we heavily rely on this factory contract for Sphinx, we unfortunately cannot support your networks unless this issue is resolved.

from darwinia.

boundless-forest avatar boundless-forest commented on September 26, 2024

The current gas price mechnism of all the Darwinia chains uses the underlying substrate block weight fee calculator https://github.com/darwinia-network/darwinia/blob/main/runtime/darwinia/src/pallets/evm.rs#L150-L157, there is an initial fee value even if the block weight doesn't reach the target. This is designed to prevent the gas price from dropping to zero.Check out the test: https://github.com/darwinia-network/darwinia/blob/main/runtime/common/src/test.rs#L720-L735

from darwinia.

boundless-forest avatar boundless-forest commented on September 26, 2024

the widely used create2 factory that does not require a key (keyless) cannot be deployed.

I am confused that why the gas price will affect the contract deployment. Can you explain more? Is there some hardcoded gas price requirement in that repo?

from darwinia.

hujw77 avatar hujw77 commented on September 26, 2024
+ curl -fsS https://pangolin-rpc.darwinia.network -d '{"id":1,"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222"]}' -H 'Content-Type: application/json'

from darwinia.

boundless-forest avatar boundless-forest commented on September 26, 2024

I have done some tracking of the gas price increases over the last year and have sorted them out and summarised them here for your reference.

  1. Before #1066, the gas price of all the darwinia runtime is low, the darwinia and crab chain used fixed gas price 1GWEI and the dynamic gas price has been loaded in the pangolin network, but the initial gas price is 18_779GWEI(too high in today's view)
  2. In #1237, update the weight to fee polynomial params again, this also affects the gas price across all networks, the value remains to be used today.
  3. In #1103 enable the dynamic fee over all the networks and update the block gas limit to the 20m at the same time.

from darwinia.

hackfisher avatar hackfisher commented on September 26, 2024

Will close after runtime upgrade on chain.

from darwinia.

boundless-forest avatar boundless-forest commented on September 26, 2024

image

I think the Pangolin testnet gas price is low enough to test the contract. Please testing and feedback here. @hujw77

from darwinia.

hujw77 avatar hujw77 commented on September 26, 2024

image

I think the Pangolin testnet gas price is low enough to test the contract. Please testing and feedback here. @hujw77

https://pangolin.subscan.io/tx/0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26

No problem.

from darwinia.

hujw77 avatar hujw77 commented on September 26, 2024

https://darwinia.subscan.io/tx/0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26
Deployed.

from darwinia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.