Skip to content

feat: electra container and ssz support #1400

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

Merged
merged 14 commits into from
Apr 2, 2025

Conversation

rodrigo-o
Copy link
Collaborator

@rodrigo-o rodrigo-o commented Mar 21, 2025

Motivation

This PR adds all new containers and modify the already existing one with the new electra spec

Description

To be able to add new types we need to add them in 2 different places, one in the elixir code and another one in the ssz_nif crate. Also, apart from the container implementations we needed to add the constants and preset to be able to configure them.

This PR address an issue that happened on all spec-test outside of the general suite, where everyone failed with OffsetSkipsVariableBytes (#1405). Now, all those fail with different issues which enables us to tackle them separately.

Also after finding out that the config/preset in the rust ssz_nif is fixed instead of taking from a yaml (as done in elixir) I created an issue for reworking it, this is something that is too error prone to maintain as it is but probably something to tackle after the electra implementation: #1402

We also fixed a couple of small ssz issues spread around, one was related to an incorrect mapping of the "0x" literal string (#1398) and another one that happened specificaly in the random test suite (#1403).

Next Steps

Before star tackling specific electra task we might want to tackle #1407 & #1408 to make sure all our unit test still run before starting to tackle the logic of the electra additions. We also want to make sure both Docker and kurtosis work as expected #1412 and at least have a simple version of assertoor in place #1413 although it probably is not complete until the actual fork updates are made to the code.

Closes #1405 & #1403 & #1398

@rodrigo-o rodrigo-o changed the title Electra container and ssz support feat: electra container and ssz support Mar 21, 2025
@rodrigo-o rodrigo-o marked this pull request as ready for review March 27, 2025 15:08
@rodrigo-o rodrigo-o requested a review from a team as a code owner March 27, 2025 15:08
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was needed to be replaced by one of the current electra spec-test

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change reduce our unit test failures from 13 to 4

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an issue tracking the still failing test: #1408

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to check for this one, it's not exactly as the previous one and the test related to it still fail. I'll create an issue for this specific error

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: #1407

@@ -35,7 +35,7 @@ defmodule SpecTestUtils do
end

def sanitize_yaml({k, v}), do: {String.to_atom(k), sanitize_yaml(v)}
def sanitize_yaml("0x"), do: <<0>>
def sanitize_yaml("0x"), do: []
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the root cause of #1398, "0x" represent the empty byte array, i.e. [], not [0] as previously mapped. Here is the specific spec section

Copy link
Contributor

@ElFantasma ElFantasma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good. Left only a comment regarding a type name

@rodrigo-o rodrigo-o merged commit aaa5500 into electra-support Apr 2, 2025
8 of 14 checks passed
@rodrigo-o rodrigo-o deleted the electra-container-and-ssz-support branch April 2, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants