Conversation
🦋 Changeset detectedLatest commit: 35f5526 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note: we charge the entire tx fee up front and do not give refunds like how L1 normally does so this means that there is a floor for how expensive transactions are. I think that breaking up the sequencer entrypoint into multiple steps would fix some problems here |
karlfloersch
left a comment
There was a problem hiding this comment.
Left a quick comment on removing the gas limit check. Other than that looks good!
| // Prevent transactions from being submitted if the gas limit too high | ||
| if signedTx.Gas() >= b.gasLimit { | ||
| return fmt.Errorf("Transaction gasLimit (%d) is greater than max gasLimit (%d)", signedTx.Gas(), b.gasLimit) | ||
| } |
There was a problem hiding this comment.
Could be a good idea that we don't remove this check entirely, but instead just replace it with a call to DoEstimateGas + a ~50% safety margin. That way we don't end up with a tx that is way incorrectly priced
There was a problem hiding this comment.
I'm open if you don't think this is worth the complexity
There was a problem hiding this comment.
If we add this before the execution price goes into the state and the sequencer changes the values then this will brick a lot things and will require manual gasLimits to be set
There was a problem hiding this comment.
There is currently a bug in the gas estimation logic that is unknown. The only way that this would be safe is ignore the case when there is an error, otherwise a set of transactions will not be able to be sent
There was a problem hiding this comment.
I think we should follow up with this addition after we figure out the bug in gas estimation
There was a problem hiding this comment.
Ok I'm down to do this! Let's make sure to prioritize the follow up though
| fee := core.CalculateRollupFee(*args.Data, uint64(gasUsed), dataPrice, executionPrice).Uint64() / defaultGasPrice | ||
| if fee < 21000 { | ||
| fee = 21000 | ||
| } |
There was a problem hiding this comment.
Note that we probably should set the default gasPrice to 0.1 gwei considering our minimum gas limit has to be 21k. At 21k the minimum fee would end up being 0.000021 ETH which is just a little too high
There was a problem hiding this comment.
Agree with this, just a matter of changing the value of defaultGasPrice
There was a problem hiding this comment.
I've updated the defaultGasPrice to be 0.1 gwei
| // Prevent transactions from being submitted if the gas limit too high | ||
| if signedTx.Gas() >= b.gasLimit { | ||
| return fmt.Errorf("Transaction gasLimit (%d) is greater than max gasLimit (%d)", signedTx.Gas(), b.gasLimit) | ||
| } |
| if err.Error() != fmt.Sprintf("Transaction gasLimit (%d) is greater than max gasLimit (%d)", gasLimit, backend.GasLimit()) { | ||
| t.Fatalf("Unexpected error type: %s", err) | ||
| } |
There was a problem hiding this comment.
Given the suggestion above, I think this test could/should be revived and test the condition that the transaction being submitted is within the gas estimation limit.
| fee := core.CalculateRollupFee(*args.Data, uint64(gasUsed), dataPrice, executionPrice).Uint64() / defaultGasPrice | ||
| if fee < 21000 { | ||
| fee = 21000 | ||
| } |
There was a problem hiding this comment.
Agree with this, just a matter of changing the value of defaultGasPrice
|
The integration tests are breaking due to the |
| // Prevent transactions from being submitted if the gas limit too high | ||
| if signedTx.Gas() >= b.gasLimit { | ||
| return fmt.Errorf("Transaction gasLimit (%d) is greater than max gasLimit (%d)", signedTx.Gas(), b.gasLimit) | ||
| } |
There was a problem hiding this comment.
Ok I'm down to do this! Let's make sure to prioritize the follow up though
|
Closing in favor of #695 |
Description
eth_estimateGasto have a min gas value that is returned. This is due to Metamask failing for transactions when the gas limit is less than 21000.gasLimitbeing greater than the block gas limit@K-Ho
Closes #608
Closes #607