Skip to content

Commit 6ac7f80

Browse files
authored
feat: add Amsterdam support up to bal-devnet-2 (#144)
Updates `engine_newPayloadV5` for `engine_forkchoiceUpdatedV4` with fields present up to `bal-devnet-2`. Tested locally against geth `bal-devnet-2` branch, with up-to-date execution-specs branch at my fork fselmo/execution-specs, branch `devnets/bal/2`. Working well locally though I couldn't run all the tests locally as I ran into an unrelated (I believe) issue. Can use a sanity check on tests but the benchmark run ran through locally for `-m repricing tests/benchmark/compute` EELS tests 👍🏼.
1 parent ecfc5d8 commit 6ac7f80

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

pkg/eest/converter.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ func buildNewPayloadCall(payload *EngineNewPayload, id int) (string, error) {
120120
payload.ParentBeaconBlockRoot,
121121
payload.ExecutionRequests,
122122
}
123+
case 5:
124+
// V5 (Amsterdam): executionPayload, expectedBlobVersionedHashes, parentBeaconBlockRoot, executionRequests
125+
params = []any{
126+
execPayload,
127+
payload.BlobVersionedHashes,
128+
payload.ParentBeaconBlockRoot,
129+
payload.ExecutionRequests,
130+
}
123131
default:
124132
return "", fmt.Errorf("unsupported payload version: %d", payload.NewPayloadVersion)
125133
}
@@ -219,5 +227,16 @@ func buildExecutionPayloadJSON(ep *ExecutionPayload, version int) map[string]any
219227
// Note: V4 deposit/withdrawal/consolidation requests are passed as executionRequests
220228
// parameter, not in the payload itself.
221229

230+
// Add Amsterdam fields for V5+.
231+
if version >= 5 {
232+
if ep.BlockAccessList != "" {
233+
result["blockAccessList"] = ep.BlockAccessList
234+
}
235+
236+
if ep.SlotNumber != "" {
237+
result["slotNumber"] = ep.SlotNumber
238+
}
239+
}
240+
222241
return result
223242
}

pkg/eest/converter_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ func TestConvertFixture_PayloadVersions(t *testing.T) {
165165
{2, 1, "engine_newPayloadV2", "engine_forkchoiceUpdatedV1"},
166166
{3, 3, "engine_newPayloadV3", "engine_forkchoiceUpdatedV3"},
167167
{4, 3, "engine_newPayloadV4", "engine_forkchoiceUpdatedV3"},
168+
{5, 4, "engine_newPayloadV5", "engine_forkchoiceUpdatedV4"},
168169
}
169170

170171
for _, tc := range tests {

pkg/eest/fixture.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ type ExecutionPayload struct {
171171
DepositRequests []*Deposit `json:"depositRequests,omitempty"`
172172
WithdrawalRequests []*WithdrawReq `json:"withdrawalRequests,omitempty"`
173173
ConsolidationRequests []*Consolidate `json:"consolidationRequests,omitempty"`
174+
BlockAccessList string `json:"blockAccessList,omitempty"`
175+
SlotNumber string `json:"slotNumber,omitempty"`
174176
}
175177

176178
// Withdrawal represents a withdrawal in the execution payload.

0 commit comments

Comments
 (0)