diff --git a/pkg/protocol/commitment.go b/pkg/protocol/commitment.go index b877c6407..377137b6b 100644 --- a/pkg/protocol/commitment.go +++ b/pkg/protocol/commitment.go @@ -118,9 +118,14 @@ func NewCommitment(commitment *model.Commitment, protocol *Protocol) *Commitment c.IsRoot.OnTrigger(func() { c.IsAttested.Set(true) c.IsVerified.Set(true) + c.IsSolid.Set(true) }) c.Logger = protocol.NewEntityLogger(fmt.Sprintf("Slot%d.", commitment.Slot()), c.IsEvicted, func(entityLogger log.Logger) { + c.IsSolid.LogUpdates(entityLogger, log.LevelTrace, "IsSolid") + c.Chain.LogUpdates(entityLogger, log.LevelTrace, "Chain", (*Chain).LogName) + c.IsVerified.LogUpdates(entityLogger, log.LevelTrace, "IsVerified") + c.InSyncRange.LogUpdates(entityLogger, log.LevelTrace, "InSyncRange") c.WarpSync.LogUpdates(entityLogger, log.LevelTrace, "WarpSync") c.Weight.LogUpdates(entityLogger, log.LevelTrace, "Weight") c.AttestedWeight.LogUpdates(entityLogger, log.LevelTrace, "AttestedWeight") @@ -132,7 +137,7 @@ func NewCommitment(commitment *model.Commitment, protocol *Protocol) *Commitment func (c *Commitment) isAboveLatestVerifiedCommitment(parent *Commitment) reactive.DerivedVariable[bool] { return reactive.NewDerivedVariable3(func(parentAboveLatestVerifiedCommitment, parentIsVerified, isVerified bool) bool { - return parentAboveLatestVerifiedCommitment || (parentIsVerified && isVerified) + return parentAboveLatestVerifiedCommitment || (parentIsVerified && !isVerified) }, parent.IsAboveLatestVerifiedCommitment, parent.IsVerified, c.IsVerified) } diff --git a/pkg/testsuite/mock/blockissuer.go b/pkg/testsuite/mock/blockissuer.go index 64c896fab..554fb6cd4 100644 --- a/pkg/testsuite/mock/blockissuer.go +++ b/pkg/testsuite/mock/blockissuer.go @@ -188,7 +188,7 @@ func (i *BlockIssuer) IssueValidationBlock(ctx context.Context, alias string, no validationBlock, _ := block.ValidationBlock() - node.Protocol.MainEngine.Get().LogTrace("issued validation block", "block", validationBlock, "blockID", block.ID(), "slot", block.ID().Slot(), "commitment", block.SlotCommitmentID(), "latestFinalizedSlot", block.ProtocolBlock().LatestFinalizedSlot, "version", block.ProtocolBlock().ProtocolVersion, "highestSupportedVersion", validationBlock.HighestSupportedVersion, "hash", validationBlock.ProtocolParametersHash) + node.Protocol.MainEngine.Get().LogTrace("issued validation block", "blockID", block.ID(), "slot", block.ID().Slot(), "commitment", block.SlotCommitmentID(), "latestFinalizedSlot", block.ProtocolBlock().LatestFinalizedSlot, "version", block.ProtocolBlock().ProtocolVersion, "highestSupportedVersion", validationBlock.HighestSupportedVersion, "hash", validationBlock.ProtocolParametersHash) return block } @@ -283,7 +283,7 @@ func (i *BlockIssuer) IssueBasicBlock(ctx context.Context, alias string, node *N require.NoErrorf(i.Testing, i.IssueBlock(block.ModelBlock(), node), "%s > failed to issue block with alias %s", i.Name, alias) - node.Protocol.LogTrace("issued block", "block", block, "blockID", block.ID(), "slot", block.ID().Slot(), "commitment", block.SlotCommitmentID(), "latestFinalizedSlot", block.ProtocolBlock().LatestFinalizedSlot, "version", block.ProtocolBlock().ProtocolVersion) + node.Protocol.LogTrace("issued block", "blockID", block.ID(), "slot", block.ID().Slot(), "commitment", block.SlotCommitmentID(), "latestFinalizedSlot", block.ProtocolBlock().LatestFinalizedSlot, "version", block.ProtocolBlock().ProtocolVersion) return block }