Skip to content

Add support for electra fork epoch#15132

Merged
terencechain merged 8 commits into
developfrom
electra-fork-epoch
Apr 11, 2025
Merged

Add support for electra fork epoch#15132
terencechain merged 8 commits into
developfrom
electra-fork-epoch

Conversation

@terencechain
Copy link
Copy Markdown
Collaborator

@terencechain terencechain commented Apr 4, 2025

@terencechain terencechain marked this pull request as ready for review April 10, 2025 02:48
@terencechain terencechain force-pushed the electra-fork-epoch branch 2 times, most recently from 19367ae to 2904700 Compare April 10, 2025 03:02
@terencechain terencechain force-pushed the electra-fork-epoch branch 3 times, most recently from 3b9159d to 515c225 Compare April 10, 2025 14:04
params.SetupTestConfigCleanup(t)
config := params.BeaconConfig()
config.DenebForkEpoch = 0
config.ElectraForkEpoch = math.MaxUint64
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unsetting electra fork seems like the wrong approach. Why is this the fix for this test?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

SetupTestConfigCleanup backs up the config struct and sets up a t.Cleanup hook so that the original is restored after the test runs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(Preston's question is still worthwhile, just pointing out that this test helper limits the scope of config changes to the test)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think the test setup is generally broken. It doesn't work properly with the Electra fork, it uses a slot that’s already past the mainnet-defined Electra fork epoch—probably because it treated the Unix timestamp as the genesis time. Not sure if it’s worth going through all the unit tests and fixing the setup right now, but we could handle that in a separate PR. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should have the correct fix, can't we just change the slot to one that is between deneb and electra rather than unsetting electra?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i've been doing something similar i just add another defer params.SetupTestConfigCleanup(t) at the end
I think this is a bigger issue on how configs are used in our system like terence said. I think both ways should be fine for now as this will take much more to correctly fix

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i've been doing something similar i just add another defer params.SetupTestConfigCleanup(t) at the end

@james-prysm Do you have an example of this? I want to make sure this is being used correctly - calling it at the end of a test isn't going to protect the config from being mutated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought adding it would make it so that the next test would not need to add the cleanup at the top
#15161

Comment thread config/params/config_test.go Outdated
@prestonvanloon
Copy link
Copy Markdown
Member

Tests fail

james-prysm
james-prysm previously approved these changes Apr 10, 2025
@james-prysm james-prysm dismissed their stale review April 10, 2025 19:27

broken test

@terencechain terencechain added this pull request to the merge queue Apr 11, 2025
Merged via the queue into develop with commit 679a0c9 Apr 11, 2025
15 checks passed
@terencechain terencechain deleted the electra-fork-epoch branch April 11, 2025 02:10
fernantho pushed a commit to fernantho/prysm that referenced this pull request Sep 26, 2025
* Add support for electra fork epoch

* Fix tests

* fixing tests without needing to override electra fork config

* reverting electra fork override on blob test too, replacing with custom timefetcher

* reverting old changelog

* Fix genesis time

* Move mainnet test into mainnet_config_test.go

* Update spec test to v1.5.0-beta.5

---------

Co-authored-by: james-prysm <[email protected]>
Co-authored-by: Preston Van Loon <[email protected]>
fernantho pushed a commit to fernantho/prysm that referenced this pull request Sep 26, 2025
* Add support for electra fork epoch

* Fix tests

* fixing tests without needing to override electra fork config

* reverting electra fork override on blob test too, replacing with custom timefetcher

* reverting old changelog

* Fix genesis time

* Move mainnet test into mainnet_config_test.go

* Update spec test to v1.5.0-beta.5

---------

Co-authored-by: james-prysm <[email protected]>
Co-authored-by: Preston Van Loon <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants