Skip to content

Commit f22ec85

Browse files
committed
backfill
1 parent e6827bb commit f22ec85

File tree

3 files changed

+109
-1
lines changed

3 files changed

+109
-1
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/Layr-Labs/protocol-apis
33
go 1.23.6
44

55
require (
6+
github.com/Layr-Labs/protobuf-libs v0.0.0-20250305032038-8d1047b56aab
67
github.com/akuity/grpc-gateway-client v0.0.0-20240912082144-55a48e8b4b89
78
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2
89
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9
@@ -11,7 +12,6 @@ require (
1112
)
1213

1314
require (
14-
github.com/Layr-Labs/protobuf-libs v0.0.0-20250305032038-8d1047b56aab // indirect
1515
github.com/alevinval/sse v1.0.1 // indirect
1616
github.com/go-resty/resty/v2 v2.7.0 // indirect
1717
github.com/golang/protobuf v1.5.3 // indirect
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
syntax = "proto3";
2+
3+
package eigenlayer.sidecar.v1.backfiller;
4+
5+
option go_package = "github.com/Layr-Labs/protocol-apis/gen/protos/eigenlayer/sidecar/v1/backfiller";
6+
7+
import "google/api/annotations.proto";
8+
import "eigenlayer/sidecar/v1/ethereumTypes/ethereumTypes.proto";
9+
10+
// BackfillRequest represents a request to backfill transaction data for a range of blocks
11+
message BackfillRequest {
12+
// StartBlock is the first block to process (inclusive)
13+
uint64 start_block = 1;
14+
15+
// EndBlock is the last block to process (inclusive)
16+
uint64 end_block = 2;
17+
18+
// Addresses is a list of contract addresses to filter logs by
19+
repeated string addresses = 3;
20+
21+
// EventSignatures is a list of event signatures to filter logs by
22+
repeated string event_signatures = 4;
23+
}
24+
25+
// BackfillResponse represents the result of a backfill operation
26+
message BackfillResponse {
27+
// Success indicates whether the backfill operation was successful
28+
bool success = 1;
29+
30+
// Errors is a list of errors encountered during backfilling
31+
repeated string errors = 2;
32+
33+
// ProcessedBlocks is the number of blocks that were processed
34+
uint64 processed_blocks = 3;
35+
36+
// ProcessedLogs is the number of logs that were processed
37+
uint64 processed_logs = 4;
38+
}
39+
40+
// BackfillStatusRequest represents a request to get the status of a backfill operation
41+
message BackfillStatusRequest {
42+
// RequestId is the ID of the backfill request to get status for
43+
string request_id = 1;
44+
}
45+
46+
// BackfillStatusResponse represents the status of a backfill operation
47+
message BackfillStatusResponse {
48+
// RequestId is the ID of the backfill request
49+
string request_id = 1;
50+
51+
// Status is the current status of the backfill operation
52+
enum Status {
53+
UNKNOWN = 0;
54+
QUEUED = 1;
55+
PROCESSING = 2;
56+
COMPLETED = 3;
57+
FAILED = 4;
58+
}
59+
Status status = 2;
60+
61+
// Progress is the percentage of completion (0-100)
62+
uint32 progress = 3;
63+
64+
// StartBlock is the first block being processed
65+
uint64 start_block = 4;
66+
67+
// CurrentBlock is the block currently being processed
68+
uint64 current_block = 5;
69+
70+
// EndBlock is the last block to be processed
71+
uint64 end_block = 6;
72+
73+
// Errors is a list of errors encountered during backfilling
74+
repeated string errors = 7;
75+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
syntax = "proto3";
2+
3+
package eigenlayer.sidecar.v1.backfiller;
4+
5+
option go_package = "github.com/Layr-Labs/protocol-apis/gen/protos/eigenlayer/sidecar/v1/backfiller";
6+
7+
import "google/api/annotations.proto";
8+
import "eigenlayer/sidecar/v1/backfiller/backfiller.proto";
9+
10+
// TransactionBackfiller service provides methods for backfilling transaction data
11+
service TransactionBackfiller {
12+
// BackfillBlocks initiates a backfill operation for a range of blocks
13+
rpc BackfillBlocks(BackfillRequest) returns (BackfillResponse) {
14+
option (google.api.http) = {
15+
post: "/backfiller/v1/backfill-blocks"
16+
body: "*"
17+
};
18+
}
19+
20+
// GetBackfillStatus retrieves the status of a backfill operation
21+
rpc GetBackfillStatus(BackfillStatusRequest) returns (BackfillStatusResponse) {
22+
option (google.api.http) = {
23+
get: "/backfiller/v1/status/{request_id}"
24+
};
25+
}
26+
27+
// StreamBackfillStatus streams the status of a backfill operation in real-time
28+
rpc StreamBackfillStatus(BackfillStatusRequest) returns (stream BackfillStatusResponse) {
29+
option (google.api.http) = {
30+
get: "/backfiller/v1/stream-status/{request_id}"
31+
};
32+
}
33+
}

0 commit comments

Comments
 (0)