Skip to content

Commit d069d02

Browse files
committed
Update lock file and clarify gas estimation script
1 parent 16b49c3 commit d069d02

2 files changed

Lines changed: 15 additions & 613 deletions

File tree

packages/gas-estimation/scripts/exec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ const gasEstimator = async () => {
5555
// NodeInterface.GasEstimateComponents() and get the fourth element and multiply by 16 => result[3]*16
5656
// L1S (Size in bytes of the calldata to post on the parent chain) =>
5757
// Will depend on the size (in bytes) of the calldata of the transaction
58-
// We add a fixed amount of 140 bytes to that amount for the transaction metadata (recipient, nonce, gas price, ...)
59-
// Final size will be less after compression, but this calculation gives a good estimation
6058

6159
// ****************************
6260
// * Other values you can get *
@@ -97,7 +95,6 @@ const gasEstimator = async () => {
9795
// -------------------------------------------------------------------------------
9896
// NOTE: This one might be a bit confusing, but parentChainGasEstimated (B in the formula) is calculated based on child-chain's gas fees
9997
const parentChainCost = parentChainGasEstimated.mul(childChainEstimatedPrice);
100-
// NOTE: This is similar to 140 + utils.hexDataLength(txData);
10198
const parentChainSize = parentChainCost.div(parentChainEstimatedPrice);
10299

103100
// Getting the result of the formula

0 commit comments

Comments
 (0)