Skip to content

Commit

Permalink
use empty byte array instead of all zeros for receipt poststate (#3449)
Browse files Browse the repository at this point in the history
  • Loading branch information
tclemos authored Mar 11, 2024
1 parent 76cf00f commit b184e2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jsonrpc/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ func NewReceipt(tx types.Transaction, r *types.Receipt, l2Hash *common.Hash) (Re
Type: ArgUint64(r.Type),
TxL2Hash: l2Hash,
}
if common.BytesToHash(r.PostState).String() != state.ZeroHash.String() {
if len(r.PostState) > 0 {
root := common.BytesToHash(r.PostState)
receipt.Root = &root
}
Expand Down
2 changes: 1 addition & 1 deletion state/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func GenerateReceipt(blockNumber *big.Int, processedTx *ProcessTransactionRespon
receipt.PostState = processedTx.StateRoot.Bytes()
receipt.CumulativeGasUsed = processedTx.GasUsed
} else {
receipt.PostState = ZeroHash.Bytes()
receipt.PostState = []byte{}
receipt.CumulativeGasUsed = processedTx.CumulativeGasUsed
}
if processedTx.EffectiveGasPrice != "" {
Expand Down

0 comments on commit b184e2b

Please sign in to comment.