Closed homura closed 6 months ago
We can seperate these tasks to small issues so that it is easy to write smaller PRs and can be parallelly executed by different team members.
We can seperate these tasks to small issues so that it is easy to write smaller PRs and can be parallelly executed by different team members.
OK, I'll transform the plan section into TODO list
IndexerCacheService.fetchTxMapping -> TransactionCollector with grouped transaction feature
The CKB indexer offers a feature group_by_transaction
that allows the grouping of indexed transactions by their transaction hashes instead of having an array with multiple identical transactions. This feature is useful for scenarios where the io_index
has not cared
We can simplify the fetchTxMapping
as follows to reduce unnecessary lines and IO
const grouped = get_transactions({
search_key: {
lock: ...,
group_by_transaction: true,
limit: no_limit_here
}
})
grouped.forEach(({tx_hash}) => {
mappingsByTxHash.set(tx_hash, [...])
})
This is a small improvement, so I suggest we move the point to the backlog
IndexerCacheService.fetchTxMapping -> TransactionCollector with grouped transaction feature
The CKB indexer offers a feature
group_by_transaction
that allows the grouping of indexed transactions by their transaction hashes instead of having an array with multiple identical transactions. This feature is useful for scenarios where theio_index
has not caredWe can simplify the
fetchTxMapping
as follows to reduce unnecessary lines and IOconst grouped = get_transactions({ search_key: { lock: ..., group_by_transaction: true, limit: no_limit_here } }) grouped.forEach(({tx_hash}) => { mappingsByTxHash.set(tx_hash, [...]) })
This is a small improvement, so I suggest we move the point to the backlog
Agree ^-^
Background
Currently, there are several Lumos modules was reimplemented in Neuron, this results in higher maintenance cost for Neuron as the reimplementation causes us to rewrite unit tests
List
LumosCell
->lumos/base/Cell
- not compatibleLumosCellQuery
->lumos/ckb-indexer/QueryOptions
- compatibleIndexerCacheService.fetchTxMapping
->TransactionCollector
with grouped transaction featureHexString === HexString
->bytes.equal
to avoid0xAA !== 0xaa
shannonToCKB
,sudtValueToAmount
->BI.formatUnit
models/blake2b
->lumos/base/utils/blake2b
models/multisig
->lumos/base/since
ckb indexer url
with theckb url
, since the CKB Indexer has been integrated into CKBmodels/keys
->@ckb-lumos/hd
@nervosnetwork/ckb-sdk-x
can be refactored with the lumos[x] #202
[x] https://github.com/ckb-js/lumos/pull/560
[x] https://github.com/nervosnetwork/neuron/pull/2843 (in test)
[x] #201
[x] https://github.com/nervosnetwork/neuron/pull/2801
[x] https://github.com/nervosnetwork/neuron/pull/2802
[x] https://github.com/nervosnetwork/neuron/pull/2803
[x] https://github.com/nervosnetwork/neuron/pull/2814
[x] https://github.com/nervosnetwork/neuron/pull/2817
[x] the global variable
ckbCore
[x] @nervosnetwork/ckb-sdk-utils