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

Added check for circular and out-of-range dependency problem #841

Merged
merged 4 commits into from May 11, 2023

Conversation

pratikspatil024
Copy link
Member

POS-1391 and POS-1392

@pratikspatil024 pratikspatil024 requested a review from cffls May 1, 2023 10:29
Comment on lines 457 to 459
if depTx >= n {
return false
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If we also enforce depTx < tx here, the circular dependency could be avoided, and we won't need the loop below. wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, Jerry. I agree.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

// Handle out-of-range and circular dependency problem
for tx, val := range deps {
for depTx := range val {
if depTx >= n && depTx < tx {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be || instead of &&?

Copy link
Member Author

Choose a reason for hiding this comment

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

My bad, done thanks!

@@ -304,6 +304,11 @@ func (p *ParallelStateProcessor) Process(block *types.Block, statedb *state.Stat
metadata = true
}

if !VerifyDeps(deps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If deps is nil or empty, we can skip the check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, thanks.

@pratikspatil024 pratikspatil024 marked this pull request as ready for review May 5, 2023 05:51
@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.04 ⚠️

Comparison is base (193aee0) 56.79% compared to head (d2aad18) 56.76%.

Additional details and impacted files
@@              Coverage Diff              @@
##           block-stm     #841      +/-   ##
=============================================
- Coverage      56.79%   56.76%   -0.04%     
=============================================
  Files            617      617              
  Lines          73603    73602       -1     
=============================================
- Hits           41806    41780      -26     
- Misses         28262    28286      +24     
- Partials        3535     3536       +1     
Impacted Files Coverage Δ
core/parallel_state_processor.go 35.38% <0.00%> (-1.85%) ⬇️

... and 28 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pratikspatil024 pratikspatil024 merged commit c39c66f into block-stm May 11, 2023
13 of 15 checks passed
@pratikspatil024 pratikspatil024 deleted the pos-1391 branch May 11, 2023 06:51
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.

None yet

2 participants