ethereum / ethereum/execution-specs

chore(tests): test contains non-monotonic withdrawal indices specified in subsequent withdrawals within one block

Open
#1,471 1 comment 0 reactions 0 assignees View on GitHub
A-test-tests C-bug help wanted P-high S-needs-discussion stale
Dominant language
Python
Stars
1.2k
Forks
505
Avg merge
2d 14h
Merged PRs (30d)
116

Description

I think we should ensure that the withdrawal indices here are monotonically increasing, or the test may not be valid (we define two withdrawals with `index=0`):
https://github.com/ethereum/execution-spec-tests/blob/51d30bdd4e77199e7bddb70857fe8f5cc5475d63/tests/shanghai/eip4895_withdrawals/test_withdrawals.py#L611-L623

According to geth's [Withdrawal struct implementation](https://github.com/ethereum/go-ethereum/blob/9e018ce3a51ded8c7f43de80b658e93a1f88377c/core/types/withdrawal.go#L32), the index is a

> monotonically increasing identifier issued by consensus layer

Should a block be able to contain two withdrawals with the same index? This test also performs multiple withdrawals from the same validator index to multiple addresses, which is an unusual test case in itself (there is a 1-1 mapping between validator and withdrawal index and this can not be changed). Surely it's good to test this, but perhaps we should additionally test with more typical values, as found on the beacon chain?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.