Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 6a97462

Browse files
committed
Add comment
1 parent 8532c63 commit 6a97462

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/protocol/engine/consensus/blockgadget/thresholdblockgadget/witness_weight.go

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func (g *Gadget) TrackWitnessWeight(votingBlock *blocks.Block) {
3434
propagateFurther = true
3535
}
3636

37+
// Skip propagation of pre-confirmation if the block is not in the same epoch as the votingBlock.
38+
// This might delay the (pre-)confirmation of blocks at the end of the epoch but make sure that (pre-)confirmation
39+
// is safe in case where the minority of voters got different seats for the next epoch.
3740
blockEpoch := block.ProtocolBlock().API.TimeProvider().EpochFromSlot(block.ID().Slot())
3841
if !block.IsPreConfirmed() && votingBlockEpoch == blockEpoch && (shouldPreConfirm || anyChildInSet(block, toPreConfirmByID)) {
3942
toPreConfirm = append([]*blocks.Block{block}, toPreConfirm...)

pkg/tests/confirmation_state_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"testing"
66

77
"github.com/iotaledger/hive.go/lo"
8-
"github.com/iotaledger/hive.go/log"
98
"github.com/iotaledger/hive.go/runtime/options"
109
"github.com/iotaledger/iota-core/pkg/protocol"
1110
"github.com/iotaledger/iota-core/pkg/protocol/engine/notarization/slotnotarization"
@@ -276,8 +275,6 @@ func TestConfirmationOverEpochBoundary(t *testing.T) {
276275

277276
ts.Run(true)
278277

279-
ts.Node("node0").Protocol.SetLogLevel(log.LevelTrace)
280-
281278
// Issue blocks up until 1 slot more than the epoch.
282279
{
283280
ts.IssueBlocksAtSlots("", []iotago.SlotIndex{1, 2, 3, 4, 5, 6, 7, 8, 9}, 4, "Genesis", ts.Nodes(), true, false)

0 commit comments

Comments
 (0)