Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warm up to address at tx start if account is delegated, restrict auth nonce #7717

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

daniellehrner
Copy link
Contributor

PR description

Fixes a missing gas calculation when the to address of a tx has delegated code. The address needs to be warmed up at the beginning of the tx.

The auth of the nonce was before resticted to be less or equal than 264-1, but now must be less than 264-1 to avoid overflows. That is the same restriction that tx nonces already have.

Fixed Issue(s)

fixes #7706

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

.build();
} else {
@SuppressWarnings("OptionalGetWithoutIsPresent") // isContractCall tests isPresent
final Address to = transaction.getTo().get();
final Optional<Account> maybeContract = Optional.ofNullable(evmWorldUpdater.get(to));

if (maybeContract.isPresent() && maybeContract.get().hasDelegatedCode()) {
warmAddressList.add(to);
Copy link
Contributor

Choose a reason for hiding this comment

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

would be great to have a test for this

…compile always as warm account when resolving code

Signed-off-by: Daniel Lehrner <[email protected]>
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.

Devnet-3: Besu forked off at block 110500
2 participants