-
Notifications
You must be signed in to change notification settings - Fork 289
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
add parallel sync buffer as 1000 and will star to execute the block i… #4216
Conversation
…f no absent block exists.
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Poem
Warning Review ran into problems🔥 ProblemsError running Gitleaks: Command failed with exit code 4: jk_cp -o -f -k -j /cache/52/1cc2eb94-ff6c-413d-81b8-661342020586 /dev/null /dev/urandom /usr/bin/ast-grep /usr/bin/curl /usr/bin/diff /usr/bin/dirname /usr/bin/env /usr/bin/fd /usr/bin/gawk /usr/bin/gh /usr/bin/jq /usr/bin/patch /usr/bin/rg /usr/bin/shellcheck /usr/bin/tokei /usr/bin/tree /usr/bin/uniq /usr/bin/xargs /etc/ssl/certs /etc/passwd /etc/group /home/jailuser/ast-grep-rules ERROR: /usr/bin/ast-grep does not exist Usage: /usr/sbin/jk_cp -j [OPTIONS] -h --help : this help screen Note: if no jail is specified, the first argument is Error running semgrep: Cloning the repository previously failed. Git: Failed to clone repository. Please run the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async fn find_absent_ancestor(&self, mut block_headers: Vec<BlockHeader>) -> Result<u64> { | ||
let mut count: u64 = 0; | ||
loop { | ||
let mut absent_blocks = vec![]; | ||
self.find_absent_parent_dag_blocks_for_blocks(block_headers, &mut absent_blocks)?; | ||
if absent_blocks.is_empty() { | ||
return Ok(()); | ||
return Ok(count); | ||
} | ||
count = count.saturating_add(absent_blocks.len() as u64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure correct handling of the new return type of find_absent_ancestor
The method find_absent_ancestor
now returns Result<u64>
instead of Result<()>
. Within this file, ensure that all calls to this method correctly handle the new return value, and that the count
of absent blocks is appropriately utilized.
let count = self | ||
.find_absent_ancestor(vec![block_header.clone()]) | ||
.await?; | ||
|
||
if block_header.number() % 10000 == 0 | ||
if count == 0 { | ||
return anyhow::Ok(ParallelSign::Continue); | ||
} | ||
|
||
if block_header.number() % 1000 == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assess the impact of changing the modulus condition from 10000
to 1000
The condition has changed from checking block_header.number() % 10000 == 0
to block_header.number() % 1000 == 0
. This increases the frequency at which the associated code block executes. Review whether this change aligns with performance expectations and system requirements.
return anyhow::Ok(ParallelSign::Continue); | ||
} | ||
|
||
if block_header.number() % 1000 == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: 这个可以改成一个常量参数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
…f no absent block exists.
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Other information
Summary by CodeRabbit
New Features
Bug Fixes