Differences between official spec document and eth2spec 1.1.10 library
Hi ๐. I am GyeongMin Dan. I am conducting research at the Software Security Lab at Sungkyunkwan University.
While I was developing ethereum-consensus-spec using eth2spec library(pypi) version 1.1.10. I had to report some issues because there was a difference between the official spec document and eth2spec 1.1.10.
===========================================================================
๐ ๏ธ My Development Environment
- Visual Studio Code
- Python / 3.9.0
- eth2spec / 1.1.10
- milagro_bls_bidning / 1.6.3
===========================================================================
โจ Problem
- There are a few differences -> Between ethereum-consensus-spec docs and eth2spec library(1.1.10)
===========================================================================
Spec Docs ๐ฝ
https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md
eth2spec library ๐ฝ
https://pypi.org/project/eth2spec/
These are the links I referenced during development.
===========================================================================
โIssue
In the BeaconBlockBody section in ethereum-consensus-specs > capella > beacon-chian.md
I was able to find the following part ๐ฝ
bls_to_execution_changes: List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES] # [New in Capella]
But in eth2spec > capella > mainnet.py that value did not exist.
Also, because the corresponding value did not exist, the constant values โโMAX_BLS_TO_EXECUTION_CHANGES, SignedBLSToExecutionChange, and the BLSToExecutionChange class did not exist.
However, I was able to find the corresponding constant and class values โโin the Capella spec document.
MAX_BLS_TO_EXECUTION_CHANGES | 2^4ย (= 16)
class BLSToExecutionChange(Container):
validator_index: ValidatorIndex
from_bls_pubkey: BLSPubkey
to_execution_address: ExecutionAddress
class SignedBLSToExecutionChange(Container):
message: BLSToExecutionChange
signature: BLSSignature
These constant value and two classes are not implemented in eth2spec > capella > mainnet.py
===========================================================================
โIssue
In the BeaconState section in ethereum-consensus-specs > capella > beacon-chian.md
I was able to find the following part ๐ฝ
# Withdrawals
next_withdrawal_index: WithdrawalIndex # [New in Capella]
next_withdrawal_validator_index: ValidatorIndex # [New in Capella]
# Deep history valid from Capella onwards
historical_summaries: List[HistoricalSummary, HISTORICAL_ROOTS_LIMIT] # [New in Capella]
But in eth2spec > capella > mainnet.py #Withdrawals part is implemented differently from the official spec.
In the official spec document:
# Withdrawals
next_withdrawal_index: WithdrawalIndex # [New in Capella]
next_withdrawal_validator_index: ValidatorIndex # [New in Capella]
# Deep history valid from Capella onwards
historical_summaries: List[HistoricalSummary, HISTORICAL_ROOTS_LIMIT] # [New in Capella]
In eth2spec capella mainnet.py, it is not implemented according to the document. It is implemented with the values โโwithdrawal_index and withdrawals_queue. The value of historical summaries is not implemented.
class HistoricalSummary(Container):
"""
`HistoricalSummary` matches the components of the phase0 `HistoricalBatch`
making the two hash_tree_root-compatible.
"""
block_summary_root: Root
state_summary_root: Root
This class is not implemented in eth2spec > capella > mainnet.py
===========================================================================
โIssue
In the Withdrawal section in ethereum-consensus-specs > capella > beacon-chian.md
I was able to find the following part ๐ฝ
class Withdrawal(Container):
index: WithdrawalIndex
validator_index: ValidatorIndex
address: ExecutionAddress
amount: Gwei
But in eth2spec > capella > mainnet.py ValidatorIndex fields is not implemented.
Although ValidatorIndex is specified in the official spec, it is not implemented in eth2spec capella mainnet.py.
===========================================================================
Thank you! ๐ Have a good day! ๐
Hi @GyeongMinDan, it has been a couple years since we published a new eth2spec package to PyPI. This is the reason for the differences. I'll look into publishing these again.
Hi @jtraglia, Thanks for your reply! ๐ I have one question. Before distributing a new eth2spec, may I ask what is the way to develop an ssz file suitable for ethereum Capella Version? Currently, I am using my own modified eth2spec 1.1.10 mainnet.py. Is there a better way?
Thank you!๐ Have a good day! ๐
What is the way to develop an ssz file suitable for ethereum Capella Version? Currently, I am using my own modified eth2spec 1.1.10 mainnet.py. Is there a better way?
Hey @GyeongMinDan ๐ it's been a while since I've used it but I believe zcli is what I would use.
- https://github.com/protolambda/zcli
I am closing this issue because it seems stale. Please, do not hesitate to reopen it if this is a mistake