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

Request to update RPCs to get cycles of a transaction and a block #3649

Closed
Keith-CY opened this issue Oct 21, 2022 · 2 comments
Closed

Request to update RPCs to get cycles of a transaction and a block #3649

Keith-CY opened this issue Oct 21, 2022 · 2 comments
Assignees
Labels
f:fee-mechanism Feature: Fee Mechanism t:enhancement Type: Feature, refactoring.

Comments

@Keith-CY
Copy link
Collaborator

Feature Request

  1. Add a cycles field in result of get_transaction RPC;
  2. Add a cycles field in result of get_block

Is your feature request related to a problem? Please describe.

We're going to add a cycles field on the transaction page and block page of CKB Explorer.

For a single transaction, we can call the dry_run_transaction RPC to get its cycles. However, the dry_run_transaction RPC is for development(estimate cycles to optimize a transaction) but not for data querying.

Besides, when it's a block page, we need to get cycles of all transactions in it to get the cycles of a block so we have to dry run all transactions, which might be infeasible.

After a consultation, we've learned that

All transaction cycles of a block are stored in the ckb full node, but this is an internal data, not exposed through rpc

So I think an extra field cycles could be returned along with the get_transaction and get_block RPCs.

Refs:

Describe the solution you'd like

As mentioned in the Feature Request section

Describe alternatives you've considered

None

@Keith-CY Keith-CY added the t:enhancement Type: Feature, refactoring. label Oct 21, 2022
@doitian doitian moved this to 🆕 New in CKB Kanban Nov 1, 2022
@doitian doitian moved this from 🆕 New to 📋 Backlog in CKB Kanban Nov 1, 2022
@doitian
Copy link
Member

doitian commented Nov 1, 2022

Related:

@zhangsoledad
Copy link
Member

#3684

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in CKB Kanban Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f:fee-mechanism Feature: Fee Mechanism t:enhancement Type: Feature, refactoring.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants