Skip to content

Commit

Permalink
Increase validator block parents count. (#864)
Browse files Browse the repository at this point in the history
* Log whenever vote is cast

* Disable warpsync requests

* Log number of tips when force-committing

* Revert "Log number of tips when force-committing"

This reverts commit cacdc5c.

* try using more validator blocks in the past cone

* use id instead of string

* Remove log

* Revert "Log whenever vote is cast"

This reverts commit 479848f.

* Revert "Disable warpsync requests"

This reverts commit 01cc253.

* Make sure not to decrease the collected tips count.
  • Loading branch information
piotrm50 authored Mar 22, 2024
1 parent 9d9695f commit c202a21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/protocol/engine/tipselection/v1/tip_selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ func (t *TipSelection) SelectTips(amount int) (references model.ParentReferences
},
// We select one validation tip as a strong parent. This is a security step to ensure that the tangle maintains
// acceptance by stitching together validation blocks.
types.NewTuple[func(optAmount ...int) []tipmanager.TipMetadata, int](t.tipManager.ValidationTips, 1),
types.NewTuple[func(optAmount ...int) []tipmanager.TipMetadata, int](t.tipManager.StrongTips, amount-1),
types.NewTuple[func(optAmount ...int) []tipmanager.TipMetadata, int](t.tipManager.ValidationTips, 2),
types.NewTuple[func(optAmount ...int) []tipmanager.TipMetadata, int](t.tipManager.StrongTips, amount-2),
); len(references[iotago.StrongParentType]) == 0 {
references[iotago.StrongParentType] = iotago.BlockIDs{t.rootBlock()}
}
Expand Down Expand Up @@ -239,7 +239,7 @@ func (t *TipSelection) collectReferences(callback func(tipmanager.TipMetadata),
for _, tipSelectorAmount := range tipSelectorsAmount {
// Make sure we select the total number of unique tips and not just the number of tips from the given tip pool,
// because of how selectUniqueTips works.
accumulatedTipAmount += tipSelectorAmount.B
accumulatedTipAmount += max(0, tipSelectorAmount.B)

tipCandidates := selectUniqueTips(tipSelectorAmount.A, referencesCountCallback(), accumulatedTipAmount)

Expand Down

0 comments on commit c202a21

Please sign in to comment.