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

[FlexiDag Sync] optimization for the sync #4046

Merged
merged 2 commits into from
May 6, 2024

Conversation

jackzhhuang
Copy link
Collaborator

@jackzhhuang jackzhhuang commented Apr 30, 2024

Flexidag block synchronization improvements:

1, Optimized synchronization complexity, reduced from O(k*n) to O(n), where k is the number of block parents.
2, Reduced network requests for block synchronization.
3, Fixed reentrancy errors in reachability.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

2, fix test cases
}

impl StorageVersion {
pub fn current_version() -> StorageVersion {
StorageVersion::V4
StorageVersion::V5
Copy link
Member

Choose a reason for hiding this comment

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

如果是针对main network, 是则是v3->v4,是不是放v4里升了?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

是的

if future_covering_set.contains(&new_block) {
Ok(())
} else {
Err(ReachabilityError::HashesNotOrdered)
Copy link
Member

Choose a reason for hiding this comment

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

这里是怎么出现的呢?如果出现了,也就是说会commit失败对吧?能否构造一个复线这个error的case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

多个线程很短时间内重复commit就会失败报HashesNotOrdered,这里增加一个重入的检查,产生这个失败的错误会大大降低,我连续试了10次,也不会再复现了,所以很难再构造这样的error case。

@nkysg
Copy link
Collaborator

nkysg commented Apr 30, 2024

前面加上dag相关描述吧

@jackzhhuang jackzhhuang merged commit 6d0f277 into starcoinorg:dag-mining-net May 6, 2024
1 of 3 checks passed
@nkysg nkysg changed the title optimization for the sync [FlexiDag Sync] optimization for the sync May 9, 2024
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.

3 participants