Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit f234223

Browse files
Include pos fields to bundle stats (metachris#15)
* include pos fields to bundle stats * rename type
1 parent 3ca4a1d commit f234223

File tree

2 files changed

+50
-12
lines changed

2 files changed

+50
-12
lines changed

flashbotsrpc_test.go

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,9 +1171,25 @@ func (s *FlashbotsRPCTestSuite) TestFlashbotsGetBundleStats() {
11711171
"isSimulated": true,
11721172
"isSentToMiners": true,
11731173
"isHighPriority": true,
1174-
"simulatedAt": "2021-08-06T21:36:06.317Z",
1175-
"submittedAt": "2021-08-06T21:36:06.250Z",
1176-
"sentToMinersAt": "2021-08-06T21:36:06.343Z"
1174+
"simulatedAt": "2022-10-06T21:36:06.317Z",
1175+
"submittedAt": "2022-10-06T21:36:06.250Z",
1176+
"sentToMinersAt": "2022-10-06T21:36:06.343Z",
1177+
"consideredByBuildersAt": [
1178+
{
1179+
"pubkey": "0x81babeec8c9f2bb9c329fd8a3b176032fe0ab5f3b92a3f44d4575a231c7bd9c31d10b6328ef68ed1e8c02a3dbc8e80f9",
1180+
"timestamp": "2022-10-06T21:36:06.343Z"
1181+
},
1182+
{
1183+
"pubkey": "0x81beef03aafd3dd33ffd7deb337407142c80fea2690e5b3190cfc01bde5753f28982a7857c96172a75a234cb7bcb994f",
1184+
"timestamp": "2022-10-06T21:36:06.394Z"
1185+
}
1186+
],
1187+
"sealedByBuildersAt": [
1188+
{
1189+
"pubkey": "0x81beef03aafd3dd33ffd7deb337407142c80fea2690e5b3190cfc01bde5753f28982a7857c96172a75a234cb7bcb994f",
1190+
"timestamp": "2022-10-06T21:36:07.742Z"
1191+
}
1192+
]
11771193
}`
11781194

11791195
s.registerResponse(response, func(body []byte) {
@@ -1188,9 +1204,25 @@ func (s *FlashbotsRPCTestSuite) TestFlashbotsGetBundleStats() {
11881204
IsSimulated: true,
11891205
IsSentToMiners: true,
11901206
IsHighPriority: true,
1191-
SimulatedAt: time.Date(2021, 8, 6, 21, 36, 6, 317000000, time.UTC),
1192-
SubmittedAt: time.Date(2021, 8, 6, 21, 36, 6, 250000000, time.UTC),
1193-
SentToMinersAt: time.Date(2021, 8, 6, 21, 36, 6, 343000000, time.UTC),
1207+
SimulatedAt: time.Date(2022, 10, 6, 21, 36, 6, 317000000, time.UTC),
1208+
SubmittedAt: time.Date(2022, 10, 6, 21, 36, 6, 250000000, time.UTC),
1209+
SentToMinersAt: time.Date(2022, 10, 6, 21, 36, 6, 343000000, time.UTC),
1210+
ConsideredByBuildersAt: []*BuilderPubkeyWithTimestamp{
1211+
{
1212+
Pubkey: "0x81babeec8c9f2bb9c329fd8a3b176032fe0ab5f3b92a3f44d4575a231c7bd9c31d10b6328ef68ed1e8c02a3dbc8e80f9",
1213+
Timestamp: time.Date(2022, 10, 6, 21, 36, 6, 343000000, time.UTC),
1214+
},
1215+
{
1216+
Pubkey: "0x81beef03aafd3dd33ffd7deb337407142c80fea2690e5b3190cfc01bde5753f28982a7857c96172a75a234cb7bcb994f",
1217+
Timestamp: time.Date(2022, 10, 6, 21, 36, 6, 394000000, time.UTC),
1218+
},
1219+
},
1220+
SealedByBuildersAt: []*BuilderPubkeyWithTimestamp{
1221+
{
1222+
Pubkey: "0x81beef03aafd3dd33ffd7deb337407142c80fea2690e5b3190cfc01bde5753f28982a7857c96172a75a234cb7bcb994f",
1223+
Timestamp: time.Date(2022, 10, 6, 21, 36, 7, 742000000, time.UTC),
1224+
},
1225+
},
11941226
}
11951227
s.Require().Equal(expected, bundleStats)
11961228
}

types.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,18 @@ type FlashbotsGetBundleStatsParam struct {
392392
}
393393

394394
type FlashbotsGetBundleStatsResponse struct {
395-
IsSimulated bool `json:"isSimulated"`
396-
IsSentToMiners bool `json:"isSentToMiners"`
397-
IsHighPriority bool `json:"isHighPriority"`
398-
SimulatedAt time.Time `json:"simulatedAt"`
399-
SubmittedAt time.Time `json:"submittedAt"`
400-
SentToMinersAt time.Time `json:"sentToMinersAt"`
395+
IsSimulated bool `json:"isSimulated"`
396+
IsSentToMiners bool `json:"isSentToMiners"`
397+
IsHighPriority bool `json:"isHighPriority"`
398+
SimulatedAt time.Time `json:"simulatedAt"`
399+
SubmittedAt time.Time `json:"submittedAt"`
400+
SentToMinersAt time.Time `json:"sentToMinersAt"`
401+
ConsideredByBuildersAt []*BuilderPubkeyWithTimestamp `json:"consideredByBuildersAt"`
402+
SealedByBuildersAt []*BuilderPubkeyWithTimestamp `json:"sealedByBuildersAt"`
403+
}
404+
type BuilderPubkeyWithTimestamp struct {
405+
Pubkey string `json:"pubkey"`
406+
Timestamp time.Time `json:"timestamp"`
401407
}
402408

403409
type FlashbotsSendBundleResponse struct {

0 commit comments

Comments
 (0)