-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new(tests): Add EIP-6110 Sepolia Variant Contract test #1280
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
ποΈ Description
Creates a test that replaces the mainnet contract with the Sepolia variant.
π Related Issues
β Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.