Compare commits

..

5 Commits

Author SHA1 Message Date
satushh
945b08fd42 Merge branch 'develop' into close-test-host 2026-02-03 11:32:52 +05:30
satushh
18024098e0 Merge branch 'develop' into close-test-host 2026-02-02 20:41:12 +05:30
satushh
04d7e29611 Merge branch 'develop' into close-test-host 2026-02-02 20:27:51 +05:30
satushh
b743cd72e2 changelog 2026-02-02 20:27:14 +05:30
satushh
df45e4da57 Close libp2p host 2026-02-02 20:21:52 +05:30
10 changed files with 9 additions and 128 deletions

View File

@@ -540,12 +540,6 @@ type PayloadAttestation struct {
Signature string `json:"signature"`
}
type PayloadAttestationMessage struct {
ValidatorIndex string `json:"validator_index"`
Data *PayloadAttestationData `json:"data"`
Signature string `json:"signature"`
}
type BeaconBlockBodyGloas struct {
RandaoReveal string `json:"randao_reveal"`
Eth1Data *Eth1Data `json:"eth1_data"`

View File

@@ -2971,14 +2971,6 @@ func PayloadAttestationDataFromConsensus(d *eth.PayloadAttestationData) *Payload
}
}
func PayloadAttestationMessageFromConsensus(m *eth.PayloadAttestationMessage) *PayloadAttestationMessage {
return &PayloadAttestationMessage{
ValidatorIndex: fmt.Sprintf("%d", m.ValidatorIndex),
Data: PayloadAttestationDataFromConsensus(m.Data),
Signature: hexutil.Encode(m.Signature),
}
}
func (b *SignedBeaconBlockGloas) ToConsensus() (*eth.SignedBeaconBlockGloas, error) {
if b == nil {
return nil, errNilValue

View File

@@ -112,8 +112,3 @@ type LightClientOptimisticUpdateEvent struct {
Version string `json:"version"`
Data *LightClientOptimisticUpdate `json:"data"`
}
type ExecutionPayloadAvailableEvent struct {
Slot string `json:"slot"`
BlockRoot string `json:"block_root"`
}

View File

@@ -46,14 +46,6 @@ const (
// DataColumnReceived is sent after a data column has been seen after gossip validation rules.
DataColumnReceived = 12
// ExecutionPayloadBidReceived is sent after a signed execution payload bid is received from gossip or API
// that passes gossip validation on the execution_payload_bid topic.
ExecutionPayloadBidReceived = 13
// PayloadAttestationMessageReceived is sent after a payload attestation message is received
// that passes validation rules of the payload_attestation_message topic.
PayloadAttestationMessageReceived = 14
)
// UnAggregatedAttReceivedData is the data sent with UnaggregatedAttReceived events.
@@ -122,13 +114,3 @@ type DataColumnReceivedData struct {
BlockRoot [32]byte
KzgCommitments [][]byte
}
// ExecutionPayloadBidReceivedData is the data sent with ExecutionPayloadBidReceived events.
type ExecutionPayloadBidReceivedData struct {
SignedBid *ethpb.SignedExecutionPayloadBid
}
// PayloadAttestationMessageReceivedData is the data sent with PayloadAttestationMessageReceived events.
type PayloadAttestationMessageReceivedData struct {
PayloadAttestationMessage *ethpb.PayloadAttestationMessage
}

View File

@@ -33,9 +33,6 @@ const (
LightClientOptimisticUpdate
// PayloadAttributes events are fired upon a missed slot or new head.
PayloadAttributes
// ExecutionPayloadAvailable is sent when the node has verified that the execution payload
// and blobs for a block are available and ready for payload attestation.
ExecutionPayloadAvailable
)
// BlockProcessedData is the data sent with BlockProcessed events.
@@ -75,11 +72,3 @@ type InitializedData struct {
// GenesisValidatorsRoot represents state.validators.HashTreeRoot().
GenesisValidatorsRoot []byte
}
// ExecutionPayloadAvailableData is the data sent with ExecutionPayloadAvailable events.
type ExecutionPayloadAvailableData struct {
// Slot is the slot of the block whose execution payload became available.
Slot primitives.Slot
// BlockRoot is the root of the block whose execution payload became available.
BlockRoot [32]byte
}

View File

@@ -138,6 +138,9 @@ func connect(a, b host.Host) error {
func (p *TestP2P) ReceiveRPC(topic string, msg proto.Message) {
h, err := libp2p.New(libp2p.ResourceManager(&network.NullResourceManager{}))
require.NoError(p.t, err)
defer func() {
require.NoError(p.t, h.Close())
}()
if err := connect(h, p.BHost); err != nil {
p.t.Fatalf("Failed to connect two peers for RPC: %v", err)
}
@@ -169,6 +172,9 @@ func (p *TestP2P) ReceiveRPC(topic string, msg proto.Message) {
func (p *TestP2P) ReceivePubSub(topic string, msg proto.Message) {
h, err := libp2p.New(libp2p.ResourceManager(&network.NullResourceManager{}))
require.NoError(p.t, err)
defer func() {
require.NoError(p.t, h.Close())
}()
ps, err := pubsub.NewFloodSub(context.Background(), h,
pubsub.WithMessageSigning(false),
pubsub.WithStrictSignatureVerification(false),

View File

@@ -74,12 +74,6 @@ const (
LightClientOptimisticUpdateTopic = "light_client_optimistic_update"
// DataColumnTopic represents a data column sidecar event topic
DataColumnTopic = "data_column_sidecar"
// ExecutionPayloadAvailableTopic represents an event indicating execution payload and blobs are available.
ExecutionPayloadAvailableTopic = "execution_payload_available"
// ExecutionPayloadBidTopic represents an event for a signed execution payload bid passing gossip validation.
ExecutionPayloadBidTopic = "execution_payload_bid"
// PayloadAttestationMessageTopic represents an event for a payload attestation message passing validation.
PayloadAttestationMessageTopic = "payload_attestation_message"
)
var (
@@ -114,8 +108,6 @@ var opsFeedEventTopics = map[feed.EventType]string{
operation.ProposerSlashingReceived: ProposerSlashingTopic,
operation.BlockGossipReceived: BlockGossipTopic,
operation.DataColumnReceived: DataColumnTopic,
operation.ExecutionPayloadBidReceived: ExecutionPayloadBidTopic,
operation.PayloadAttestationMessageReceived: PayloadAttestationMessageTopic,
}
var stateFeedEventTopics = map[feed.EventType]string{
@@ -126,7 +118,6 @@ var stateFeedEventTopics = map[feed.EventType]string{
statefeed.Reorg: ChainReorgTopic,
statefeed.BlockProcessed: BlockTopic,
statefeed.PayloadAttributes: PayloadAttributesTopic,
statefeed.ExecutionPayloadAvailable: ExecutionPayloadAvailableTopic,
}
var topicsForStateFeed = topicsForFeed(stateFeedEventTopics)
@@ -475,12 +466,6 @@ func topicForEvent(event *feed.Event) string {
return PayloadAttributesTopic
case *operation.DataColumnReceivedData:
return DataColumnTopic
case *operation.ExecutionPayloadBidReceivedData:
return ExecutionPayloadBidTopic
case *operation.PayloadAttestationMessageReceivedData:
return PayloadAttestationMessageTopic
case *statefeed.ExecutionPayloadAvailableData:
return ExecutionPayloadAvailableTopic
default:
return InvalidTopic
}
@@ -653,21 +638,6 @@ func (s *Server) lazyReaderForEvent(ctx context.Context, event *feed.Event, topi
}
return jsonMarshalReader(eventName, blk)
}, nil
case *statefeed.ExecutionPayloadAvailableData:
return func() io.Reader {
return jsonMarshalReader(eventName, &structs.ExecutionPayloadAvailableEvent{
Slot: fmt.Sprintf("%d", v.Slot),
BlockRoot: hexutil.Encode(v.BlockRoot[:]),
})
}, nil
case *operation.ExecutionPayloadBidReceivedData:
return func() io.Reader {
return jsonMarshalReader(eventName, structs.SignedExecutionPayloadBidFromConsensus(v.SignedBid))
}, nil
case *operation.PayloadAttestationMessageReceivedData:
return func() io.Reader {
return jsonMarshalReader(eventName, structs.PayloadAttestationMessageFromConsensus(v.PayloadAttestationMessage))
}, nil
default:
return nil, errors.Wrapf(errUnhandledEventData, "event data type %T unsupported", v)
}

View File

@@ -123,8 +123,6 @@ func operationEventsFixtures(t *testing.T) (*topicRequest, []*feed.Event) {
ProposerSlashingTopic,
BlockGossipTopic,
DataColumnTopic,
ExecutionPayloadBidTopic,
PayloadAttestationMessageTopic,
})
require.NoError(t, err)
ro, err := blocks.NewROBlob(util.HydrateBlobSidecar(&eth.BlobSidecar{}))
@@ -314,42 +312,6 @@ func operationEventsFixtures(t *testing.T) (*topicRequest, []*feed.Event) {
KzgCommitments: [][]byte{{'a'}, {'b'}, {'c'}},
},
},
{
Type: operation.ExecutionPayloadBidReceived,
Data: &operation.ExecutionPayloadBidReceivedData{
SignedBid: &eth.SignedExecutionPayloadBid{
Message: &eth.ExecutionPayloadBid{
ParentBlockHash: make([]byte, 32),
ParentBlockRoot: make([]byte, 32),
BlockHash: make([]byte, 32),
PrevRandao: make([]byte, 32),
FeeRecipient: make([]byte, 20),
GasLimit: 30000000,
BuilderIndex: 42,
Slot: 10,
Value: 1000000000,
ExecutionPayment: 0,
BlobKzgCommitmentsRoot: make([]byte, 32),
},
Signature: make([]byte, 96),
},
},
},
{
Type: operation.PayloadAttestationMessageReceived,
Data: &operation.PayloadAttestationMessageReceivedData{
PayloadAttestationMessage: &eth.PayloadAttestationMessage{
ValidatorIndex: 123,
Data: &eth.PayloadAttestationData{
BeaconBlockRoot: make([]byte, 32),
Slot: 10,
PayloadPresent: true,
BlobDataAvailable: true,
},
Signature: make([]byte, 96),
},
},
},
}
}
@@ -431,7 +393,6 @@ func TestStreamEvents_OperationsEvents(t *testing.T) {
FinalizedCheckpointTopic,
ChainReorgTopic,
BlockTopic,
ExecutionPayloadAvailableTopic,
})
require.NoError(t, err)
request := topics.testHttpRequest(testSync.ctx, t)
@@ -484,13 +445,6 @@ func TestStreamEvents_OperationsEvents(t *testing.T) {
ExecutionOptimistic: false,
},
},
{
Type: statefeed.ExecutionPayloadAvailable,
Data: &statefeed.ExecutionPayloadAvailableData{
Slot: 10,
BlockRoot: [32]byte{0x9a},
},
},
}
go func() {
@@ -767,7 +721,7 @@ func TestStuckReaderScenarios(t *testing.T) {
func wedgedWriterTestCase(t *testing.T, queueDepth func([]*feed.Event) int) {
topics, events := operationEventsFixtures(t)
require.Equal(t, 14, len(events))
require.Equal(t, 12, len(events))
// set eventFeedDepth to a number lower than the events we intend to send to force the server to drop the reader.
stn := mockChain.NewEventFeedWrapper()

View File

@@ -1,3 +0,0 @@
### Added
- the following events available at gloas `execution_payload_available`, `execution_payload_bid`,and `payload_attestation_message`

View File

@@ -0,0 +1,2 @@
### Added
- Close opened host in test helpers