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

Refactoring With Lumos #177

Closed
35 tasks done
homura opened this issue May 30, 2023 · 4 comments
Closed
35 tasks done

Refactoring With Lumos #177

homura opened this issue May 30, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@homura
Copy link

homura commented May 30, 2023

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

@Keith-CY Keith-CY added this to Neuron Jun 6, 2023
@Danie0918 Danie0918 added the enhancement New feature or request label Jun 12, 2023
@Danie0918 Danie0918 moved this to 🏗 In Progress in Neuron Jun 12, 2023
@zhangyouxin
Copy link

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.

@homura
Copy link
Author

homura commented Jun 12, 2023

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

@homura
Copy link
Author

homura commented May 27, 2024

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

@twhy
Copy link

twhy commented May 27, 2024

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

Agree ^-^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ✅ Done
Development

No branches or pull requests

7 participants