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

Dictionary v2 #2257

Merged
merged 55 commits into from
Mar 12, 2024
Merged

Dictionary v2 #2257

merged 55 commits into from
Mar 12, 2024

Conversation

jiqiang90
Copy link
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation
  • Linked to any relevant issues
  • I have added tests relevant to my changes
  • Any dependent changes have been merged and published in downstream modules
  • My code is up to date with the base branch
  • I have updated relevant changelogs. We suggest using chan

packages/node-core/src/indexer/dictionary/types.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need tests

Copy link
Collaborator

@stwiname stwiname left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to use IBlock with UnfinalizedBlocks. It should be able to simplify implementation. https://github.com/subquery/subql/blob/main/packages/node/src/indexer/unfinalizedBlocks.service.ts#L17

packages/node-core/src/indexer/dictionary/v2/types.ts Outdated Show resolved Hide resolved
packages/node-core/src/utils/blocks.spec.ts Outdated Show resolved Hide resolved
packages/types-core/src/project/types.ts Outdated Show resolved Hide resolved
@@ -36,11 +36,6 @@ export class UnfinalizedBlocksService extends BaseUnfinalizedBlocksService<
super(nodeConfig, storeCache);
}

@mainThreadOnly()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also remove substrateHeaderToHeader function

Copy link
Contributor Author

@jiqiang90 jiqiang90 Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beside this place been used, I think a few other places are using is it

  1. const header = substrateHeaderToHeader(finalizedHeader);
  2. return substrateHeaderToHeader(

packages/node/src/subcommands/testing.service.ts Outdated Show resolved Hide resolved
Comment on lines 442 to 447
getHeader: () => {
return {
hash: blockHeader.block.header.hash.toString(),
height: blockHeader.block.header.number.toNumber(),
parentHash: blockHeader.block.header.parentHash.toString(),
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good idea to unify getHeader: () return type with Header https://github.com/subquery/subql/pull/2257/files#diff-8138bbd5bd4b60a1dea77c9b7b6577d99ff57d83838c9a49fe66024a1793b153R23, so substrateHeaderToHeader can be re-used

Copy link
Collaborator

@stwiname stwiname left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of the headers have 2023 in the files, should be 2024

packages/node/src/indexer/dictionary/utils.ts Outdated Show resolved Hide resolved
@stwiname stwiname merged commit 0d900f1 into main Mar 12, 2024
1 of 2 checks passed
@stwiname stwiname deleted the dictionary-v2 branch March 21, 2024 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants