Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce per tx execution allocations #7990

Merged
merged 12 commits into from
Jan 2, 2025
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Evm.Benchmark/EvmBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void GlobalSetup()
inputData: default
);

_evmState = new EvmState(long.MaxValue, _environment, ExecutionType.TRANSACTION, _stateProvider.TakeSnapshot());
_evmState = EvmState.RentTopLevel(long.MaxValue, ExecutionType.TRANSACTION, _stateProvider.TakeSnapshot(), _environment, new StackAccessTracker());
}

[Benchmark]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void GlobalSetup()
inputData: default
);

_evmState = new EvmState(100_000_000L, _environment, ExecutionType.TRANSACTION, _stateProvider.TakeSnapshot());
_evmState = EvmState.RentTopLevel(100_000_000L, ExecutionType.TRANSACTION, _stateProvider.TakeSnapshot(), _environment, new StackAccessTracker());
}

[Benchmark]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void GlobalSetup()
inputData: default
);

_evmState = new EvmState(100_000_000L, _environment, ExecutionType.TRANSACTION, _stateProvider.TakeSnapshot());
_evmState = EvmState.RentTopLevel(100_000_000L, ExecutionType.TRANSACTION, _stateProvider.TakeSnapshot(), _environment, new StackAccessTracker());
}

[Benchmark(Baseline = true)]
Expand Down
17 changes: 9 additions & 8 deletions src/Nethermind/Nethermind.Evm.Test/EvmStateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,20 @@ public void Can_dispose_after_init()

private static EvmState CreateEvmState(EvmState parentEvmState = null, bool isContinuation = false) =>
parentEvmState is null
? new EvmState(10000,
new ExecutionEnvironment(),
ExecutionType.CALL,
Snapshot.Empty)
: new EvmState(10000,
new ExecutionEnvironment(),
? EvmState.RentTopLevel(10000,
ExecutionType.CALL,
Snapshot.Empty,
new ExecutionEnvironment(),
new StackAccessTracker())
: EvmState.RentFrame(10000,
0,
0,
ExecutionType.CALL,
false,
false,
parentEvmState.AccessTracker,
false);
Snapshot.Empty,
new ExecutionEnvironment(),
parentEvmState.AccessTracker);

public class Context { }
}
Expand Down
Loading
Loading