Skip to content

Commit 0ca0013

Browse files
committed
no materliazation for sstore
1 parent bdfae5b commit 0ca0013

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Nethermind/Nethermind.Core/StorageValue.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ ref Unsafe.Add(ref Unsafe.As<Vector256<byte>, byte>(ref Unsafe.AsRef(in _bytes))
137137
}
138138
}
139139

140+
public byte[] ToArray() => BytesWithNoLeadingZeroes.ToArray();
141+
140142
public static bool operator ==(StorageValue left, StorageValue right) => left.Equals(right);
141143

142144
public static bool operator !=(StorageValue left, StorageValue right) => !left.Equals(right);
@@ -148,8 +150,6 @@ ref Unsafe.Add(ref Unsafe.As<Vector256<byte>, byte>(ref Unsafe.AsRef(in _bytes))
148150

149151
public override string ToString() => ToHexString(false);
150152

151-
public byte[] ToArray() => BytesWithNoLeadingZeroes.ToArray();
152-
153153
public static StorageValue FromHexString(ReadOnlySpan<byte> hex)
154154
{
155155
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.

0 commit comments

Comments
 (0)