Skip to content

Commit 80e703c

Browse files
committed
no materliazation for sstore
1 parent bdfae5b commit 80e703c

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/Nethermind/Nethermind.Core/StorageValue.cs

-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ ref Unsafe.Add(ref Unsafe.As<Vector256<byte>, byte>(ref Unsafe.AsRef(in _bytes))
148148

149149
public override string ToString() => ToHexString(false);
150150

151-
public byte[] ToArray() => BytesWithNoLeadingZeroes.ToArray();
152-
153151
public static StorageValue FromHexString(ReadOnlySpan<byte> hex)
154152
{
155153
const int maxChars = MemorySize * 2;

src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Storage.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ internal static EvmExceptionType InstructionSStore<TTracingInstructions>(Virtual
492492
// Only update storage if the new value differs from the current value.
493493
if (!newSameAsCurrent)
494494
{
495-
vm.WorldState.Set(in storageCell, newIsZero ? BytesZero : value.ToArray());
495+
vm.WorldState.Set(in storageCell, value);
496496
}
497497

498498
// Report storage changes for tracing if enabled.

src/Nethermind/Nethermind.Evm/Tracing/ParityStyle/ParityLikeTxTracer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public override void ReportMemoryChange(long offset, in ReadOnlySpan<byte> data)
275275

276276
public override void ReportStorageChange(in ReadOnlySpan<byte> key, in StorageValue value)
277277
{
278-
_currentOperation!.Store = new ParityStorageChangeTrace { Key = key.ToArray(), Value = value.ToArray() };
278+
_currentOperation!.Store = new ParityStorageChangeTrace { Key = key.ToArray(), Value = value.BytesWithNoLeadingZeroes.ToArray() };
279279
}
280280

281281
public override void ReportBalanceChange(Address address, UInt256? before, UInt256? after)

0 commit comments

Comments
 (0)