-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
GraphQL returns transaction.status = 0 (failed) for successful pre-Byzantium transactions #24124
Labels
Comments
amyodov
added a commit
to UniversaBlockchain/UniCherryGarden
that referenced
this issue
Dec 16, 2021
…"status" for the transactions (ethereum/go-ethereum#24124). Unit tests should pass and be equivalent now for both JSON-RPC and GraphQL access.
amyodov
added a commit
to UniversaBlockchain/UniCherryGarden
that referenced
this issue
Dec 16, 2021
…"status" for the transactions (ethereum/go-ethereum#24124). Unit tests should pass and be equivalent now for both JSON-RPC and GraphQL access.
I would like to contribute for the project |
This patch should fix it. Will test and submit a PR. diff --git a/graphql/graphql.go b/graphql/graphql.go
index e92f1126f..2c71eb2ec 100644
--- a/graphql/graphql.go
+++ b/graphql/graphql.go
@@ -372,8 +372,11 @@ func (t *Transaction) Status(ctx context.Context) (*Long, error) {
if err != nil || receipt == nil {
return nil, err
}
- ret := Long(receipt.Status)
- return &ret, nil
+ var ret *Long
+ if len(receipt.PostState) == 0 {
+ *ret = Long(receipt.Status)
+ }
+ return ret, nil
}
func (t *Transaction) GasUsed(ctx context.Context) (*Long, error) { |
Merry Christmas! Just a friendly expression of curiosity how’s the PR going, and may it hit the upcoming Geth release... |
fjl
pushed a commit
that referenced
this issue
Jan 5, 2022
sidhujag
pushed a commit
to syscoin/go-ethereum
that referenced
this issue
Jan 6, 2022
amyodov
added a commit
to UniversaBlockchain/UniCherryGarden
that referenced
this issue
Jan 11, 2022
…raphQL queries to geth, as it has been fixed upstream (ethereum/go-ethereum#24124).
JacekGlen
pushed a commit
to JacekGlen/go-ethereum
that referenced
this issue
May 26, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System information
Geth version: 1.10.13
OS & Version: Linux
Expected behaviour
CLI, JSON-RPC:
GraphQL:
GraphQL result:
Actual behaviour
CLI, JSON-RPC:
GraphQL:
GraphQL result:
Steps to reproduce the behaviour
Check the "status" field of the transactions via JSON-RPC/CLI, and via GraphQL.
I haven’t checked with many transactions but seems like the bug happens on block 4369999 and doesn’t happen in block 4370000, meaning it is a pre-Byzantium-specific problem.
In general I believe the GraphQL should return the very same data as the JSON-RPC interface; if it does smart detection "which transactions actually considered successful and which don’t" it could be great, too; but it definitely should not return 0/failed for transactions which are valid in any current interpretations.
The text was updated successfully, but these errors were encountered: