Closed homura closed 3 weeks ago
Is it impossible to resolve this issue with dead cells because dead cells in RocksDB always be deleted from COLUMN_CELL
? @quake
Or we can query deadcell from COLUMN_BLOCK_BODY
?
we can query deadcell from
COLUMN_BLOCK_BODY
?
To achieve the feature, I'm extracting the cell from the corresponding transaction using the following code:
tx_hash = []
for input in inputs:
tx_hash.append(input.previous_output.tx_hash)
txs = batch_and_chunk('get_transaction', tx_hash, chunk_size)
zip_with(inputs, txs, zip_func)
However, there are some challenges with this approach:
inputs
may contain hundreds or thousands of input items@homura Hello. Could you describe the "use case" in which you need to query DeadCell?
@homura Hello. Could you describe the "use case" in which you need to query DeadCell?
We are developing a data aggregation layer to retrieve historical data from the blockchain, including CKB. A component of this project, called sync, extracts data from the blockchain block by block and converts the transactions into human-readable actions. These actions include native and derived asset minting, transfers, burns, DeFi swaps, liquidity operations, and more. We use the get_block
RPC to request blocks. Currently, we decode the blocks using the mentioned approach to ensure that the cells in both the inputs and outputs are accessible and determine the purpose of the transaction.
Another project from a long time ago was an asset bridge, which had no backend and used CKB RPC directly, and in the transaction history we also needed to render from and to information, which was also a user story
To provide functionality such as querying “which transaction spent a cell”, the ckb node would need to keep track of the referential relationship of each dead cell, this will significantly increase storage requirements and IO overhead.
CKB's rpc design is same as Bitcoin, focus on maintaining the UTXO set only, as this helps to speed up the transaction verification process, complex queries are often considered to be within the scope of functionality of third-party services such as block browsers and analytics platforms.
To provide functionality such as querying “which transaction spent a cell”,
I want to clarify that the feature request is to resolve (dead) cells by OutPoint
s instead of querying "which transaction spent a cell". The purpose is to prune unnecessary data while resolving inputs
' OutPoint
s. The CKB node can store all transactions and retrieve the specific transaction by a hash.
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.
This issue was closed because it has been stalled for 5 days with no activity.
Feature Request
In some dApp scenarios, it's necessary to resolve a cell even if the cell has already been consumed. This is needed for tasks such as analyzing the purpose of a transaction and rendering transaction records that include both the sender and recipient.
Developers currently have to resolve an
OutPoint
by fetching an entire transaction and then extracting the corresponding cell from itsoutputs
. This becomes challenging when the pointed transaction is largeIs your feature request related to a problem? Please describe.
Describe the solution you'd like
Add a new RPC similar to
get_live_cell
without the status of the cellRequest
Response
Describe alternatives you've considered