@@ -104,9 +104,12 @@ const (
104104 zeroHashHex = "0x0000000000000000000000000000000000000000000000000000000000000000"
105105)
106106
107- // minimalBlockAccessListJSON is a spec-shaped (EIP-7928) block access list with
108- // a single account entry, as returned by engine_getPayloadV6.
109- const minimalBlockAccessListJSON = `[{"address": "0x00000000000000000000000000000000000000aa"}]`
107+ // minimalBlockAccessListJSON matches ev-reth's wire encoding of
108+ // executionPayload.blockAccessList in engine_getPayloadV6 responses: the
109+ // encoded access list as a hex string. go-ethereum instead models the field as
110+ // structured JSON objects; ev-node must accept either shape and pass it
111+ // through unchanged (see TestEnginePayloadEnvelope_StructuredBlockAccessList).
112+ const minimalBlockAccessListJSON = `"0x1234"`
110113
111114func minimalAmsterdamPayloadEnvelopeJSON (t * testing.T ) string {
112115 t .Helper ()
@@ -528,6 +531,28 @@ func TestNewPayload_NilExecutionRequests_EncodedAsEmptyArray(t *testing.T) {
528531 require .NoError (t , err )
529532}
530533
534+ func TestEnginePayloadEnvelope_StructuredBlockAccessList (t * testing.T ) {
535+ structured := strings .Replace (
536+ minimalAmsterdamPayloadEnvelopeJSON (t ),
537+ `"blockAccessList": ` + minimalBlockAccessListJSON ,
538+ `"blockAccessList": [{"address": "0x00000000000000000000000000000000000000aa"}]` ,
539+ 1 ,
540+ )
541+
542+ var envelope EnginePayloadEnvelope
543+ require .NoError (t , json .Unmarshal ([]byte (structured ), & envelope ))
544+ require .True (t , envelope .hasAmsterdamFields ())
545+
546+ payload , err := envelope .executionPayloadParam ()
547+ require .NoError (t , err )
548+ raw , ok := payload .(json.RawMessage )
549+ require .True (t , ok )
550+
551+ var fields map [string ]json.RawMessage
552+ require .NoError (t , json .Unmarshal (raw , & fields ))
553+ require .JSONEq (t , `[{"address": "0x00000000000000000000000000000000000000aa"}]` , string (fields ["blockAccessList" ]))
554+ }
555+
531556func TestEnginePayloadEnvelope_MarshalJSON_UsesWireFieldNames (t * testing.T ) {
532557 var envelope EnginePayloadEnvelope
533558 require .NoError (t , json .Unmarshal ([]byte (minimalAmsterdamPayloadEnvelopeJSON (t )), & envelope ))
0 commit comments