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

eth/catalyst: set finalized block hash properly in dev mode #27886

Merged
merged 5 commits into from
Aug 21, 2023

Conversation

jwasinger
Copy link
Contributor

In dev mode, the finalized block should be the block that was produced at the start of the current epoch (block number 0, 32, 64, ...)

@jwasinger jwasinger requested a review from gballet as a code owner August 9, 2023 09:14
@fjl
Copy link
Contributor

fjl commented Aug 9, 2023

Please remove the change to the tests submodule!

@rjl493456442
Copy link
Member

but it's dev mode anyway, right? does it really matter the finalization block is at the epoch boundary or not?

@jwasinger
Copy link
Contributor Author

but it's dev mode anyway, right? does it really matter the finalization block is at the epoch boundary or not?

Honestly it probably doesn't really matter that much. But it makes dev-mode behavior somewhat more in-line with a real network.

@@ -157,14 +157,21 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal) error {
}
payload := envelope.ExecutionPayload

var finalizedHash common.Hash
if payload.Number%32 == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

perhaps define a constant for it? e.g. devEpochLength or whatever.

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Martin Holst Swende <martin@swende.se>
Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

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

LGTM
(tested it with my fuzzer today)

@holiman holiman merged commit f56ee7d into ethereum:master Aug 21, 2023
1 check passed
@holiman holiman added this to the 1.13.0 milestone Aug 21, 2023
@jwasinger jwasinger deleted the dev-mode-finalized-block-hash branch August 21, 2023 17:34
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
…#27886)



Co-authored-by: Martin Holst Swende <martin@swende.se>
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
sduchesneau pushed a commit to streamingfast/go-ethereum that referenced this pull request Jan 4, 2024
…#27886)

Co-authored-by: Martin Holst Swende <martin@swende.se>
(cherry picked from commit f56ee7d)
sduchesneau pushed a commit to streamingfast/go-ethereum that referenced this pull request Feb 26, 2024
 Conflicts:
  eth/catalyst/simulated_beacon.go

The PR changes simulated beacon. Took upstream version as-is.
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.

5 participants