Skip to content

Commit

Permalink
internal/ethapi: always return block withdrawals if present (#26565)
Browse files Browse the repository at this point in the history
The execution-apis specification says that the full list of withdrawals should always be returned when requesting a block over RPC:

https://github.com/ethereum/execution-apis/blob/378c4304f75b5af2c9b5263c9c76b511e33e8984/src/schemas/block.yaml#L90-L94

This change adopts the expected behavior.
  • Loading branch information
lightclient authored Jan 31, 2023
1 parent efbd508 commit bd6a05e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1246,16 +1246,16 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *param
}
}
fields["transactions"] = transactions
// inclTx also expands withdrawals
fields["withdrawals"] = block.Withdrawals()
}
uncles := block.Uncles()
uncleHashes := make([]common.Hash, len(uncles))
for i, uncle := range uncles {
uncleHashes[i] = uncle.Hash()
}
fields["uncles"] = uncleHashes

if block.Header().WithdrawalsHash != nil {
fields["withdrawals"] = block.Withdrawals()
}
return fields, nil
}

Expand Down

0 comments on commit bd6a05e

Please sign in to comment.