From 595da55dfb68eeebf3454d71ef814621ffcae395 Mon Sep 17 00:00:00 2001 From: Potuz Date: Sat, 14 Feb 2026 14:50:25 +0100 Subject: [PATCH] fix weight --- beacon-chain/forkchoice/doubly-linked-tree/gloas.go | 2 +- testing/spectest/shared/common/forkchoice/builder.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/beacon-chain/forkchoice/doubly-linked-tree/gloas.go b/beacon-chain/forkchoice/doubly-linked-tree/gloas.go index 86b5c99eee..cd4ed50e84 100644 --- a/beacon-chain/forkchoice/doubly-linked-tree/gloas.go +++ b/beacon-chain/forkchoice/doubly-linked-tree/gloas.go @@ -319,7 +319,7 @@ func (f *ForkChoice) updateNewFullNodeWeight(fn *PayloadNode) { fn.balance += f.balances[index] } } - fn.balance = fn.weight + fn.weight = fn.balance } func (s *Store) resolveVoteNode(r [32]byte, slot primitives.Slot, payloadStatus bool) (*PayloadNode, bool) { diff --git a/testing/spectest/shared/common/forkchoice/builder.go b/testing/spectest/shared/common/forkchoice/builder.go index 95138486d0..b42c843f15 100644 --- a/testing/spectest/shared/common/forkchoice/builder.go +++ b/testing/spectest/shared/common/forkchoice/builder.go @@ -141,7 +141,8 @@ func (bb *Builder) Check(t testing.TB, c *Check) { if c.Head != nil { r, err := bb.service.HeadRoot(ctx) require.NoError(t, err) - require.Equal(t, true, bytes.Equal(common.FromHex(c.Head.Root), r)) + wantedRoot := common.FromHex(c.Head.Root) + require.Equal(t, true, bytes.Equal(wantedRoot, r), fmt.Sprintf("Roots differ. wanted %#x, got %#x", wantedRoot, r)) require.Equal(t, primitives.Slot(c.Head.Slot), bb.service.HeadSlot()) } if c.JustifiedCheckPoint != nil {