-
Notifications
You must be signed in to change notification settings - Fork 203
Improve BFT resilience of BlockBuffer stores #8196
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
base: master
Are you sure you want to change the base?
Changes from 24 commits
e6b4e8c
880557b
09eb86c
46000ac
d54e974
9530e1e
7235f7a
e3acbf0
56be6f0
760434b
99b181f
3ab8dd5
a4529e8
b281bc0
5dbfe91
39f010a
49a196b
b3b1460
beec64c
e813f5c
e1bed68
718a820
846a5f8
292a175
acccf49
7f89681
e21fa82
37c9569
8fb4c54
5108c97
d350dbe
df61acd
5279647
b001e9b
3326e63
cb267a5
cffc38d
ad038a3
ac0cdb2
bee053b
9e7ec7e
923770b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -200,7 +200,7 @@ func (cs *CommonSuite) SetupTest() { | |
|
|
||
| // set up pending module mock | ||
| cs.pending = &module.PendingBlockBuffer{} | ||
| cs.pending.On("Add", mock.Anything, mock.Anything).Return(true) | ||
| cs.pending.On("Add", mock.Anything, mock.Anything) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing mock return value for The 🔎 Proposed fix- cs.pending.On("Add", mock.Anything, mock.Anything)
+ cs.pending.On("Add", mock.Anything).Return(nil)Note: The method signature also appears to have changed to accept a single argument ( 🤖 Prompt for AI Agents |
||
| cs.pending.On("ByID", mock.Anything).Return( | ||
| func(blockID flow.Identifier) flow.Slashable[*flow.Proposal] { | ||
| return cs.pendingDB[blockID] | ||
|
|
@@ -219,9 +219,8 @@ func (cs *CommonSuite) SetupTest() { | |
| return ok | ||
| }, | ||
| ) | ||
| cs.pending.On("DropForParent", mock.Anything).Return() | ||
| cs.pending.On("Size").Return(uint(0)) | ||
| cs.pending.On("PruneByView", mock.Anything).Return() | ||
| cs.pending.On("PruneByView", mock.Anything).Return(nil) | ||
|
|
||
| // set up hotstuff module mock | ||
| cs.hotstuff = module.NewHotStuff(cs.T()) | ||
|
|
@@ -565,9 +564,6 @@ func (cs *CoreSuite) TestProcessBlockAndDescendants() { | |
| Message: proposal0, | ||
| }) | ||
| require.NoError(cs.T(), err, "should pass handling children") | ||
|
|
||
| // make sure we drop the cache after trying to process | ||
| cs.pending.AssertCalled(cs.T(), "DropForParent", parent.ID()) | ||
| } | ||
|
|
||
| func (cs *CoreSuite) TestProposalBufferingOrder() { | ||
|
|
@@ -588,7 +584,7 @@ func (cs *CoreSuite) TestProposalBufferingOrder() { | |
| } | ||
|
|
||
| // replace the engine buffer with the real one | ||
| cs.core.pending = real.NewPendingBlocks() | ||
| cs.core.pending = real.NewPendingBlocks(cs.head.View, 100_000) | ||
|
|
||
| // check that we request the ancestor block each time | ||
| cs.sync.On("RequestBlock", missingBlock.ID(), missingBlock.Height).Times(len(proposals)) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Removing this line is causing the integration test failure. We assume that
c.pendingonly includes blocks that have not been processed and added to our local state. However, with the change in this PR, we retain blocks until their view is finalized.Specific problematic case:
There are blocks like
A<-B<-C.flow-go/engine/consensus/compliance/core.go
Line 203 in e813f5c
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.
37c9569