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

Devnet-3: Besu forked off at block 110500 #7706

Open
daniellehrner opened this issue Oct 1, 2024 · 1 comment · May be fixed by #7717 or #7754
Open

Devnet-3: Besu forked off at block 110500 #7706

daniellehrner opened this issue Oct 1, 2024 · 1 comment · May be fixed by #7717 or #7754
Assignees

Comments

@daniellehrner
Copy link
Contributor

Initial review shows a wrong gas calculation, Besu is charging 2500 gas more for a CALL than the other clients. It seems the problem is:

The tx causing it is 0x01911cedc5083ed9342846193bc1fbf187616f2366df7ba8606e49f39f2b7b93

Analysis

  • Tx is sent to account 3093
  • 3093 is an account which has delegated code
  • At some point the contract make a CALL to itself, 2500 gas is charged too much
  • Whenever an OP code needs to resolve an account with delegated code, we either charge 2600 (cold read) or 100 (warm read) for the resolution. The difference between the 2 is exactly 2500.

Conclusion:
Other clients seem to warm up the to address when the account has delegated code, even though no other additional gas costs are charged for this specific resolution at the beginning of the transaction.

Solution:
Besu needs to warm the to address in this case as well.

@daniellehrner
Copy link
Contributor Author

Here is a test which a similar problem:

To execute it:

1) ./gradlew installDist
2) download https://github.com/ethereum/execution-spec-tests/releases/download/pectra-devnet-3%40v1.5.0/fixtures_pectra-devnet-3.tar.gz and extract it
3) build/install/besu/bin/evmtool block-test $PATH_TO_FIXTURES/blockchain_tests/prague/eip7702_set_code_tx/set_code_txs/set_code_to_self_caller.json

4) to run the debugger add export JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" && before the last command

@daniellehrner daniellehrner linked a pull request Oct 10, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant