Skip to content
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

Differences between official spec document and eth2spec 1.1.10 library #3935

Open
GyeongMinDan opened this issue Sep 20, 2024 · 3 comments
Open

Comments

@GyeongMinDan
Copy link

GyeongMinDan commented Sep 20, 2024

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.
mainnet beaconblock body

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.
beaconstate error

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.
withdrawal errors

Although ValidatorIndex is specified in the official spec, it is not implemented in eth2spec capella mainnet.py.

===========================================================================

Thank you! 🙂
Have a good day! 😊

@GyeongMinDan GyeongMinDan changed the title Differences between official spec document and eth2spec 1.1.10 Differences between official spec document and eth2spec 1.1.10 library Sep 20, 2024
@jtraglia
Copy link
Member

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.

@GyeongMinDan
Copy link
Author

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! 😊

@jtraglia
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants