new(tests): Add EIP-6110 Sepolia Variant Contract test#1280
Conversation
danceratopz
left a comment
There was a problem hiding this comment.
LGTM, confirmed locally via hive that these clients fail this test as expected:
- client: besu
nametag: sepolia
build_args:
baseimage: hyperledger/besu
tag: 25.2.1
- client: go-ethereum
nametag: sepolia
build_args:
baseimage: ethereum/client-go
tag: v1.15.3
- client: nethermind
nametag: sepolia
build_args:
baseimage: nethermind/nethermind
tag: 1.31.2
- client: reth
nametag: sepolia
build_args:
baseimage: ghcr.io/paradigmxyz/reth
tag: v1.2.1
| return ( | ||
| b"\0" * (192) | ||
| + self.pubkey | ||
| + b"\0" * (48) | ||
| + self.withdrawal_credentials | ||
| + b"\0" * (32) | ||
| + (self.amount).to_bytes(8, byteorder="little") | ||
| + b"\0" * (56) | ||
| + self.signature | ||
| + b"\0" * (32) | ||
| + (self.index).to_bytes(8, byteorder="little") | ||
| + b"\0" * (24) | ||
| ) |
There was a problem hiding this comment.
How about creating an empty bytearray and writing the relevant data where it's expected? Something like:
| return ( | |
| b"\0" * (192) | |
| + self.pubkey | |
| + b"\0" * (48) | |
| + self.withdrawal_credentials | |
| + b"\0" * (32) | |
| + (self.amount).to_bytes(8, byteorder="little") | |
| + b"\0" * (56) | |
| + self.signature | |
| + b"\0" * (32) | |
| + (self.index).to_bytes(8, byteorder="little") | |
| + b"\0" * (24) | |
| ) | |
| data = bytearray(..) | |
| data[192:192+48] = self.pubkey | |
| ... | |
| return bytes(data) |
|
I believe this test should be expanded for explicit coverage of the Sepolia case (this is now somewhat hardcoded) Sepolia contract address: https://sepolia.etherscan.io/address/0x7f02c3e3c98b133055b8b348b2ac625669ed295d
Sepolia solidity source: https://github.com/protolambda/testnet-dep-contract/blob/master/deposit_contract.sol Sepolia create deposit contract tx: https://sepolia.etherscan.io/tx/0x025ecbf81a2f1220da6285d1701dc89fb5a956b62562ee922e1a9efd73eb4b14 (this has the deployment code which is necessary for the storage setup. Cannot use mainnet defaults because need to also setup the ERC20 token balance). For this, I believe the only state diff with mainnet prestate is this: This inits I believe if you use the raw data of above's tx then it should give the sender the For test cases, these things come to mind:
For reference this is the deployment bytecode of the sepolia deposit contract as taken from https://sepolia.etherscan.io/tx/0x025ecbf81a2f1220da6285d1701dc89fb5a956b62562ee922e1a9efd73eb4b14: |
d7c1e49 to
a397684
Compare
|
have you tried generating the test locally? |
|
Superseded by #1371 |
🗒️ Description
Creates a test that replaces the mainnet contract with the Sepolia variant.
🔗 Related Issues
✅ Checklist
mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.