Skip to content

Commit

Permalink
Merge pull request #326 from ethpandaops/feat/blob-fields
Browse files Browse the repository at this point in the history
feat(cl-mimicry): add block fields to blob sidecar events
  • Loading branch information
Savid authored Jun 4, 2024
2 parents d0a85d4 + 1fc8a0a commit c149d5a
Show file tree
Hide file tree
Showing 27 changed files with 131 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,8 @@ transforms:
.propagation_slot_start_diff = .meta.client.additional_data.propagation.slot_start_diff
.proposer_index = .data.proposer_index
.blob_index = .data.index
.state_root = .data.state_root
.parent_root = .data.parent_root
peer_id_key, err = .meta.client.additional_data.metadata.peer_id + .meta.ethereum.network.name
if err != null {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}'
DROP COLUMN parent_root;

ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}'
DROP COLUMN parent_root;

ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}'
DROP COLUMN state_root;

ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}'
DROP COLUMN state_root;
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}'
ADD COLUMN parent_root FixedString(66) Codec(ZSTD(1)) AFTER blob_index;

ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}'
ADD COLUMN parent_root FixedString(66) Codec(ZSTD(1)) AFTER blob_index;

ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}'
COMMENT COLUMN parent_root 'Parent root of the beacon block';

ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}'
COMMENT COLUMN parent_root 'Parent root of the beacon block';

ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}'
ADD COLUMN state_root FixedString(66) Codec(ZSTD(1)) AFTER parent_root;

ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}'
ADD COLUMN state_root FixedString(66) Codec(ZSTD(1)) AFTER parent_root;

ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}'
COMMENT COLUMN state_root 'State root of the beacon block';

ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}'
COMMENT COLUMN state_root 'State root of the beacon block';
12 changes: 12 additions & 0 deletions pkg/clmimicry/gossipsub_blob_sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,22 @@ func (m *Mimicry) handleGossipBlobSidecar(
return fmt.Errorf("invalid proposer index")
}

stateRoot, ok := payload["StateRoot"].(string)
if !ok {
return fmt.Errorf("invalid state root")
}

parentRoot, ok := payload["ParentRoot"].(string)
if !ok {
return fmt.Errorf("invalid parent root")
}

data := &gossipsub.BlobSidecar{
Index: wrapperspb.UInt64(blobIndex),
Slot: wrapperspb.UInt64(uint64(slot)),
ProposerIndex: wrapperspb.UInt64(uint64(proposerIndex)),
StateRoot: wrapperspb.String(stateRoot),
ParentRoot: wrapperspb.String(parentRoot),
}

metadata, ok := proto.Clone(clientMeta).(*xatu.ClientMeta)
Expand Down
4 changes: 2 additions & 2 deletions pkg/proto/blockprint/block_classification.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/attestation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/beacon_block.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/blob.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/checkpoint.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/committee.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/duties.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/events.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/execution_engine.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/fork_choice.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v1/sync_committee.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v2/beacon_block.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v2/events.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/eth/v2/withdrawals.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/libp2p/eth.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 39 additions & 13 deletions pkg/proto/libp2p/gossipsub/eth.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pkg/proto/libp2p/gossipsub/eth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ message BlobSidecar {
google.protobuf.UInt64Value index = 1 [json_name = "index"];
google.protobuf.UInt64Value slot = 2 [json_name = "slot"];
google.protobuf.UInt64Value proposer_index = 3 [json_name = "proposer_index"];
}
google.protobuf.StringValue state_root = 4 [json_name = "state_root"];
google.protobuf.StringValue parent_root = 5 [json_name = "parent_root"];
}

4 changes: 2 additions & 2 deletions pkg/proto/libp2p/peer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/libp2p/trace.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/xatu/coordinator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/xatu/coordinator_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/proto/xatu/event_ingester.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/proto/xatu/event_ingester_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c149d5a

Please sign in to comment.