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

Simplify resolving the dependencies of a transaction #4476

Open
doitian opened this issue Jun 4, 2024 · 4 comments
Open

Simplify resolving the dependencies of a transaction #4476

doitian opened this issue Jun 4, 2024 · 4 comments
Labels
stale To be closed due to a lack of activity t:enhancement Type: Feature, refactoring.

Comments

@doitian
Copy link
Member

doitian commented Jun 4, 2024

Feature Request

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

Given a transaction, clients must use get_transaction and get_header to fetch each input, cell dep, and header dep.

Describe the solution you'd like

Add a high level RPC method to simplify resolving the dependencies of a transaction. The RPC method may accept a tx hash of an existing a transaction, or a full tx payload.

Describe alternatives you've considered

N/A

@doitian doitian added the t:enhancement Type: Feature, refactoring. label Jun 4, 2024
@doitian
Copy link
Member Author

doitian commented Jun 4, 2024

Performance concerns

CKB does not index history dead cells for performance restrictions. Internally, CKB still needs to get the whole transaction from the database to get a single dead cell from its outputs.

@doitian
Copy link
Member Author

doitian commented Jun 4, 2024

Workarounds

  • Use get_transaction to resolve inputs and cell deps. It's recommended to use verbosity=0 to avoid JSON serialization overhead. Since this RPC will return the whole transaction instead of a single output, it's recommended to not include too many huge output cells in one transaction.
  • Use get_header to resolve header deps.

@doitian
Copy link
Member Author

doitian commented Jun 4, 2024

Related

It's a common requirement to handle tx in CKB. For example:

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale To be closed due to a lack of activity label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale To be closed due to a lack of activity t:enhancement Type: Feature, refactoring.
Projects
None yet
Development

No branches or pull requests

1 participant