Skip to content

Commit

Permalink
Move EIP-6110 to Prague (#531)
Browse files Browse the repository at this point in the history
* Init Prague with 6110

* Remove 6110 experiement spec

* Add 7002 spec

* clean up

* update table of contents

* Rebase change

* Update payload.yaml

* Minor update

* Typo

* Update src/engine/prague.md

Co-authored-by: Mikhail Kalinin <[email protected]>

* Update src/engine/prague.md

Co-authored-by: Mikhail Kalinin <[email protected]>

* fix typo

---------

Co-authored-by: Mikhail Kalinin <[email protected]>
Co-authored-by: lightclient <[email protected]>
  • Loading branch information
3 people authored Mar 21, 2024
1 parent 61cc0e4 commit 90a46e9
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 106 deletions.
103 changes: 0 additions & 103 deletions src/engine/experimental/eip6110.md

This file was deleted.

22 changes: 22 additions & 0 deletions src/engine/openrpc/methods/payload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,17 @@
amount: '0x1'
blobGasUsed: '0x0'
excessBlobGas: '0x0'
depositReceipts:
- pubkey: '0x96a96086cff07df17668f35f7418ef8798079167e3f4f9b72ecde17b28226137cf454ab1dd20ef5d924786ab3483c2f9'
withdrawalCredentials: '0x003f5102dabe0a27b1746098d1dc17a5d3fbd478759fea9287e4e419b3c3cef2'
amount: '0x1'
signature: '0xb1acdb2c4d3df3f1b8d3bfd33421660df358d84d78d16c4603551935f4b67643373e7eb63dcb16ec359be0ec41fee33b03a16e80745f2374ff1d3c352508ac5d857c6476d3c3bcf7e6ca37427c9209f17be3af5264c0e2132b3dd1156c28b4e9'
index: '0xf0'
- pubkey: '0xa5c85a60ba2905c215f6a12872e62b1ee037051364244043a5f639aa81b04a204c55e7cc851f29c7c183be253ea1510b'
withdrawalCredentials: '0x001db70c485b6264692f26b8aeaab5b0c384180df8e2184a21a808a3ec8e86ca'
amount: '0x1'
signature: '0x9561731785b48cf1886412234531e4940064584463e96ac63a1a154320227e333fb51addc4a89b7e0d3f862d7c1fd4ea03bd8eb3d8806f1e7daf591cbbbb92b0beb74d13c01617f22c5026b4f9f9f294a8a7c32db895de3b01bee0132c9209e1'
index: '0xf1'
exits:
- sourceAddress: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b'
validatorPublicKey: '0x85103a5617937691dfeeb89b86a80d5dc9e3c9d3a1a0e7ce311e26e0bb732eabaa47ffa288f0d54de28209a62a7d29d0'
Expand Down Expand Up @@ -529,6 +540,17 @@
amount: '0x1'
blobGasUsed: '0x60000'
excessBlobGas: '0x0'
depositReceipts:
- pubkey: '0x96a96086cff07df17668f35f7418ef8798079167e3f4f9b72ecde17b28226137cf454ab1dd20ef5d924786ab3483c2f9'
withdrawalCredentials: '0x003f5102dabe0a27b1746098d1dc17a5d3fbd478759fea9287e4e419b3c3cef2'
amount: '0x1'
signature: '0xb1acdb2c4d3df3f1b8d3bfd33421660df358d84d78d16c4603551935f4b67643373e7eb63dcb16ec359be0ec41fee33b03a16e80745f2374ff1d3c352508ac5d857c6476d3c3bcf7e6ca37427c9209f17be3af5264c0e2132b3dd1156c28b4e9'
index: '0xf0'
- pubkey: '0xa5c85a60ba2905c215f6a12872e62b1ee037051364244043a5f639aa81b04a204c55e7cc851f29c7c183be253ea1510b'
withdrawalCredentials: '0x001db70c485b6264692f26b8aeaab5b0c384180df8e2184a21a808a3ec8e86ca'
amount: '0x1'
signature: '0x9561731785b48cf1886412234531e4940064584463e96ac63a1a154320227e333fb51addc4a89b7e0d3f862d7c1fd4ea03bd8eb3d8806f1e7daf591cbbbb92b0beb74d13c01617f22c5026b4f9f9f294a8a7c32db895de3b01bee0132c9209e1'
index: '0xf1'
exits:
- sourceAddress: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b'
validatorPublicKey: '0x85103a5617937691dfeeb89b86a80d5dc9e3c9d3a1a0e7ce311e26e0bb732eabaa47ffa288f0d54de28209a62a7d29d0'
Expand Down
31 changes: 31 additions & 0 deletions src/engine/openrpc/schemas/payload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ ExecutionPayloadV4:
- withdrawals
- blobGasUsed
- excessBlobGas
- depositReceipts
- exits
properties:
parentHash:
Expand Down Expand Up @@ -300,6 +301,11 @@ ExecutionPayloadV4:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/blobGasUsed'
excessBlobGas:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/excessBlobGas'
depositReceipts:
title: Deposit receipts
type: array
items:
$ref: '#/components/schemas/DepositReceiptV1'
exits:
title: Exits
type: array
Expand Down Expand Up @@ -343,6 +349,31 @@ BlobsBundleV1:
type: array
items:
$ref: '#/components/schemas/bytes'
DepositReceiptV1:
title: Deposit receipt object V1
type: object
required:
- pubkey
- withdrawalCredentials
- amount
- signature
- index
properties:
pubkey:
title: Public key
$ref: '#/components/schemas/bytes48'
withdrawalCredentials:
title: Withdrawal credentials
$ref: '#/components/schemas/bytes32'
amount:
title: Deposit amount
$ref: '#/components/schemas/uint64'
signature:
title: Deposit signature
$ref: '#/components/schemas/bytes96'
index:
title: Deposit index
$ref: '#/components/schemas/uint64'
ExitV1:
title: Exit object V1
type: object
Expand Down
37 changes: 34 additions & 3 deletions src/engine/prague.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This specification is based on and extends [Engine API - Cancun](./cancun.md) sp
- [Engine API -- Prague](#engine-api----prague)
- [Table of contents](#table-of-contents)
- [Structures](#structures)
- [DepositReceiptV1](#depositreceiptv1)
- [ExitV1](#exitv1)
- [ExecutionPayloadV4](#executionpayloadv4)
- [Methods](#methods)
Expand All @@ -28,6 +29,18 @@ This specification is based on and extends [Engine API - Cancun](./cancun.md) sp

## Structures

### DepositReceiptV1
This structure maps onto the deposit object from [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110).
The fields are encoded as follows:

- `pubkey`: `DATA`, 48 Bytes
- `withdrawalCredentials`: `DATA`, 32 Bytes
- `amount`: `QUANTITY`, 64 Bits
- `signature`: `DATA`, 96 Bytes
- `index`: `QUANTITY`, 64 Bits

*Note:* The `amount` value is represented in Gwei.

### ExitV1

This structure represents an execution layer triggered exit operation.
Expand All @@ -38,7 +51,7 @@ The fields are encoded as follows:

### ExecutionPayloadV4

This structure has the syntax of [`ExecutionPayloadV3`](./cancun.md#executionpayloadv3) and appends the new field: `exits`.
This structure has the syntax of [`ExecutionPayloadV3`](./cancun.md#executionpayloadv3) and appends the new fields: `depositReceipts` and `exits`.

- `parentHash`: `DATA`, 32 Bytes
- `feeRecipient`: `DATA`, 20 Bytes
Expand All @@ -57,6 +70,7 @@ This structure has the syntax of [`ExecutionPayloadV3`](./cancun.md#executionpay
- `withdrawals`: `Array of WithdrawalV1` - Array of withdrawals, each object is an `OBJECT` containing the fields of a `WithdrawalV1` structure.
- `blobGasUsed`: `QUANTITY`, 64 Bits
- `excessBlobGas`: `QUANTITY`, 64 Bits
- `depositReceipts`: `Array of DepositReceiptV1` - Array of deposits, each object is an `OBJECT` containing the fields of a `DepositReceiptV1` structure.
- `exits`: `Array of ExitV1` - Array of exits, each object is an `OBJECT` containing the fields of a `ExitV1` structure.

## Methods
Expand All @@ -79,7 +93,9 @@ Refer to the response for [`engine_newPayloadV3`](./cancun.md#engine_newpayloadv

#### Specification

This method follows the same specification as [`engine_newPayloadV3`](./cancun.md#engine_newpayloadv3).
This method follows the same specification as [`engine_newPayloadV3`](./cancun.md#engine_newpayloadv3) with the following changes:

1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of the payload does not fall within the time frame of the Prague fork.

### engine_getPayloadV4

Expand All @@ -103,4 +119,19 @@ The response of this method is updated with [`ExecutionPayloadV4`](#ExecutionPay

#### Specification

Refer to the specification for [`engine_getPayloadV3`](./cancun.md#engine_getpayloadv3).
This method follows the same specification as [`engine_getPayloadV3`](./cancun.md#engine_getpayloadv3) with the following changes:

1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of the built payload does not fall within the time frame of the Prague fork.

### Update the methods of previous forks

This document defines how Prague payload should be handled by the [`Cancun API`](./cancun.md).

For the following methods:

- [`engine_newPayloadV3`](./cancun.md#engine_newpayloadV3)
- [`engine_getPayloadV3`](./cancun.md#engine_getpayloadv3)

a validation **MUST** be added:

1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of payload or payloadAttributes greater or equal to the Prague activation timestamp.
4 changes: 4 additions & 0 deletions src/schemas/base-types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ bytes48:
title: 48 hex encoded bytes
type: string
pattern: ^0x[0-9a-f]{96}$
bytes96:
title: 96 hex encoded bytes
type: string
pattern: ^0x[0-9a-f]{192}$
bytes256:
title: 256 hex encoded bytes
type: string
Expand Down
1 change: 1 addition & 0 deletions wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ src
https
forkchoiceupdatedresponsev
exitv
depositreceiptv

0 comments on commit 90a46e9

Please sign in to comment.