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

Store future notarization message #100

Merged
merged 2 commits into from
Feb 25, 2025
Merged

Conversation

yacovm
Copy link
Collaborator

@yacovm yacovm commented Feb 24, 2025

We may receive a notarization message for a future round, and in that case - when we move to that round and finish verifying the proposal, we can just use it to advance to the next round.

@yacovm yacovm force-pushed the handleNotarizationFutureRound branch from 094f45f to 654b689 Compare February 24, 2025 23:00
epoch_test.go Outdated
Comment on lines 29 to 40
bb := &testBlockBuilder{out: make(chan *testBlock, 2), in: make(chan *testBlock, 1)}

nodes := []NodeID{{1}, {2}, {3}, {4}}

// Create the two blocks ahead of time
blocks := createBlocks(t, nodes, bb, 2)

firstBlock := blocks[0].Block.(*testBlock)
secondBlock := blocks[1].Block.(*testBlock)

// re-create the block builder
bb = &testBlockBuilder{out: make(chan *testBlock, 1), in: make(chan *testBlock, 1)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

would it be simpler to do something like this?

Suggested change
bb := &testBlockBuilder{out: make(chan *testBlock, 2), in: make(chan *testBlock, 1)}
nodes := []NodeID{{1}, {2}, {3}, {4}}
// Create the two blocks ahead of time
blocks := createBlocks(t, nodes, bb, 2)
firstBlock := blocks[0].Block.(*testBlock)
secondBlock := blocks[1].Block.(*testBlock)
// re-create the block builder
bb = &testBlockBuilder{out: make(chan *testBlock, 1), in: make(chan *testBlock, 1)}
bb := &testBlockBuilder{}
nodes := []NodeID{{1}, {2}, {3}, {4}}
// Create the two blocks ahead of time
blocks := createBlocks(t, nodes, bb, 2)
firstBlock := blocks[0].Block.(*testBlock)
secondBlock := blocks[1].Block.(*testBlock)
bb.out = make(chan *testBlock, 1)
bb.in = make(chan *testBlock, 1)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

epoch_test.go Outdated
injectTestFinalization(t, e, secondBlock, nodes[i])
}

storage.waitForBlockCommit(1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

might as well assert the block returned here is as expected

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@yacovm yacovm force-pushed the handleNotarizationFutureRound branch from 654b689 to 5f0d461 Compare February 25, 2025 18:40
We may receive a notarization message for a future round,
and in that case - when we move to that round and finish verifying the proposal,
we can just use it to advance to the next round.

Signed-off-by: Yacov Manevich <[email protected]>
@yacovm yacovm force-pushed the handleNotarizationFutureRound branch from 5f0d461 to db223b6 Compare February 25, 2025 18:42
@yacovm yacovm merged commit 75d7dbc into main Feb 25, 2025
4 checks passed
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