t8n: do not omit requests when empty

This commit is contained in:
lightclient 2024-12-09 18:40:53 -07:00
parent 46a6482d19
commit 7ecda7d054
No known key found for this signature in database
GPG key ID: 75C916AFEE20183E
20 changed files with 52 additions and 34 deletions

View file

@ -70,11 +70,11 @@ type ExecutionResult struct {
CurrentExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas,omitempty"` CurrentExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas,omitempty"`
CurrentBlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed,omitempty"` CurrentBlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed,omitempty"`
RequestsHash *common.Hash `json:"requestsHash,omitempty"` RequestsHash *common.Hash `json:"requestsHash,omitempty"`
Requests [][]byte `json:"requests,omitempty"` Requests [][]byte `json:"requests"`
} }
type executionResultMarshaling struct { type executionResultMarshaling struct {
Requests []hexutil.Bytes `json:"requests,omitempty"` Requests []hexutil.Bytes `json:"requests"`
} }
type ommer struct { type ommer struct {

View file

@ -31,7 +31,7 @@ func (e ExecutionResult) MarshalJSON() ([]byte, error) {
CurrentExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas,omitempty"` CurrentExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas,omitempty"`
CurrentBlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed,omitempty"` CurrentBlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed,omitempty"`
RequestsHash *common.Hash `json:"requestsHash,omitempty"` RequestsHash *common.Hash `json:"requestsHash,omitempty"`
Requests []hexutil.Bytes `json:"requests,omitempty"` Requests []hexutil.Bytes `json:"requests"`
} }
var enc ExecutionResult var enc ExecutionResult
enc.StateRoot = e.StateRoot enc.StateRoot = e.StateRoot
@ -74,7 +74,7 @@ func (e *ExecutionResult) UnmarshalJSON(input []byte) error {
CurrentExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas,omitempty"` CurrentExcessBlobGas *math.HexOrDecimal64 `json:"currentExcessBlobGas,omitempty"`
CurrentBlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed,omitempty"` CurrentBlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed,omitempty"`
RequestsHash *common.Hash `json:"requestsHash,omitempty"` RequestsHash *common.Hash `json:"requestsHash,omitempty"`
Requests []hexutil.Bytes `json:"requests,omitempty"` Requests []hexutil.Bytes `json:"requests"`
} }
var dec ExecutionResult var dec ExecutionResult
if err := json.Unmarshal(input, &dec); err != nil { if err := json.Unmarshal(input, &dec); err != nil {

View file

@ -40,6 +40,7 @@
} }
], ],
"currentDifficulty": "0x20000", "currentDifficulty": "0x20000",
"gasUsed": "0x5208" "gasUsed": "0x5208",
"requests": null
} }
} }

View file

@ -37,6 +37,7 @@
], ],
"currentDifficulty": "0x20000", "currentDifficulty": "0x20000",
"gasUsed": "0x109a0", "gasUsed": "0x109a0",
"currentBaseFee": "0x36b" "currentBaseFee": "0x36b",
"requests": null
} }
} }

View file

@ -8,6 +8,7 @@
"currentDifficulty": "0x2000020000000", "currentDifficulty": "0x2000020000000",
"receipts": [], "receipts": [],
"gasUsed": "0x0", "gasUsed": "0x0",
"currentBaseFee": "0x500" "currentBaseFee": "0x500",
"requests": null
} }
} }

View file

@ -8,6 +8,7 @@
"receipts": [], "receipts": [],
"currentDifficulty": "0x1ff8020000000", "currentDifficulty": "0x1ff8020000000",
"gasUsed": "0x0", "gasUsed": "0x0",
"currentBaseFee": "0x500" "currentBaseFee": "0x500",
"requests": null
} }
} }

View file

@ -8,6 +8,7 @@
"receipts": [], "receipts": [],
"currentDifficulty": "0x1ff9000000000", "currentDifficulty": "0x1ff9000000000",
"gasUsed": "0x0", "gasUsed": "0x0",
"currentBaseFee": "0x500" "currentBaseFee": "0x500",
"requests": null
} }
} }

View file

@ -8,6 +8,7 @@
"currentDifficulty": "0x2000000200000", "currentDifficulty": "0x2000000200000",
"receipts": [], "receipts": [],
"gasUsed": "0x0", "gasUsed": "0x0",
"currentBaseFee": "0x500" "currentBaseFee": "0x500",
"requests": null
} }
} }

View file

@ -1,13 +1,14 @@
{ {
"result": { "result": {
"stateRoot": "0x6f058887ca01549716789c380ede95aecc510e6d1fdc4dbf67d053c7c07f4bdc", "stateRoot": "0x6f058887ca01549716789c380ede95aecc510e6d1fdc4dbf67d053c7c07f4bdc",
"txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"receipts": [], "receipts": [],
"currentDifficulty": "0x2000000004000", "currentDifficulty": "0x2000000004000",
"gasUsed": "0x0", "gasUsed": "0x0",
"currentBaseFee": "0x500" "currentBaseFee": "0x500",
} "requests": null
}
} }

View file

@ -8,6 +8,7 @@
"currentDifficulty": "0x2000080000000", "currentDifficulty": "0x2000080000000",
"receipts": [], "receipts": [],
"gasUsed": "0x0", "gasUsed": "0x0",
"currentBaseFee": "0x500" "currentBaseFee": "0x500",
"requests": null
} }
} }

View file

@ -21,6 +21,7 @@
} }
], ],
"currentDifficulty": "0x20000", "currentDifficulty": "0x20000",
"gasUsed": "0x520b" "gasUsed": "0x520b",
"requests": null
} }
} }

View file

@ -51,6 +51,7 @@
], ],
"currentDifficulty": null, "currentDifficulty": null,
"gasUsed": "0x10306", "gasUsed": "0x10306",
"currentBaseFee": "0x500" "currentBaseFee": "0x500",
"requests": null
} }
} }

View file

@ -34,6 +34,7 @@
], ],
"currentDifficulty": null, "currentDifficulty": null,
"gasUsed": "0x5208", "gasUsed": "0x5208",
"currentBaseFee": "0x460" "currentBaseFee": "0x460",
"requests": null
} }
} }

View file

@ -15,6 +15,7 @@
"currentDifficulty": null, "currentDifficulty": null,
"gasUsed": "0x0", "gasUsed": "0x0",
"currentBaseFee": "0x500", "currentBaseFee": "0x500",
"withdrawalsRoot": "0x4921c0162c359755b2ae714a0978a1dad2eb8edce7ff9b38b9b6fc4cbc547eb5" "withdrawalsRoot": "0x4921c0162c359755b2ae714a0978a1dad2eb8edce7ff9b38b9b6fc4cbc547eb5",
"requests": null
} }
} }

View file

@ -42,6 +42,7 @@
"currentBaseFee": "0x9", "currentBaseFee": "0x9",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"currentExcessBlobGas": "0x0", "currentExcessBlobGas": "0x0",
"blobGasUsed": "0x20000" "blobGasUsed": "0x20000",
"requests": null
} }
} }

View file

@ -40,6 +40,7 @@
"currentBaseFee": "0x9", "currentBaseFee": "0x9",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"currentExcessBlobGas": "0x0", "currentExcessBlobGas": "0x0",
"blobGasUsed": "0x0" "blobGasUsed": "0x0",
"requests": null
} }
} }

View file

@ -34,6 +34,7 @@
} }
], ],
"currentDifficulty": "0x20000", "currentDifficulty": "0x20000",
"gasUsed": "0x521f" "gasUsed": "0x521f",
"requests": null
} }
} }

View file

@ -59,6 +59,7 @@
"currentBaseFee": "0x7", "currentBaseFee": "0x7",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"currentExcessBlobGas": "0x0", "currentExcessBlobGas": "0x0",
"blobGasUsed": "0x0" "blobGasUsed": "0x0",
"requests": null
} }
} }

View file

@ -60,6 +60,7 @@
"gasUsed": "0x15fa9", "gasUsed": "0x15fa9",
"currentBaseFee": "0x7", "currentBaseFee": "0x7",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"requests": []
} }
} }

View file

@ -18,6 +18,7 @@
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"receipts": [], "receipts": [],
"currentDifficulty": "0x20000", "currentDifficulty": "0x20000",
"gasUsed": "0x0" "gasUsed": "0x0",
"requests": null
} }
} }