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

correct rpc transaction status #2132

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

rianhughes
Copy link
Contributor

close #2131

@rianhughes rianhughes marked this pull request as ready for review September 11, 2024 07:59
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 78.36%. Comparing base (b2f565e) to head (fa2a2cb).

Files with missing lines Patch % Lines
rpc/transaction.go 0.00% 6 Missing ⚠️
starknet/transaction.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2132   +/-   ##
=======================================
  Coverage   78.35%   78.36%           
=======================================
  Files         100      100           
  Lines        9221     9225    +4     
=======================================
+ Hits         7225     7229    +4     
- Misses       1356     1357    +1     
+ Partials      640      639    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -791,8 +793,6 @@ func adaptTransactionStatus(txStatus *starknet.TransactionStatus) (*TransactionS
status.Execution = TxnSuccess
case starknet.Reverted:
status.Execution = TxnFailure
case starknet.Rejected:
status.Finality = TxnStatusRejected
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure that Rejected is part of finality status? according to this image it should be in ExecutionStatus:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@rianhughes rianhughes Sep 11, 2024

Choose a reason for hiding this comment

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

This image in this doc suggests it should be apart of Finality Status

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rianhughes rianhughes marked this pull request as draft September 11, 2024 10:11
@rianhughes
Copy link
Contributor Author

rianhughes commented Sep 12, 2024

The behaviour of this endpoint is a bit strange, because the FGW can return "NOT_RECEIVED" as the finality status (see the url below), but the RPC spec does not allow returning this value. This means users who query for the transaction status of a transaction that is unknown to the FGW will receive an unofficial error (eg "unknown FinalityStatus.."), rather than the "NOT_RECEIVED" finality status (which the docs suggest). Imo, the spec should be changed, but this PR follows 0.7.1 as expected.

eg https://alpha-mainnet.starknet.io/feeder_gateway/get_transaction?transactionHash=0x1b59029be1c10c12298f1bb272b1c3c622e1e89a379e18f77ae33bcb3886379

@rianhughes rianhughes marked this pull request as ready for review September 12, 2024 14:20
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.

RPC fix - txn status
2 participants