Skip to main content
13 votes
Accepted

Are weights really neccessary?

During block authorship, the execution time of each transaction is measured, rather than weights right? We don't measure the execution time per extrinsic. Each block has a fixed slot for proposing/...
bkchr's user avatar
  • 11.6k
9 votes

Are weights really neccessary?

The main reason is it is impossible to deterministically determine the execution time of a transaction without heavy overhead (e.g. gas metering). For example, user send a transaction, the execution ...
Bryan Chen's user avatar
5 votes
Accepted

Gas costs of performing cross-contract calls

The overhead is significant. This is because for cross-contract calls the pallet-contracts needs to: Load the callee contract code from storage. Compile the code (using wasmi). Set up a new sandboxed ...
cmichi's user avatar
  • 2,800
3 votes

What are the fees associated with ink! contract deployment?

Your assumptions you made in #1 to #6 are all correct. Now to your questions: This is the storage deposit for storing the code. In contrast to the deposit for the contract which is using said code (...
Alexander Theißen's user avatar
3 votes
Accepted

How do set the appropriate refTime and proofSize when create asMulti?

You can create your asMulti call with some default values for reftime and proofsize. An example would be to set at your new weight the same RefTime as found in your old weight and for proofsize a ...
dominique's user avatar
  • 1,693
2 votes

How to estimate gas for ink contracts transactions for Weights V2?

The answer which you gave in the link from the comment is correct. So dry-running it via polkadot-js or some other means. cargo contract {call, instantiate, …} does this by default before submitting ...
cmichi's user avatar
  • 2,800
2 votes
Accepted

What is a Storage Deposit?

The storage deposit is the payment for the contract storage. https://github.com/paritytech/substrate/blob/0cdf7029017b70b7c83c21a4dc0aa1020e7914f6/frame/contracts/primitives/src/lib.rs#L57-L63 It is ...
Bruno's user avatar
  • 8,315
2 votes
Accepted

How can I retrieve the baseFeePerGas value for historical blocks on Astar?

Here is a method to get historical baseFeePerGas const { ethers } = require("ethers"); async function getBaseFee(blockNumber) { const rpc = "https://evm.astar.network" let ...
gluneau's user avatar
  • 66
2 votes
Accepted

Rationale on Moonbeam's GAS_PER_SECOND

The 500ms weight limit is a suggested time limit (initially in cumulus) used for block production in order to maximize the size and the probability of a block to be accepted. Currently (before ...
Crystalin's user avatar
  • 790
2 votes

Getting "Gas estimation failed" error while deploying EVM contract on Substrate Node?

This error generally occur due to the wrong gas_estimation to get rid of this error you can decrease the gas_feeof your chain or you can use metamask advance options to set the gas_limit manually.you ...
Amit Kumar Yadav's user avatar
2 votes

What's the difference between `paymentInfo` and `gasRequired`?

Are your calls failing with OutOfGas when submitted individually or only when batched? The difference may be due to the different runtime apis called under the hood: transactionPaymentApi.queryInfo ...
Andreea Eftene's user avatar
1 vote

How To Send Transactions Fees to Treasury Instead of Burning Tokens?

Configure the DealWithFees as shown here: https://github.com/darwinia-network/darwinia/blob/e0d20124b071d907cd7ccc163cc1a412caf95626/runtime/common/src/lib.rs#L226-L237. And include the DealWithFees ...
AurevoirXavier's user avatar
  • 10.7k
1 vote
Accepted

While executing contracts functions getting out of gas error

Issue is with polkadotjs UI, they have not yet implemented v2Weights completely in UI, instead use contracts-ui to check the functionalities and interact with your contracts, which is working fine as ...
Shubham Gupta's user avatar
1 vote

While executing contracts functions getting out of gas error

Right now it is problem with Polkadot.js itself, you can check this issue: https://github.com/polkadot-js/apps/issues/8364
Artem Lech's user avatar
1 vote

During runtime upgrade, I estimate gas fee by PaymentQueryInfo api, the return result value is so high, more than the normal value

The set_code's weight is extremely large. https://github.com/paritytech/substrate/blob/88e2c9e3935c3951da3c6e3bdb8fb1ae74dc1258/frame/system/src/lib.rs#L400 As you can see, it uses all the weight of a ...
AurevoirXavier's user avatar
  • 10.7k
1 vote

How to estimate gas limit required for ink contract deployment?

For the polkadot-js docs which you linked: I think either 0 or -1 for gasLimit means "unlimited"/"automatically choose it". So you don't necessarily have to put a value there. How ...
cmichi's user avatar
  • 2,800

Only top scored, non community-wiki answers of a minimum length are eligible