Skip to content

Commit

Permalink
AKI-166: Fix to kernelInterface removeStorage
Browse files Browse the repository at this point in the history
- The removeStorage() method was incorrectly doing an addStorage and
  overwriting the value with byte[]{0}. This has been fixed to properly
  delete the storage value. The avm relies on there being a difference
  between null and non-null, so it would be incorrect to treat missing/null
  as a non-null entry from its perspective. This code path affects the
  getStorage and putStorage behaviour that the Avm exposes.
  • Loading branch information
aionick committed May 29, 2019
1 parent abcfb61 commit 46e0cb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modVM/src/org/aion/vm/KernelInterfaceForAVM.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void putStorage(Address address, byte[] key, byte[] value) {
@Override
public void removeStorage(Address address, byte[] key) {
ByteArrayWrapper storageKey = new ByteArrayWrapper(key);
this.repositoryCache.addStorageRow(address, storageKey, ByteArrayWrapper.ZERO);
this.repositoryCache.removeStorageRow(address, storageKey);
setVmType(address);
}

Expand Down

0 comments on commit 46e0cb3

Please sign in to comment.