Repository: ObolNetwork/charon

Issue:
Add self identification to logs
# 🎯 Problem to be solved
When operators upload their logs without identifying them, we aren't able to (easily) identify which Charon node it belongs to. Specially in situations where they are cut to a specific slot.

# 🛠️ Proposed solution
- [ ] Core team consensus on the proposed solution

Add some form of self identification to logs.
One possibility is to add it along side QBFT logs where list each node's index and their respective names:
```
DEBG qbft       QBFT consensus instance starting         {"peers": "[0:thankful-land 1:twinkling-bulb 2:wandering-death 3:open-colony 4:courageous-clothes 5:remarkable-movie 6:unusual-fridge]", "timer": "eager_dlinear", "duty": "1234/attester"}
```
to
```
DEBG qbft       QBFT consensus instance starting         {"peer": "thankful-land", "peers": "[0:thankful-land 1:twinkling-bulb 2:wandering-death 3:open-colony 4:courageous-clothes 5:remarkable-movie 6:unusual-fridge]", "timer": "eager_dlinear", "duty": "1234/attester"}
```

# 🧪 Tests
- [ ] Tested by new automated unit/integration/smoke tests
- [ ] Manually tested on core team/canary/test clusters
- [ ] Manually tested on local compose simnet


Discussion:

Solution patch:
diff --git a/app/eth2wrap/synthproposer.go b/app/eth2wrap/synthproposer.go
index 73b710db..31806f5e 100644
--- a/app/eth2wrap/synthproposer.go
+++ b/app/eth2wrap/synthproposer.go
@@ -15,6 +15,7 @@ import (
 	eth2v1 "github.com/attestantio/go-eth2-client/api/v1"
 	eth2deneb "github.com/attestantio/go-eth2-client/api/v1/deneb"
 	eth2electra "github.com/attestantio/go-eth2-client/api/v1/electra"
+	eth2fulu "github.com/attestantio/go-eth2-client/api/v1/fulu"
 	eth2spec "github.com/attestantio/go-eth2-client/spec"
 	"github.com/attestantio/go-eth2-client/spec/bellatrix"
 	eth2p0 "github.com/attestantio/go-eth2-client/spec/phase0"
@@ -186,7 +187,7 @@ func (h *synthWrapper) syntheticProposal(ctx context.Context, slot eth2p0.Slot,
 		proposal.Electra.Block.Body.ExecutionPayload.FeeRecipient = feeRecipient
 		proposal.Electra.Block.Body.ExecutionPayload.Transactions = fraction(proposal.Electra.Block.Body.ExecutionPayload.Transactions)
 	case eth2spec.DataVersionFulu:
-		proposal.Fulu = &eth2electra.BlockContents{}
+		proposal.Fulu = &eth2fulu.BlockContents{}
 		proposal.Fulu.Block = signedBlock.Fulu.Message
 		proposal.Fulu.Block.Body.Graffiti = GetSyntheticGraffiti()
 		proposal.Fulu.Block.Slot = slot
diff --git a/core/consensus/qbft/qbft.go b/core/consensus/qbft/qbft.go
index 75a3854e..ea1c5eb9 100644
--- a/core/consensus/qbft/qbft.go
+++ b/core/consensus/qbft/qbft.go
@@ -370,6 +370,7 @@ func (c *Consensus) runInstance(parent context.Context, duty core.Duty) (err err
 	defer cancel()
 
 	log.Debug(ctx, "QBFT consensus instance starting",
+		z.Any("peer", p2p.PeerName(c.p2pNode.ID())),
 		z.Any("peers", c.peerLabels),
 		z.Any("timer", string(roundTimer.Type())),
 	)
diff --git a/core/signeddata.go b/core/signeddata.go
index 40c897f9..3c2a255d 100644
--- a/core/signeddata.go
+++ b/core/signeddata.go
@@ -12,6 +12,7 @@ import (
 	eth2capella "github.com/attestantio/go-eth2-client/api/v1/capella"
 	eth2deneb "github.com/attestantio/go-eth2-client/api/v1/deneb"
 	eth2electra "github.com/attestantio/go-eth2-client/api/v1/electra"
+	eth2fulu "github.com/attestantio/go-eth2-client/api/v1/fulu"
 	eth2spec "github.com/attestantio/go-eth2-client/spec"
 	"github.com/attestantio/go-eth2-client/spec/altair"
 	"github.com/attestantio/go-eth2-client/spec/bellatrix"
@@ -579,7 +580,7 @@ func (p *VersionedSignedProposal) UnmarshalJSON(input []byte) error {
 
 			resp.FuluBlinded = block
 		} else {
-			block := new(eth2electra.SignedBlockContents) // Fulu blocks have the same structure as electra blocks.
+			block := new(eth2fulu.SignedBlockContents)
 			if err := json.Unmarshal(raw.Block, &block); err != nil {
 				return errors.Wrap(err, "unmarshal fulu")
 			}
diff --git a/core/ssz.go b/core/ssz.go
index 2d101258..46abe269 100644
--- a/core/ssz.go
+++ b/core/ssz.go
@@ -10,6 +10,7 @@ import (
 	eth2capella "github.com/attestantio/go-eth2-client/api/v1/capella"
 	eth2deneb "github.com/attestantio/go-eth2-client/api/v1/deneb"
 	eth2electra "github.com/attestantio/go-eth2-client/api/v1/electra"
+	eth2fulu "github.com/attestantio/go-eth2-client/api/v1/fulu"
 	"github.com/attestantio/go-eth2-client/spec/altair"
 	"github.com/attestantio/go-eth2-client/spec/bellatrix"
 	"github.com/attestantio/go-eth2-client/spec/capella"
@@ -154,7 +155,7 @@ func (p *VersionedSignedProposal) sszValFromVersion(version eth2util.DataVersion
 		return p.Electra, nil
 	case eth2util.DataVersionFulu:
 		if p.Fulu == nil && !blinded {
-			p.Fulu = new(eth2electra.SignedBlockContents) // Fulu blocks have the same structure as electra blocks.
+			p.Fulu = new(eth2fulu.SignedBlockContents)
 		}
 
 		if p.FuluBlinded == nil && blinded {
@@ -296,7 +297,7 @@ func (p *VersionedProposal) sszValFromVersion(version eth2util.DataVersion, blin
 		return p.Electra, nil
 	case eth2util.DataVersionFulu:
 		if p.Fulu == nil && !blinded {
-			p.Fulu = new(eth2electra.BlockContents) // Fulu blocks have the same structure as electra blocks.
+			p.Fulu = new(eth2fulu.BlockContents)
 		}
 
 		if p.FuluBlinded == nil && blinded {
diff --git a/core/unsigneddata.go b/core/unsigneddata.go
index 9da86267..8cdbceef 100644
--- a/core/unsigneddata.go
+++ b/core/unsigneddata.go
@@ -11,6 +11,7 @@ import (
 	eth2capella "github.com/attestantio/go-eth2-client/api/v1/capella"
 	eth2deneb "github.com/attestantio/go-eth2-client/api/v1/deneb"
 	eth2electra "github.com/attestantio/go-eth2-client/api/v1/electra"
+	eth2fulu "github.com/attestantio/go-eth2-client/api/v1/fulu"
 	eth2spec "github.com/attestantio/go-eth2-client/spec"
 	"github.com/attestantio/go-eth2-client/spec/altair"
 	"github.com/attestantio/go-eth2-client/spec/bellatrix"
@@ -593,7 +594,7 @@ func (p *VersionedProposal) UnmarshalJSON(input []byte) error {
 
 			resp.FuluBlinded = block
 		} else {
-			block := new(eth2electra.BlockContents) // Fulu blocks have the same structure as electra blocks.
+			block := new(eth2fulu.BlockContents)
 			if err := json.Unmarshal(raw.Block, &block); err != nil {
 				return errors.Wrap(err, "unmarshal fulu")
 			}
diff --git a/core/validatorapi/router.go b/core/validatorapi/router.go
index 25862814..17f69dfe 100644
--- a/core/validatorapi/router.go
+++ b/core/validatorapi/router.go
@@ -28,6 +28,7 @@ import (
 	eth2capella "github.com/attestantio/go-eth2-client/api/v1/capella"
 	eth2deneb "github.com/attestantio/go-eth2-client/api/v1/deneb"
 	eth2electra "github.com/attestantio/go-eth2-client/api/v1/electra"
+	eth2fulu "github.com/attestantio/go-eth2-client/api/v1/fulu"
 	eth2spec "github.com/attestantio/go-eth2-client/spec"
 	"github.com/attestantio/go-eth2-client/spec/altair"
 	"github.com/attestantio/go-eth2-client/spec/bellatrix"
@@ -1155,7 +1156,7 @@ func submitProposal(p eth2client.ProposalSubmitter) handlerFunc {
 			})
 
 		case eth2spec.DataVersionFulu:
-			fuluBlock := new(eth2electra.SignedBlockContents) // Fulu blocks have the same structure as electra blocks.
+			fuluBlock := new(eth2fulu.SignedBlockContents)
 
 			err = unmarshal(typ, body, fuluBlock)
 			if err != nil {
diff --git a/go.mod b/go.mod
index 29d29809..f4e26a36 100644
--- a/go.mod
+++ b/go.mod
@@ -294,7 +294,7 @@ require (
 replace github.com/coinbase/kryptology => github.com/ObolNetwork/kryptology v0.1.0
 
 // We're replacing go-eth2-client with a branch off our fork. The branch is kept up to date with the latest attestantio versions.
-replace github.com/attestantio/go-eth2-client => github.com/ObolNetwork/go-eth2-client v0.26.0-obol.2-fulu.2 //nolint
+replace github.com/attestantio/go-eth2-client => github.com/ObolNetwork/go-eth2-client v0.26.0-obol.2-fulu.3 //nolint
 
 tool (
 	github.com/bufbuild/buf/cmd/buf
diff --git a/go.sum b/go.sum
index 32134946..fe887ff4 100644
--- a/go.sum
+++ b/go.sum
@@ -38,8 +38,8 @@ github.com/DataDog/zstd v1.5.7 h1:ybO8RBeh29qrxIhCA9E8gKY6xfONU9T6G6aP9DTKfLE=
 github.com/DataDog/zstd v1.5.7/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
 github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
 github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
-github.com/ObolNetwork/go-eth2-client v0.26.0-obol.2-fulu.2 h1:MhCttpP6a/Sa/TbnuXYCAtV3v5DfxgJ9UvH7/8+Tn40=
-github.com/ObolNetwork/go-eth2-client v0.26.0-obol.2-fulu.2/go.mod h1:fvULSL9WtNskkOB4i+Yyr6BKpNHXvmpGZj9969fCrfY=
+github.com/ObolNetwork/go-eth2-client v0.26.0-obol.2-fulu.3 h1:OLxybxrE7d4QTzkzq5kaHlJ003hXk84iuZzvQHBhSvY=
+github.com/ObolNetwork/go-eth2-client v0.26.0-obol.2-fulu.3/go.mod h1:fvULSL9WtNskkOB4i+Yyr6BKpNHXvmpGZj9969fCrfY=
 github.com/ObolNetwork/kryptology v0.1.0 h1:AhoG4My70+xMhEJSpVaJay/t+T/vIUNHQYLjsDJHulI=
 github.com/ObolNetwork/kryptology v0.1.0/go.mod h1:/Wl7Js2f676GyXZDTaojf/O+l0fxFPWudbyjdFhkpSA=
 github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=



Test patch:
diff --git a/core/consensus/qbft/qbft_internal_test.go b/core/consensus/qbft/qbft_internal_test.go
index ed479de7..d52e6139 100644
--- a/core/consensus/qbft/qbft_internal_test.go
+++ b/core/consensus/qbft/qbft_internal_test.go
@@ -520,6 +520,7 @@ func TestInstanceIO_MaybeStart(t *testing.T) {
 		p2pKey := testutil.GenerateInsecureK1Key(t, 0)
 		c.pubkeys = make(map[int64]*k1.PublicKey)
 		c.pubkeys[0] = p2pKey.PubKey()
+		c.p2pNode = testutil.CreateHost(t, testutil.AvailableAddr(t))
 
 		duty := core.Duty{Slot: 42, Type: 1}
 		msg := &pbv1.QBFTConsensusMsg{
diff --git a/core/signeddata_test.go b/core/signeddata_test.go
index feecc701..57e65f1b 100644
--- a/core/signeddata_test.go
+++ b/core/signeddata_test.go
@@ -12,6 +12,7 @@ import (
 	eth2capella "github.com/attestantio/go-eth2-client/api/v1/capella"
 	eth2deneb "github.com/attestantio/go-eth2-client/api/v1/deneb"
 	eth2electra "github.com/attestantio/go-eth2-client/api/v1/electra"
+	eth2fulu "github.com/attestantio/go-eth2-client/api/v1/fulu"
 	eth2spec "github.com/attestantio/go-eth2-client/spec"
 	"github.com/attestantio/go-eth2-client/spec/altair"
 	"github.com/attestantio/go-eth2-client/spec/bellatrix"
@@ -170,7 +171,7 @@ func TestSignedDataSetSignature(t *testing.T) {
 			data: core.VersionedSignedProposal{
 				VersionedSignedProposal: eth2api.VersionedSignedProposal{
 					Version: eth2spec.DataVersionFulu,
-					Fulu: &eth2electra.SignedBlockContents{
+					Fulu: &eth2fulu.SignedBlockContents{
 						SignedBlock: &electra.SignedBeaconBlock{
 							Message:   testutil.RandomElectraBeaconBlock(),
 							Signature: testutil.RandomEth2Signature(),
diff --git a/core/validatorapi/validatorapi_test.go b/core/validatorapi/validatorapi_test.go
index e943cb00..23ecc4c5 100644
--- a/core/validatorapi/validatorapi_test.go
+++ b/core/validatorapi/validatorapi_test.go
@@ -17,6 +17,7 @@ import (
 	eth2capella "github.com/attestantio/go-eth2-client/api/v1/capella"
 	eth2deneb "github.com/attestantio/go-eth2-client/api/v1/deneb"
 	eth2electra "github.com/attestantio/go-eth2-client/api/v1/electra"
+	eth2fulu "github.com/attestantio/go-eth2-client/api/v1/fulu"
 	eth2spec "github.com/attestantio/go-eth2-client/spec"
 	"github.com/attestantio/go-eth2-client/spec/altair"
 	"github.com/attestantio/go-eth2-client/spec/bellatrix"
@@ -814,7 +815,7 @@ func TestComponent_SubmitProposal(t *testing.T) {
 			signedBlockFunc: func(unsignedBlock *eth2spec.VersionedBeaconBlock, s [96]byte) *eth2api.VersionedSignedProposal {
 				return &eth2api.VersionedSignedProposal{
 					Version: eth2spec.DataVersionFulu,
-					Fulu: &eth2electra.SignedBlockContents{
+					Fulu: &eth2fulu.SignedBlockContents{
 						SignedBlock: &electra.SignedBeaconBlock{
 							Message:   unsignedBlock.Fulu,
 							Signature: eth2p0.BLSSignature(s),
@@ -827,7 +828,7 @@ func TestComponent_SubmitProposal(t *testing.T) {
 			awaitBlockFunc: func(unsignedBlock *eth2spec.VersionedBeaconBlock, signedBlock *eth2api.VersionedSignedProposal) *eth2api.VersionedProposal {
 				return &eth2api.VersionedProposal{
 					Version: signedBlock.Version,
-					Fulu: &eth2electra.BlockContents{
+					Fulu: &eth2fulu.BlockContents{
 						Block:     unsignedBlock.Fulu,
 						KZGProofs: []deneb.KZGProof{},
 						Blobs:     []deneb.Blob{},
diff --git a/testutil/random.go b/testutil/random.go
index 9d39c389..401e7b3c 100644
--- a/testutil/random.go
+++ b/testutil/random.go
@@ -20,6 +20,7 @@ import (
 	eth2capella "github.com/attestantio/go-eth2-client/api/v1/capella"
 	eth2deneb "github.com/attestantio/go-eth2-client/api/v1/deneb"
 	eth2electra "github.com/attestantio/go-eth2-client/api/v1/electra"
+	eth2fulu "github.com/attestantio/go-eth2-client/api/v1/fulu"
 	eth2spec "github.com/attestantio/go-eth2-client/spec"
 	"github.com/attestantio/go-eth2-client/spec/altair"
 	"github.com/attestantio/go-eth2-client/spec/bellatrix"
@@ -455,7 +456,7 @@ func RandomFuluCoreVersionedSignedProposal() core.VersionedSignedProposal {
 	return core.VersionedSignedProposal{
 		VersionedSignedProposal: eth2api.VersionedSignedProposal{
 			Version: eth2spec.DataVersionFulu,
-			Fulu: &eth2electra.SignedBlockContents{
+			Fulu: &eth2fulu.SignedBlockContents{
 				SignedBlock: &electra.SignedBeaconBlock{
 					Message:   RandomElectraBeaconBlock(),
 					Signature: RandomEth2Signature(),
@@ -556,7 +557,7 @@ func RandomElectraVersionedSignedProposal() *eth2api.VersionedSignedProposal {
 func RandomFuluVersionedSignedProposal() *eth2api.VersionedSignedProposal {
 	return &eth2api.VersionedSignedProposal{
 		Version: eth2spec.DataVersionFulu,
-		Fulu: &eth2electra.SignedBlockContents{
+		Fulu: &eth2fulu.SignedBlockContents{
 			SignedBlock: &electra.SignedBeaconBlock{
 				Message:   RandomElectraBeaconBlock(),
 				Signature: RandomEth2Signature(),
@@ -603,7 +604,7 @@ func RandomElectraVersionedProposal() *eth2api.VersionedProposal {
 func RandomFuluVersionedProposal() *eth2api.VersionedProposal {
 	return &eth2api.VersionedProposal{
 		Version: eth2spec.DataVersionFulu,
-		Fulu: &eth2electra.BlockContents{
+		Fulu: &eth2fulu.BlockContents{
 			Block:     RandomElectraBeaconBlock(),
 			KZGProofs: []deneb.KZGProof{},
 			Blobs:     []deneb.Blob{},
diff --git a/testutil/validatormock/propose.go b/testutil/validatormock/propose.go
index eb28e22f..42cc94cf 100644
--- a/testutil/validatormock/propose.go
+++ b/testutil/validatormock/propose.go
@@ -12,6 +12,7 @@ import (
 	eth2capella "github.com/attestantio/go-eth2-client/api/v1/capella"
 	eth2deneb "github.com/attestantio/go-eth2-client/api/v1/deneb"
 	eth2electra "github.com/attestantio/go-eth2-client/api/v1/electra"
+	eth2fulu "github.com/attestantio/go-eth2-client/api/v1/fulu"
 	eth2spec "github.com/attestantio/go-eth2-client/spec"
 	"github.com/attestantio/go-eth2-client/spec/altair"
 	"github.com/attestantio/go-eth2-client/spec/bellatrix"
@@ -216,7 +217,7 @@ func ProposeBlock(ctx context.Context, eth2Cl eth2wrap.Client, signFunc SignFunc
 			Blobs:     block.Electra.Blobs,
 		}
 	case eth2spec.DataVersionFulu:
-		signedBlock.Fulu = &eth2electra.SignedBlockContents{
+		signedBlock.Fulu = &eth2fulu.SignedBlockContents{
 			SignedBlock: &electra.SignedBeaconBlock{
 				Message:   block.Fulu.Block,
 				Signature: sig,