Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,20 @@ public NativeCallTracer(
public override GethLikeTxTrace BuildResult()
{
GethLikeTxTrace result = base.BuildResult();
NativeCallTracerCallFrame firstCallFrame = _callStack[0];

Debug.Assert(_callStack.Count == 1, $"Unexpected frames on call stack, expected only master frame, found {_callStack.Count} frames.");

_callStack.RemoveAt(0);
_disposables.Add(firstCallFrame);
if (_callStack.Count is not 0)
{
NativeCallTracerCallFrame firstCallFrame = _callStack[0];
_callStack.RemoveAt(0);
_disposables.Add(firstCallFrame);

result.TxHash = _txHash;
result.CustomTracerResult = new GethLikeCustomTrace { Value = firstCallFrame };
result.TxHash = _txHash;
result.CustomTracerResult = new GethLikeCustomTrace { Value = firstCallFrame };
}

result.TxHash = _txHash;
_resultBuilt = true;

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using Nethermind.Core;
using Nethermind.Core.Crypto;
using Nethermind.Evm;
Expand All @@ -13,33 +12,26 @@ namespace Nethermind.Blockchain.Tracing.GethStyle;

public record GethTraceOptions
{
[JsonPropertyName("disableMemory")]
[Obsolete("Use EnableMemory instead.")]
public bool DisableMemory { get => !EnableMemory; init => EnableMemory = !value; }

[JsonPropertyName("disableStorage")]
public bool DisableStorage { get; init; }

[JsonPropertyName("enableMemory")]
public bool EnableMemory { get; init; }

[JsonPropertyName("disableStack")]
public bool DisableStack { get; init; }

[JsonPropertyName("timeout")]
public string Timeout { get; init; }

[JsonPropertyName("tracer")]
public string Tracer { get; init; }

[JsonPropertyName("txHash")]
public Hash256? TxHash { get; init; }

[JsonPropertyName("tracerConfig")]
public JsonElement? TracerConfig { get; init; }

[JsonPropertyName("stateOverrides")]
public Dictionary<Address, AccountOverride>? StateOverrides { get; init; }

public BlockOverride? BlockOverrides { get; set; }

public static GethTraceOptions Default { get; } = new();
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,14 @@ public IEnumerable<string> TraceBadBlockToFile(Hash256 blockHash, GethTraceOptio
//
// Wild stuff!
BlockHeader baseBlockHeader = block.Header;

if ((processingOptions & ProcessingOptions.ForceSameBlock) == 0)
{
baseBlockHeader = FindParent(block);
}

using var scope = blockProcessingEnv.BuildAndOverride(baseBlockHeader, options.StateOverrides);
options.BlockOverrides?.ApplyOverrides(block.Header);
using Scope<BlockProcessingComponents> scope = blockProcessingEnv.BuildAndOverride(baseBlockHeader, options.StateOverrides);
IBlockTracer<GethLikeTxTrace> tracer = CreateOptionsTracer(block.Header, options with { TxHash = txHash }, scope.Component.WorldState, specProvider);

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Nethermind.Core.Crypto;
using Nethermind.Int256;

namespace Nethermind.Facade.Proxy.Models.Simulate;
namespace Nethermind.Evm;

public class BlockOverride
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Nethermind.Core;
using Nethermind.Evm;
using Nethermind.Facade.Eth.RpcTransaction;
using Nethermind.Facade.Proxy.Models.Simulate;

namespace Nethermind.JsonRpc.Modules.DebugModule;

Expand Down