-
Notifications
You must be signed in to change notification settings - Fork 88
Description
Description
The contractCodeSize function uses the size of the transaction's call data as the size of the contract.
I don't think it's possible to calculate the final contract size based on the transaction details alone without executing the EVM code, so I suggest skipping this pre-check entirely.
hiero-json-rpc-relay/packages/relay/src/lib/precheck.ts
Lines 395 to 402 in edd6c18
| contractCodeSize(tx: Transaction): void { | |
| if (!tx.to) { | |
| const contractCodeSize = tx.data.replace('0x', '').length / 2; | |
| if (contractCodeSize > constants.CONTRACT_CODE_SIZE_LIMIT) { | |
| throw predefined.CONTRACT_CODE_SIZE_LIMIT_EXCEEDED(contractCodeSize, constants.CONTRACT_CODE_SIZE_LIMIT); | |
| } | |
| } | |
| } |
hiero-json-rpc-relay/packages/relay/src/lib/precheck.ts
Lines 349 to 355 in edd6c18
| callDataSize(tx: Transaction): void { | |
| const totalCallDataSizeInBytes = tx.data.replace('0x', '').length / 2; | |
| const callDataSizeLimit = constants.CALL_DATA_SIZE_LIMIT; | |
| if (totalCallDataSizeInBytes > callDataSizeLimit) { | |
| throw predefined.CALL_DATA_SIZE_LIMIT_EXCEEDED(totalCallDataSizeInBytes, callDataSizeLimit); | |
| } | |
| } |
Steps to reproduce
- Deploy a contract smaller than 24 KB but using a call data bigger than 24 KB
- See an error similar to this
{"error":{"code":-32201,"message":"[Request ID: 19e1ce52-ff63-4cbd-894e-b9d941e23c9a] Oversized data: contract code size 30412, contract code size limit 24576"},"jsonrpc":"2.0","id":86}
Additional context
No response
Hedera network
No response
Version
v0.69.2
Operating system
None
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working