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

Conversation

yerke26
Copy link
Contributor

@yerke26 yerke26 commented Jan 30, 2025

Geth:

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": -32000,
        "message": "err: blob transaction missing blob hashes (supplied gas 50000000)"
    }
}

Nethermind:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "BlobTxMissingBlobs: Blob transaction must have blobs."
}
}

Changes

  • List the changes

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • Yes
  • No

If yes, link the PR to the docs update or the issue with the details labeled docs. Remove if not applicable.

Requires explanation in Release Notes

  • Yes
  • No

If yes, fill in the details here. Remove if not applicable.

Remarks

Optional. Remove if not applicable.

@yerke26 yerke26 requested a review from LukaszRozmej January 30, 2025 10:01
@@ -221,9 +219,8 @@ public CallOutput CreateAccessList(BlockHeader header, Transaction tx, Cancellat
TransactionResult tryCallResult = TryCallAndRestore(_processingEnv.Build(header.StateRoot!), header, tx, false,
new CompositeTxTracer(callOutputTracer, accessTxTracer).WithCancellation(cancellationToken));

return new CallOutput
return new CallOutput(tryCallResult.Success ? callOutputTracer.Error : tryCallResult.Error, tx.GasLimit)
Copy link
Member

Choose a reason for hiding this comment

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

I think I would prefer explicit setting the Error property as it was. Just create here a helper method to create error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

created a helper function ConstructErrorMessage

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants