Skip to content

Conversation

@matheusaaguiar
Copy link
Collaborator

@matheusaaguiar matheusaaguiar commented Nov 21, 2025

Previous PR for reference: #16030

@cameel cameel requested a review from nikola-matic November 24, 2025 14:29
@cameel cameel added this to the 0.8.31 milestone Nov 24, 2025
@nikola-matic nikola-matic force-pushed the set-osaka-default branch 3 times, most recently from 5b9f3fe to 024b18c Compare December 2, 2025 11:42
Copy link
Collaborator

Choose a reason for hiding this comment

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

This was a bit annoying to figure out. Osaka introduced a transaction gas limit of 2^24 (16_777_216) gas limit; Hardhat team then initially implemented usage of this transaction gas limit in lieu of the block gas limit depending on the EVM version, which wouldn't have caused annoying failures in all of our external tests:

ProviderError: transaction gas limit (30000000) is greater than the cap (16777216)

However, they then decided to have this implemented in hardhat/EDR, which they did in fact do, but unfortunately, this has not been released yet, which means I had to explicitly set hardhat.blockGasLimit to 16_777_216 instead of the default (30_000_000). This now allows all tests to pass.

Here's a bit more context from the hardhat PR that introduced Osaka support.

Copy link
Collaborator

Choose a reason for hiding this comment

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

# Hardhat 3.0+ breaks the test suite
yarn add [email protected]
# v2.27.1 is the last v2 Hardhat (introduces Osaka support)
yarn add [email protected]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Self explanatory - Osaka was only introduced in 2.27.1.

@nikola-matic nikola-matic marked this pull request as ready for review December 2, 2025 11:54
@nikola-matic nikola-matic requested a review from cameel December 2, 2025 11:54
cameel
cameel previously approved these changes Dec 2, 2025
Copy link
Collaborator

@cameel cameel left a comment

Choose a reason for hiding this comment

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

Approving, because it does the job, but could use a few minor tweaks if there's time to apply them.

echo "module.exports.solidity = ${compiler_settings};"
echo "module.exports.networks.hardhat = module.exports.networks.hardhat || { hardfork: '${evm_version}' }"
echo "module.exports.networks.hardhat.hardfork = '${evm_version}'"
if [[ $evm_version == "osaka" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like a new place where we'll have to list all the newer EVM versions. Do we actually care about the exact value of the gas limit? Like, do any tests fail when it's too high because they specifically test for it or something.

It's important when developing dapps, but IMO for our testing it does not matter. We'd be better off disabling it, or at least set a very high value (same for all EVM versions) if that's not possible.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The check is not strictly necessary, however, the gas value is (at least for Osaka) - in fact, setting it to as high a value as possible would be the opposite of what we want for Osaka; if it's set higher than 2^24, all of the external tests (hardhat based) will fail.

I believe that it won't be necessary after the next ERD release is out.

@cameel
Copy link
Collaborator

cameel commented Dec 2, 2025

Oh, I see that we forgot to add CLZ to the list of EVM features under Target Options. We should add it now.

The mention about EOF is outdated too. Perhaps we should remove it. Or at least remove it from this list and only mention it in the description of the eofVersion Standard JSON option. It's still in the compiler and still requires --evm-version osaka, but it's not really an EVM feature in Osaka.

@nikola-matic nikola-matic force-pushed the set-osaka-default branch 2 times, most recently from 327f71c to 849831e Compare December 2, 2025 17:03
Comment on lines 108 to 109
# Fails under evmVersion=osaka, likely due to transaction gas limits introduced by EIP-7825
sed -i "s|describe(\('RSA'\)|describe.skip(\1|g" test/utils/cryptography/RSA.test.js
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, so you think it's due to the gas limits and not EIP-7823: Set upper bounds for MODEXP?

I guess it could be true given that I checked the failing test and the all the parameters seemed in range. For the record, here's what I posted on the chat:

I checked their tests for RSA.sol and the data file they take the test parameters from (SigVer15_186-3.rsp), but I don't see any cases where any of those those parameters would exceed the limits. The limit is 1024 bytes while the cases go up to 512 bytes. Even accounting for some bug somewhere that would incorrectly count characters as bytes (values are hex-encoded so 2 chars encode one byte if you count correctly), we're still only at 1024, which is allowed.

Also EIP-7883: ModExp Gas Cost Increase would definitely contribute to increased gas use.

One thing that still does not add up for me is that this is a manually thrown Panic rather than an out-of-gas revert. tryModExp() forwards all gas to the staticcall so I'd expect the outer call to fail out of gas as well without being able to react. Or is the 1/64th of gas still enough for it to perform that manual revert?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, right, my brain is fried, it could also very well be due to https://eips.ethereum.org/EIPS/eip-7823 (in fact that's more likely).

I'm now not sure whether to add this to the comment as well, as it would risk another circleci re-run :/

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean, I dismissed this as less likely initially, but you may be on to something here :)

cameel
cameel previously approved these changes Dec 2, 2025
@matheusaaguiar matheusaaguiar merged commit f5f5ded into develop Dec 2, 2025
81 checks passed
@matheusaaguiar matheusaaguiar deleted the set-osaka-default branch December 2, 2025 19:12
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.

4 participants