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

RPC for querying receipts #3177

Closed
ilblackdragon opened this issue Aug 16, 2020 · 10 comments
Closed

RPC for querying receipts #3177

ilblackdragon opened this issue Aug 16, 2020 · 10 comments
Assignees
Labels
A-RPC Area: rpc C-bug Category: This is a bug

Comments

@ilblackdragon
Copy link
Member

Getting timeout errors while fetching tx-status of the receipt when using a single node setup on localhost.

$ near tx-status test.near:ADFm3ULGtbFycZzQXaTXogb2qDbAtW6CEtW7SgkJaHEm
Error:  TypedError: [-32000] Server error: Timeout error
    at JsonRpcProvider.sendJsonRpc (/usr/local/lib/node_modules/near-shell/node_modules/near-api-js/lib/providers/json-rpc-provider.js:157:27)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
    at async /usr/local/lib/node_modules/near-shell/commands/tx-status.js:33:24
    at async Object.handler (/usr/local/lib/node_modules/near-shell/utils/exit-on-error.js:37:9) {
  type: 'UntypedError'
}

Steps to reproduce

  1. Send some transaction that has receipts (function calls / transfers)
  2. Find the receipt ID
  3. Call near tx-status <account_id>:<receipt_hash>

Observe timeout error.

Expected:

  • Either "not found" error
  • Or receipt info
@ilblackdragon ilblackdragon added C-bug Category: This is a bug A-RPC Area: rpc labels Aug 16, 2020
@bowenwang1996
Copy link
Collaborator

We disabled receipt query long ago. The issue here is that a node cannot distinguish just from the hash whether you intend to query transaction or receipt and it assumes that you are trying to query a transaction.

@frol
Copy link
Collaborator

frol commented Aug 24, 2020

Should this be transformed into an issue of adding an API for fetching Receipt status (execution outcome)?

@frol frol assigned frol and unassigned SkidanovAlex Aug 24, 2020
@bowenwang1996 bowenwang1996 changed the title Timeout fetching receipt from localhost RPC for querying receipts Nov 21, 2020
@bowenwang1996
Copy link
Collaborator

According to @abacabadabacaba, it is now needed for the bridge to work. Let's prioritize this

@frol
Copy link
Collaborator

frol commented Nov 21, 2020

What data is needed? Receipt or execution outcome, or both?

@bowenwang1996
Copy link
Collaborator

@abacabadabacaba please clarify.

@abacabadabacaba
Copy link
Collaborator

For the bridge, the receipt itself is needed (specifically, which functions were called, as well as the arguments).

@alexauroradev
Copy link
Collaborator

@Kouprin , is this something that needs to be done to enable #3658 ? You managed to do it somehow, don't you?

The background is outlined in the Near-One/rainbow-bridge#432 . In short here're the steps that we would like to reproduce:

  1. A user sends a transaction to token connector on NEAR. This transaction produces execution outcome.
  2. This execution outcome is requested from NEAR in a provable format, ...
  3. To send it to Ethereum contract to get tokens on Ethereum side.

Now, there should be an ability to do the step 2, having all the necessary info from the first transaction.

@Kouprin , can you please comment whether this is something that can be achieved at the moment?

@bowenwang1996
Copy link
Collaborator

Now, there should be an ability to do the step 2, having all the necessary info from the first transaction.

That is already possible currently. EXPERIMENTAL_tx_status endpoint allows one to query execution outcomes and will return all the receipts the transaction generated.

@frol
Copy link
Collaborator

frol commented Jan 29, 2021

@khorolets we need a new EXPERIMENTAL_receipt method exposing Receipt info by a given Receipt ID (and chances are that we need to require Receiver Account ID due to sharding)

@khorolets
Copy link
Member

I forgot to refer to this issue in #3883 I guess we can close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-RPC Area: rpc C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

7 participants