You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: simulators/ethereum/engine/suites/withdrawals/README.md
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,16 @@ This test suite verifies behavior of the Engine API on each client after the Sha
6
6
## Shanghai Fork
7
7
- Genesis Shanghai: Tests the withdrawals fork happening since genesis (e.g. on a testnet).
8
8
- Shanghai Fork on Block 1: Tests the withdrawals fork happening directly after genesis.
9
-
- Shanghai Fork on Block 2: Tests the transition to the withdrawals fork after a single block has happened. Block 1 is sent with invalid non-null withdrawals payload and client is expected to respond with the appropriate error.
10
-
- Shanghai Fork on Block 3: Tests the transition to the withdrawals fork after two blocks have happened. Block 2 is sent with invalid non-null withdrawals payload (both in `engine_newPayloadV2` and the attributes of `engine_forkchoiceUpdatedV2`) and client is expected to respond with the appropriate error.
9
+
- Shanghai Fork on Block 2: Tests the transition to the withdrawals fork after a single block has happened. Block 1 is used to send invalid non-null withdrawals payload.
10
+
- Shanghai Fork on Block 3: Tests the transition to the withdrawals fork after two blocks have happened. Block 1 and 2 are used to send invalid non-null withdrawals payload.
11
+
12
+
All test cases contain following verifications:
13
+
- Verify client responds with error -32602 on the following scenarios:
14
+
- Send `ExecutionPayloadV2` using a custom valid (correct BlockHash) execution payload that includes an empty array for withdrawals on `timestamp < SHANGHAI_TIMESTAMP` using `engine_newPayloadV2`
15
+
- Send `PayloadAttributesV2` using an empty array for withdrawals on `timestamp < SHANGHAI_TIMESTAMP` using `engine_forkchoiceUpdatedV2`
16
+
- Send `ExecutionPayloadV1` using a custom valid (correct BlockHash) execution payload that includes `null` as withdrawals on `timestamp >= SHANGHAI_TIMESTAMP` using `engine_newPayloadV2`
17
+
- Send `PayloadAttributesV2` using `null` for withdrawals on `timestamp < SHANGHAI_TIMESTAMP` using `engine_forkchoiceUpdatedV2`
18
+
- Use `engine_forkchoiceUpdatedV2` and `engine_newPayloadV2` to send pre-Shanghai payloads/payload attributes, and verify method call succeeds.
11
19
12
20
## Withdrawals
13
21
- Withdraw to a single account: Make multiple withdrawals to a single account.
@@ -16,6 +24,11 @@ This test suite verifies behavior of the Engine API on each client after the Sha
16
24
- Withdraw zero amount: Make multiple withdrawals where the amount withdrawn is 0.
17
25
- Empty Withdrawals: Produce withdrawals block with zero withdrawals.
18
26
27
+
All test cases contain the following verifications:
28
+
- Verify all withdrawal amounts (sent in Gwei) correctly translate to a wei balance increase in the execution client (after the payload has been set as head using `engine_forkchoiceUpdatedV2`).
29
+
- Verify using `eth_getBalance` that the balance of all withdrawn accounts match the expected amount on each block of the chain and `latest`.
30
+
- Payload returned by `engine_getPayloadV2` contains the same list of withdrawals as were passed by `PayloadAttributesV2` in the `engine_forkchoiceUpdatedV2` method call.
31
+
19
32
## Sync to Shanghai
20
33
- Sync after 2 blocks - Shanghai on Block 1 - Single Withdrawal Account - No Transactions:
21
34
- Spawn a first client
@@ -151,4 +164,13 @@ This test suite verifies behavior of the Engine API on each client after the Sha
151
164
- Verify that `TxB` returns error on `eth_sendRawTransaction` and also should be absent from the transaction pool of the client
152
165
- Request a new payload from the client and verify that the payload built only includes `TxA`, and `TxB` is not included, nor the contract it could create is present in the `stateRoot`.
153
166
- Create a modified payload where `TxA` is replaced by `TxB` and send using `engine_newPayloadV2`
154
-
- Verify that `engine_newPayloadV2` returns `INVALID` nad `latestValidHash` points to the latest valid payload in the canonical chain.
167
+
- Verify that `engine_newPayloadV2` returns `INVALID` nad `latestValidHash` points to the latest valid payload in the canonical chain.
168
+
169
+
## Block Value Tests
170
+
- Block Value on GetPayloadV2 Post-Shanghai
171
+
- Create a Shanghai chain where the fork transition happens at block 1
172
+
- Send transactions, submit forkchoice and get payload built
173
+
- Verify transactions were included in payload created
174
+
- Set forkchoice head to the new payload
175
+
- Calculate the block value by requesting the transaction receipts
176
+
- Verify that the `blockValue` returned by `engine_getPayloadV2` matches the expected calculated value
t.Fatalf("FAIL (%s): Incorrect list of withdrawals on built payload: want=%d, got=%d", t.TestName, len(sentList), len(t.CLMock.LatestPayloadBuilt.Withdrawals))
0 commit comments