@@ -59,10 +59,10 @@ type Receipt struct {
5959 Logs []* Log `json:"logs" gencodec:"required"`
6060
6161 // Implementation fields: These fields are added by geth when processing a transaction.
62- // They are stored in the chain database.
63- TxHash common.Hash `json:"transactionHash" gencodec:"required "`
64- ContractAddress common. Address `json:"contractAddress "`
65- GasUsed uint64 `json:"gasUsed" gencodec:"required "`
62+ TxHash common. Hash `json:"transactionHash" gencodec:"required"`
63+ ContractAddress common.Address `json:"contractAddress "`
64+ GasUsed uint64 `json:"gasUsed" gencodec:"required "`
65+ EffectiveGasPrice * big. Int `json:"effectiveGasPrice "`
6666
6767 // Inclusion information: These fields provide information about the inclusion of the
6868 // transaction corresponding to this receipt.
@@ -313,7 +313,7 @@ func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) {
313313
314314// DeriveFields fills the receipts with their computed fields based on consensus
315315// data and contextual infos like containing block and transactions.
316- func (rs Receipts ) DeriveFields (config * params.ChainConfig , hash common.Hash , number uint64 , txs Transactions ) error {
316+ func (rs Receipts ) DeriveFields (config * params.ChainConfig , hash common.Hash , number uint64 , baseFee * big. Int , txs [] * Transaction ) error {
317317 signer := MakeSigner (config , new (big.Int ).SetUint64 (number ))
318318
319319 logIndex := uint (0 )
@@ -325,6 +325,8 @@ func (rs Receipts) DeriveFields(config *params.ChainConfig, hash common.Hash, nu
325325 rs [i ].Type = txs [i ].Type ()
326326 rs [i ].TxHash = txs [i ].Hash ()
327327
328+ rs [i ].EffectiveGasPrice = txs [i ].inner .effectiveGasPrice (new (big.Int ), baseFee )
329+
328330 // block location fields
329331 rs [i ].BlockHash = hash
330332 rs [i ].BlockNumber = new (big.Int ).SetUint64 (number )
@@ -335,13 +337,17 @@ func (rs Receipts) DeriveFields(config *params.ChainConfig, hash common.Hash, nu
335337 // Deriving the signer is expensive, only do if it's actually needed
336338 from , _ := Sender (signer , txs [i ])
337339 rs [i ].ContractAddress = crypto .CreateAddress (from , txs [i ].Nonce ())
340+ } else {
341+ rs [i ].ContractAddress = common.Address {}
338342 }
343+
339344 // The used gas can be calculated based on previous r
340345 if i == 0 {
341346 rs [i ].GasUsed = rs [i ].CumulativeGasUsed
342347 } else {
343348 rs [i ].GasUsed = rs [i ].CumulativeGasUsed - rs [i - 1 ].CumulativeGasUsed
344349 }
350+
345351 // The derived log fields can simply be set from the block and transaction
346352 for j := 0 ; j < len (rs [i ].Logs ); j ++ {
347353 rs [i ].Logs [j ].BlockNumber = number
0 commit comments