Skip to content

Commit

Permalink
feat(proto): Add _v2 fields to support wrapperspb.Uint64Value
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Aug 11, 2023
1 parent b31f154 commit 205267b
Show file tree
Hide file tree
Showing 32 changed files with 2,559 additions and 1,365 deletions.
3 changes: 3 additions & 0 deletions pkg/mimicry/p2p/execution/event_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/ethpandaops/xatu/pkg/proto/xatu"
"github.com/sirupsen/logrus"
"google.golang.org/protobuf/types/known/timestamppb"
"google.golang.org/protobuf/types/known/wrapperspb"
)

func (p *Peer) handleTransaction(ctx context.Context, eventTime time.Time, event *types.Transaction) (*xatu.DecoratedEvent, error) {
Expand Down Expand Up @@ -71,10 +72,12 @@ func (p *Peer) getTransactionData(ctx context.Context, event *types.Transaction,

extra := &xatu.ClientMeta_AdditionalMempoolTransactionData{
Nonce: event.Nonce(),
NonceV2: wrapperspb.UInt64(event.Nonce()),
GasPrice: event.GasPrice().String(),
From: from.String(),
To: to,
Gas: event.Gas(),
GasV2: wrapperspb.UInt64(event.Gas()),
Value: event.Value().String(),
Hash: event.Hash().String(),
Size: strconv.FormatFloat(float64(event.Size()), 'f', 0, 64),
Expand Down
155 changes: 102 additions & 53 deletions pkg/proto/eth/v1/attestation.pb.go

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions pkg/proto/eth/v1/attestation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package xatu.eth.v1;

option go_package = "github.com/ethpandaops/xatu/pkg/proto/eth/v1";

import "google/protobuf/wrappers.proto";
import "google/protobuf/descriptor.proto";
import "pkg/proto/eth/v1/checkpoint.proto";

Expand All @@ -18,23 +19,29 @@ message Attestation {
}

message AttestationData {
uint64 slot = 1;
uint64 slot = 1 [ deprecated = true ];

uint64 index = 2;
uint64 index = 2 [ deprecated = true ];

string beacon_block_root = 3 [json_name="beacon_block_root"];

Checkpoint source = 4;

Checkpoint target = 5;

google.protobuf.UInt64Value slot_v2 = 6 [json_name="slot_v2"];

google.protobuf.UInt64Value index_v2 = 7 [json_name="index_v2"];
}

message AggregateAttestationAndProof {
uint64 aggregator_index = 1 [json_name="aggregator_index"];
uint64 aggregator_index = 1 [json_name="aggregator_index", deprecated=true];

Attestation aggregate = 3;

string selection_proof = 2 [json_name="selection_proof"];

google.protobuf.UInt64Value aggregator_index_v2 = 4 [json_name="aggregator_index_v2"];
}

message SignedAggregateAttestationAndProof {
Expand Down
373 changes: 204 additions & 169 deletions pkg/proto/eth/v1/beacon_block.pb.go

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions pkg/proto/eth/v1/beacon_block.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@ package xatu.eth.v1;

option go_package = "github.com/ethpandaops/xatu/pkg/proto/eth/v1";

import "google/protobuf/wrappers.proto";
import "google/protobuf/descriptor.proto";
import "pkg/proto/eth/v1/attestation.proto";

message BeaconBlock {
uint64 slot = 1;
uint64 slot = 1 [ deprecated=true ];

uint64 proposer_index = 2 [ json_name = "proposer_index" ];
uint64 proposer_index = 2 [ json_name = "proposer_index", deprecated=true ];

string parent_root = 3 [ json_name = "parent_root" ];

string state_root = 4 [ json_name = "state_root" ];

BeaconBlockBody body = 5;

google.protobuf.UInt64Value slot_v2 = 6 [ json_name = "slot_v2" ];

google.protobuf.UInt64Value proposer_index_v2 = 7 [ json_name = "proposer_index_v2" ];
}

message SignedBeaconBlock {
Expand Down
44 changes: 30 additions & 14 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.

3 changes: 3 additions & 0 deletions pkg/proto/eth/v1/checkpoint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ package xatu.eth.v1;
option go_package = "github.com/ethpandaops/xatu/pkg/proto/eth/v1";

import "google/protobuf/descriptor.proto";
import "google/protobuf/wrappers.proto";

message Checkpoint {
uint64 epoch = 1;

string root = 2;

google.protobuf.UInt64Value epoch_v2 = 3 [ json_name = "epoch_v2" ];
}
Loading

0 comments on commit 205267b

Please sign in to comment.