mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #14127 from ethereum/eip-3860
Add warning for EIP-3860 enforced initcode limits
This commit is contained in:
commit
c6aab84a0c
@ -1322,7 +1322,7 @@ void CompilerStack::assemble(
|
||||
}
|
||||
|
||||
// Throw a warning if EIP-170 limits are exceeded:
|
||||
// If contract creation returns data with length greater than 0x6000 (214 + 213) bytes,
|
||||
// If contract creation returns data with length greater than 0x6000 (2^14 + 2^13) bytes,
|
||||
// contract creation fails with an out of gas error.
|
||||
if (
|
||||
m_evmVersion >= langutil::EVMVersion::spuriousDragon() &&
|
||||
@ -1338,6 +1338,24 @@ void CompilerStack::assemble(
|
||||
"Consider enabling the optimizer (with a low \"runs\" value!), "
|
||||
"turning off revert strings, or using libraries."
|
||||
);
|
||||
|
||||
// Throw a warning if EIP-3860 limits are exceeded:
|
||||
// If initcode is larger than 0xC000 bytes (twice the runtime code limit),
|
||||
// then contract creation fails with an out of gas error.
|
||||
if (
|
||||
m_evmVersion >= langutil::EVMVersion::shanghai() &&
|
||||
compiledContract.object.bytecode.size() > 0xC000
|
||||
)
|
||||
m_errorReporter.warning(
|
||||
3860_error,
|
||||
_contract.location(),
|
||||
"Contract initcode size is "s +
|
||||
to_string(compiledContract.object.bytecode.size()) +
|
||||
" bytes and exceeds 49152 bytes (a limit introduced in Shanghai). "
|
||||
"This contract may not be deployable on Mainnet. "
|
||||
"Consider enabling the optimizer (with a low \"runs\" value!), "
|
||||
"turning off revert strings, or using libraries."
|
||||
);
|
||||
}
|
||||
|
||||
void CompilerStack::compileContract(
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user