# Static test case for withdrawals on EL The following test case was generated by the fuzzer so it looks a bit funky. The genesis block can be created with the following config: ``` { "config": { "chainId":1, "homesteadBlock":0, "eip150Block":0, "eip155Block":0, "eip158Block":0, "byzantiumBlock":0, "constantinopleBlock":0, "petersburgBlock":0, "istanbulBlock":0, "muirGlacierBlock":0, "berlinBlock":0, "londonBlock":0, "shanghaiBlock":0, "clique": { "blockperiodseconds": 5, "epochlength": 30000 }, "terminalTotalDifficulty":0 }, "nonce":"0x42", "timestamp":"0x0", "extraData":"0x0000000000000000000000000000000000000000000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "gasLimit":"0x1C9C380", "difficulty":"0x400000000", "mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase":"0x0000000000000000000000000000000000000000", "alloc":{ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b":{"balance":"0x6d6172697573766477000000"} }, "number":"0x0", "gasUsed":"0x0", "parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000", "baseFeePerGas":"0x7" } ``` First we send a FCU with the following parameters: ``` FCU HeadBlockHash:0xfe950635b1bd2a416ff6283b0bbd30176e1b1125ad06fa729da9f3f4c1c61710 SafeBlockHash:0xfe950635b1bd2a416ff6283b0bbd30176e1b1125ad06fa729da9f3f4c1c61710 FinalizedBlockHash:0xfe950635b1bd2a416ff6283b0bbd30176e1b1125ad06fa729da9f3f4c1c61710} &{Timestamp:50 Random:0xff00000000000000000000000000000000000000000000000000000000000000 SuggestedFeeRecipient:0xaa00000000000000000000000000000000000000 Withdrawals:[0xc0001167b0 0xc0001167e0 0xc000116810 0xc000116840 0xc000116870 0xc0001168a0 0xc0001168d0 0xc000116900]} ``` Withdrawals are not printed correctly, here they are in pretty printed form: ``` Withdrawals &{Index:0 Validator:65535 Recipient:0x0000000000000000000000000000000000000000 Amount:+0}&{Index:1 Validator:65536 Recipient:0x0100000000000000000000000000000000000000 Amount:+452312848583266388373324160190187140051835877600158453279131187530910662656}&{Index:2 Validator:65537 Recipient:0x0200000000000000000000000000000000000000 Amount:+904625697166532776746648320380374280103671755200316906558262375061821325312}&{Index:3 Validator:65538 Recipient:0x0300000000000000000000000000000000000000 Amount:+1356938545749799165119972480570561420155507632800475359837393562592731987968}&{Index:4 Validator:65539 Recipient:0x0400000000000000000000000000000000000000 Amount:+1809251394333065553493296640760748560207343510400633813116524750123642650624}&{Index:5 Validator:65540 Recipient:0x0500000000000000000000000000000000000000 Amount:+2261564242916331941866620800950935700259179388000792266395655937654553313280}&{Index:6 Validator:65541 Recipient:0x0600000000000000000000000000000000000000 Amount:+2713877091499598330239944961141122840311015265600950719674787125185463975936}&{Index:7 Validator:65542 Recipient:0x0700000000000000000000000000000000000000 Amount:+3166189940082864718613269121331309980362851143201109172953918312716374638592} ``` The result of the FCU should be ``` {PayloadStatus:{Status:VALID LatestValidHash:0xfe950635b1bd2a416ff6283b0bbd30176e1b1125ad06fa729da9f3f4c1c61710 ValidationError:<nil>} PayloadID:0xaa310cafae3839f5} ``` Now we call `GetPayload` with `0xaa310cafae3839f5` as the payload id. Result (withdrawals are not expanded correctly again, just take them from above): ``` {ParentHash:0xfe950635b1bd2a416ff6283b0bbd30176e1b1125ad06fa729da9f3f4c1c61710 FeeRecipient:0xaa00000000000000000000000000000000000000 StateRoot:0x7f7510a0cb6203f456e34ec3e2ce30d6c5590ded42c10a9cf3f24784119c5afb ReceiptsRoot:0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421 LogsBloom:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] Random:0xff00000000000000000000000000000000000000000000000000000000000000 Number:1 GasLimit:30000000 GasUsed:0 Timestamp:13 ExtraData:[] BaseFeePerGas:+7 BlockHash:0x2ff774a9940959760d1b98330be6d764a63861e4285871e794ad5542bd38e886 Transactions:[] Withdrawals:[0xc0000ab500 0xc0000ab5f0 0xc0000ab650 0xc0000ab6b0 0xc0000ab740 0xc0000ab7a0 0xc0000ab800 0xc0000ab860]} ``` Now we call `NewPayload` with the following parameters (withdrawals are not expanded correctly again, just take them from above): ``` {ParentHash:0xfe950635b1bd2a416ff6283b0bbd30176e1b1125ad06fa729da9f3f4c1c61710 FeeRecipient:0xaa00000000000000000000000000000000000000 StateRoot:0x7f7510a0cb6203f456e34ec3e2ce30d6c5590ded42c10a9cf3f24784119c5afb ReceiptsRoot:0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421 LogsBloom:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] Random:0xff00000000000000000000000000000000000000000000000000000000000000 Number:1 GasLimit:30000000 GasUsed:0 Timestamp:13 ExtraData:[] BaseFeePerGas:+7 BlockHash:0x2ff774a9940959760d1b98330be6d764a63861e4285871e794ad5542bd38e886 Transactions:[] Withdrawals:[0xc0000ab500 0xc0000ab5f0 0xc0000ab650 0xc0000ab6b0 0xc0000ab740 0xc0000ab7a0 0xc0000ab800 0xc0000ab860]} ``` Which should result in ``` {Status:VALID LatestValidHash:0x2ff774a9940959760d1b98330be6d764a63861e4285871e794ad5542bd38e886 ValidationError:<nil>} ``` Now we set head to the correctly imported block with fcu: ``` {HeadBlockHash:0x2ff774a9940959760d1b98330be6d764a63861e4285871e794ad5542bd38e886 SafeBlockHash:0x2ff774a9940959760d1b98330be6d764a63861e4285871e794ad5542bd38e886 FinalizedBlockHash:0x2ff774a9940959760d1b98330be6d764a63861e4285871e794ad5542bd38e886} <nil> ``` Result: ``` {PayloadStatus:{Status:VALID LatestValidHash:0x2ff774a9940959760d1b98330be6d764a63861e4285871e794ad5542bd38e886 ValidationError:<nil>} PayloadID:<nil>} ``` And the head block should be updated to `0x2ff774a9940959760d1b98330be6d764a63861e4285871e794ad5542bd38e886`