Skip to content

l2geth: allow for the configured max tx gaslimit to be set in the cfg#840

Merged
tynes merged 5 commits intodevelopfrom
fix/dynamic-gaslimit
May 13, 2021
Merged

l2geth: allow for the configured max tx gaslimit to be set in the cfg#840
tynes merged 5 commits intodevelopfrom
fix/dynamic-gaslimit

Conversation

@tynes
Copy link
Copy Markdown
Contributor

@tynes tynes commented May 11, 2021

Description
This PR allows the configured gasLimit to be passed through to the contracts state. It was previously depending on the state dump to set the gasLimit in the contracts while the configured value must match the value set in the state dump

Additional context
If this value is misconfigured, it will result in a mismatched state root instantly. I suppose that is better than it eventually resulting in a mismatched state root if it was configured improperly.

I found the storage slot with the command:

$ seth storage 0xdeaddeaddeaddeaddeaddeaddeaddeaddead0005 4

After bringing up l2geth with the sync service turned off

You can see that the value is set here in the state dump:

maxTransactionGasLimit: 9_000_000,

The value that is being set in the state dynamically is here:

The gaslimit can be configured with: TARGET_GAS_LIMIT or --miner.gastarget and --miner.gaslimit
See:

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented May 11, 2021

🦋 Changeset detected

Latest commit: a6c8bfc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eth-optimism/l2geth Patch

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

@tynes tynes changed the title l2geth: allow for the configured max tx gaslimit to be set in the con… l2geth: allow for the configured max tx gaslimit to be set in the cfg May 11, 2021
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 11, 2021

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.2%. Comparing base (de5e3dc) to head (a6c8bfc).
⚠️ Report is 26006 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop    #840   +/-   ##
=======================================
  Coverage     82.2%   82.2%           
=======================================
  Files           48      48           
  Lines         1895    1895           
  Branches       303     303           
=======================================
  Hits          1558    1558           
  Misses         337     337           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@smartcontracts smartcontracts left a comment

Choose a reason for hiding this comment

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

Were we making use of TARGET_GAS_LIMIT previously? I'm concerned that we might accidentally set this value to something different than ExecutionManager.maxTransactionGasLimit. Is there something we can do to prevent shooting ourselves in the foot here?

@smartcontracts
Copy link
Copy Markdown
Contributor

Also; does this need a changeset?

@tynes
Copy link
Copy Markdown
Contributor Author

tynes commented May 12, 2021

Were we making use of TARGET_GAS_LIMIT previously? I'm concerned that we might accidentally set this value to something different than ExecutionManager.maxTransactionGasLimit. Is there something we can do to prevent shooting ourselves in the foot here?

This PR overwrites the value from the state dump, we currently have nothing stopping us from using the configured value from differing from the value in the state dump. This is technically safer than before because the values could differ. The remaining problem is that there is a transaction gas limit in the CTC as well that is used to meter L1 to L2 transactions that may be different than the gas limit in the execution manager. There really should be only 1 gas limit config option and setting it in geth is the most flexible.

Also; does this need a changeset?

This does need a changeset, I was on the fence of whether or not this PR should actually get merged as it was put together to help debug other issues. Now I'd like it to be merged so I will add a changeset.

The remaining question for me is should the value also be used to set the value in the CTC?

@tynes
Copy link
Copy Markdown
Contributor Author

tynes commented May 12, 2021

I've added a changeset, the last remaining question is if the same env var should set the storage slot in the CTC as well

@tynes
Copy link
Copy Markdown
Contributor Author

tynes commented May 12, 2021

It sounds like we will not be setting the CTC storage slot - this must be fixed at the contract level

@tynes tynes merged commit cf3cfe4 into develop May 13, 2021
@tynes tynes deleted the fix/dynamic-gaslimit branch May 13, 2021 21:22
InoMurko pushed a commit to omgnetwork/optimism that referenced this pull request May 25, 2021
…ethereum-optimism#840)

* l2geth: allow for the configured max tx gaslimit to be set in the contracts

* chore: add changeset
theochap pushed a commit that referenced this pull request Dec 10, 2025
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