-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Conversation
@@ -147,7 +147,7 @@ public synchronized void saveCode(byte[] addr, byte[] code) { | |||
@Override | |||
public byte[] getCodeHash(byte[] addr) { | |||
AccountState accountState = getAccountState(addr); | |||
return accountState != null ? accountState.getCodeHash() : HashUtil.EMPTY_DATA_HASH; | |||
return accountState != null ? accountState.getCodeHash() : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that this change won't break anything else than getCode
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkalinin checked it with extra attention, it shouldn't break anything for us
PrecompiledContracts.getContractForAddress(address, blockchainConfig); | ||
|
||
byte[] codeHash; | ||
// The EXTCODEHASH of an precompiled contract is either c5d246... or 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it means that if precompile acc is non-existent the hash is 0 otherwise the hash is an empty data hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hence, precompile contract doesn't need a special case to be processed
…re existant in repo
Do not merge,
GitHubBlockStateTest
tests are not passed.