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

standardize BlobTxMissingBlobs error message #8129

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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 @@ -47,7 +47,7 @@ public static string BlobTxGasLimitExceeded(ulong totalDataGas, ulong maxBlobGas
$"BlobTxGasLimitExceeded: Transaction's totalDataGas={totalDataGas} exceeded MaxBlobGas per transaction={maxBlobGas}.";

public const string BlobTxMissingBlobs =
"BlobTxMissingBlobs: Blob transaction must have blobs.";
"blob transaction missing blob hashes";

public const string MissingBlobVersionedHash =
"MissingBlobVersionedHash: Must be set.";
Expand Down
12 changes: 9 additions & 3 deletions src/Nethermind/Nethermind.Facade/BlockchainBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public CallOutput Call(BlockHeader header, Transaction tx, Dictionary<Address, A

return new CallOutput
{
Error = tryCallResult.Success ? callOutputTracer.Error : tryCallResult.Error,
Error = ConstructError(tryCallResult, callOutputTracer.Error, tx.GasLimit),
GasSpent = callOutputTracer.GasSpent,
OutputData = callOutputTracer.ReturnValue,
InputError = !tryCallResult.Success
Expand Down Expand Up @@ -204,7 +204,7 @@ public CallOutput EstimateGas(BlockHeader header, Transaction tx, int errorMargi

return new CallOutput
{
Error = tryCallResult.Success ? estimateGasTracer.Error : tryCallResult.Error,
Error = ConstructError(tryCallResult, estimateGasTracer.Error, tx.GasLimit),
GasSpent = estimate,
InputError = !tryCallResult.Success
};
Expand All @@ -223,7 +223,7 @@ public CallOutput CreateAccessList(BlockHeader header, Transaction tx, Cancellat

return new CallOutput
{
Error = tryCallResult.Success ? callOutputTracer.Error : tryCallResult.Error,
Error = ConstructError(tryCallResult, callOutputTracer.Error, tx.GasLimit),
GasSpent = accessTxTracer.GasSpent,
OperationGas = callOutputTracer.OperationGas,
OutputData = callOutputTracer.ReturnValue,
Expand Down Expand Up @@ -432,5 +432,11 @@ public IEnumerable<FilterLog> FindLogs(LogFilter filter, CancellationToken cance
{
return _logFinder.FindLogs(filter, cancellationToken);
}

private string? ConstructError(TransactionResult txResult, string? tracerError, long gasLimit)
{
string? error = txResult.Success ? tracerError : txResult.Error;
return error != null ? $"err: {error} (supplied gas {gasLimit})" : null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not null

}
}
}
Loading