[WIP] Update the contract limit size to follow EIP170 and add tests against it#1483
[WIP] Update the contract limit size to follow EIP170 and add tests against it#1483glaksmono wants to merge 1 commit intoethereum:mainfrom
Conversation
| CANONICAL_ADDRESS_B = to_canonical_address("0xcd1722f3947def4cf144679da39c4c32bdc35681") | ||
| CONTRACT_CODE_A = b"" | ||
| CONTRACT_CODE_B = b"" | ||
| CONTRACT_CODE_C = b"" |
There was a problem hiding this comment.
@pipermerriam Would like to get suggestion on what is the best way of having different kinds of contract code in our tests. Do we usually just hardcode the bytecode here?
There was a problem hiding this comment.
Typically yes. I assume we don't need complex code and we could just do something like: CODE = b'\x01' * 20000 or something to keep it concise.
16b0852 to
39fdd9f
Compare
|
@pipermerriam, @glaksmono .Is this issue still open? it seems that is pretty close to being resolved, May I give it a try? |
|
|
||
| # https://github.com/ethereum/EIPs/issues/170 | ||
| EIP170_CODE_SIZE_LIMIT = 24577 | ||
| EIP170_CODE_SIZE_LIMIT = 24576 |
There was a problem hiding this comment.
| EIP170_CODE_SIZE_LIMIT = 24576 | |
| EIP170_CODE_SIZE_LIMIT = 24576 # 2**14 + 2**13 |
|
|
||
| NORMALIZED_ADDRESS_A = "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" | ||
| NORMALIZED_ADDRESS_B = "0xcd1722f3947def4cf144679da39c4c32bdc35681" | ||
| CANONICAL_ADDRESS_A = to_canonical_address("0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6") |
There was a problem hiding this comment.
| CANONICAL_ADDRESS_A = to_canonical_address("0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6") | |
| CANONICAL_ADDRESS_A = to_canonical_address(NORMALIZED_ADDRESS_A) |
| NORMALIZED_ADDRESS_A = "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" | ||
| NORMALIZED_ADDRESS_B = "0xcd1722f3947def4cf144679da39c4c32bdc35681" | ||
| CANONICAL_ADDRESS_A = to_canonical_address("0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6") | ||
| CANONICAL_ADDRESS_B = to_canonical_address("0xcd1722f3947def4cf144679da39c4c32bdc35681") |
There was a problem hiding this comment.
| CANONICAL_ADDRESS_B = to_canonical_address("0xcd1722f3947def4cf144679da39c4c32bdc35681") | |
| CANONICAL_ADDRESS_B = to_canonical_address(NORMALIZED_ADDRESS_B) |
| CANONICAL_ADDRESS_B = to_canonical_address("0xcd1722f3947def4cf144679da39c4c32bdc35681") | ||
| CONTRACT_CODE_A = b"" | ||
| CONTRACT_CODE_B = b"" | ||
| CONTRACT_CODE_C = b"" |
There was a problem hiding this comment.
Typically yes. I assume we don't need complex code and we could just do something like: CODE = b'\x01' * 20000 or something to keep it concise.
| ) | ||
|
|
||
| """ | ||
| TODO: CONTRACT_CODE_B size is equal to EIP170_CODE_SIZE_LIMIT |
There was a problem hiding this comment.
Test should probably be parametrized (or use a parametrized fixture) instead of testing all three in the same test.
What was wrong?
EIP170 states that the contract size limit was changed to
2**14 + 2**13which is24,576 bytes. The following line implementations the constant for EIP170, but it is off by one.Issue Reference: #1466
How was it fixed?
Cute Animal Picture