Skip to content

Commit

Permalink
Rename receipt to avoid duplicate meaning of LegacyReceipt
Browse files Browse the repository at this point in the history
  • Loading branch information
etan-status committed Nov 6, 2023
1 parent 559596b commit 535e62e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions EIPS/eip-2718.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ This makes it so we do not have to worry about signatures for one transaction ty
### Receipts

Check failure on line 39 in EIPS/eip-2718.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Receipts"]

EIPS/eip-2718.md:39 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Receipts"]

Check failure on line 39 in EIPS/eip-2718.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Receipts"]

EIPS/eip-2718.md:39 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Receipts"]
As of `FORK_BLOCK_NUMBER`, the receipt root in the block header **MUST** be the root hash of `patriciaTrie(rlp(Index) => Receipt)` where:
* `Index` is the index in the block of the transaction this receipt is for

Check failure on line 41 in EIPS/eip-2718.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "* `Index` is the index in the ..."]

EIPS/eip-2718.md:41 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "* `Index` is the index in the ..."]

Check failure on line 41 in EIPS/eip-2718.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "* `Index` is the index in the ..."]

EIPS/eip-2718.md:41 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "* `Index` is the index in the ..."]
* `Receipt` is either `TransactionType || ReceiptPayload` or `LegacyReceipt`
* `Receipt` is either `TransactionType || ReceiptPayload` or `HomesteadReceipt`
* `TransactionType` is a positive unsigned 8-bit number between `0` and `0x7f` that represents the type of the transaction
* `ReceiptPayload` is an opaque byte array whose interpretation is dependent on the `TransactionType` and defined in future EIPs
* `LegacyReceipt` is `rlp([status, cumulativeGasUsed, logsBloom, logs])`
* `HomesteadReceipt` is `rlp([status, cumulativeGasUsed, logsBloom, logs])`

The `TransactionType` of the receipt **MUST** match the `TransactionType` of the transaction with a matching `Index`.

Expand Down
6 changes: 3 additions & 3 deletions EIPS/eip-2976.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ All changes specified below apply to all protocol/versions retroactively.
* `LegacyTransaction` is an array of the form `[nonce, gasPrice, gasLimit, to, value, data, v, r, s]`
* `LegacyTransactionHash` is `keccak256(rlp(LegacyTransaction))`
* `TransactionId` is `keccak256(TypedTransactionHash | LegacyTransactionHash)`
* `Receipt` is either `TypedReceipt` or `LegacyReceipt`
* `Receipt` is either `TypedReceipt` or `HomesteadReceipt`
* `TypedReceipt` is a byte array containing `TransactionType || ReceiptPayload`
* `ReceiptPayload` is an opaque byte array whose interpretation is dependent on the `TransactionType` and defined in future EIPs
* `LegacyReceipt` is an array of the form `[status, cumulativeGasUsed, logsBloom, logs]`
* `LegacyReceiptHash` is `keccak256(rlp(LegacyReceipt))`
* `HomesteadReceipt` is an array of the form `[status, cumulativeGasUsed, logsBloom, logs]`
* `LegacyReceiptHash` is `keccak256(rlp(HomesteadReceipt))`

### Protocol Behavior
If a client receives a `TransactionType` it doesn't recognize via any message, it **SHOULD** disconnect the peer that sent it.
Expand Down
4 changes: 2 additions & 2 deletions EIPS/eip-6493.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class Receipt(StableContainer[MAX_RECEIPT_FIELDS]):
Valid receipt types can be defined using [EIP-7495](./eip-7495.md) `Variant`.

```python
class LegacyReceipt(Variant[Receipt]):
class HomesteadReceipt(Variant[Receipt]):
root: Hash32
gas_used: uint64
contract_address: Optional[ExecutionAddress]
Expand All @@ -425,7 +425,7 @@ class AnyReceipt(OneOf[Receipt]):
if value.status is not None:
return BasicReceipt

return LegacyReceipt
return HomesteadReceipt
```

Future specifications MAY:
Expand Down
2 changes: 1 addition & 1 deletion assets/eip-6493/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def upgrade_rlp_receipt_to_ssz(pre_bytes: bytes,
)

root = pre.post_state_or_status
return LegacyReceipt(
return HomesteadReceipt(
root=root,
gas_used=pre.cumulative_gas_used - prev_cumulative_gas_used,
contract_address=compute_contract_address(
Expand Down
4 changes: 2 additions & 2 deletions assets/eip-6493/ssz_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class Receipt(StableContainer[MAX_RECEIPT_FIELDS]):
# EIP-658
status: Optional[boolean]

class LegacyReceipt(Variant[Receipt]):
class HomesteadReceipt(Variant[Receipt]):
root: Hash32
gas_used: uint64
contract_address: Optional[ExecutionAddress]
Expand All @@ -306,4 +306,4 @@ def select_variant(cls, value: Receipt) -> Type[Receipt]:
if value.status is not None:
return BasicReceipt

return LegacyReceipt
return HomesteadReceipt

0 comments on commit 535e62e

Please sign in to comment.