Skip to content

Conversation

@gfukushima
Copy link
Contributor

@gfukushima gfukushima commented May 30, 2025

PR Description

Implementation of ethereum/consensus-specs#4190

Fixed Issue(s)

fixes #9378

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

gfukushima added 30 commits May 21, 2025 13:21
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
…tle different as we cna't get the slot from the state

Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
# Conflicts:
#	ethereum/spec/src/main/java/tech/pegasys/teku/spec/schemas/registry/SchemaRegistryBuilder.java
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
@tbenr
Copy link
Contributor

tbenr commented Jun 6, 2025

worth noting that on FULU, priming the proposerIndex doesn't make sense anymore (we don't use that transition cache anymore)

@StefanBratanov
Copy link
Contributor

worth noting that on FULU, priming the proposerIndex doesn't make sense anymore (we don't use that transition cache anymore)

good point, to be fair, but just calling that method is super quick now anyways that probably not even worth to put an if statement in my opinion

@StefanBratanov StefanBratanov enabled auto-merge (squash) June 6, 2025 09:29
Copy link
Contributor

@tbenr tbenr left a comment

Choose a reason for hiding this comment

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

I think we can YOLO this.
Just a comment

Comment on lines +43 to +56
public int getBeaconProposerIndex(final BeaconState state, final UInt64 requestedSlot) {
final int lookaheadIndex = requestedSlot.mod(configFulu.getSlotsPerEpoch()).intValue();
return BeaconStateFulu.required(state)
.getProposerLookahead()
.get(lookaheadIndex)
.get()
.intValue();
}

public List<Integer> getBeaconProposerIndices(final BeaconState state, final UInt64 epoch) {
final IntList indices = getActiveValidatorIndices(state, epoch);
final Bytes32 seed = getSeed(state, epoch, Domain.BEACON_PROPOSER);
return miscHelpers.computeProposerIndices(state, epoch, seed, indices);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this is maybe a thing for spec, but I don't like the method names here. It should be clearer which method lookups the state and which computes the indices.
So i guess getBeaconProposerIndices should be computeBeaconProposerIndices too

Copy link
Contributor

Choose a reason for hiding this comment

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

this has been automerged, lol
just want to make sure @StefanBratanov and @Gabriel-Trintinalia see this comment

Copy link

@linoscope linoscope Jun 6, 2025

Choose a reason for hiding this comment

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

Hi @tbenr ! EIP and spec coauthor here.

but I don't like the method names here. It should be clearer which method lookups the state and which computes the indices.
So i guess getBeaconProposerIndices should be computeBeaconProposerIndices too

Actually if you look at current specs some of these getX functions are already just wrappers around the corresponding computeX functions. For example, get_beacon_committee calls compute_committee (code) and pre-Fulu get_beacon_proposer_index (code) calls compute_proposer_index. So while I do understand your point that "getters" doing computation can be misleading, I would say it is already established pattern that exists in the specs.

Copy link
Contributor

@tbenr tbenr Jun 9, 2025

Choose a reason for hiding this comment

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

@linoscope I see what you mean. I was focused on specific changes. Widening the look that's consistent with the existing patterns. all good.

@StefanBratanov StefanBratanov merged commit 4632aa6 into Consensys:master Jun 6, 2025
16 checks passed
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.

[SPIKE][EIP-7917] deterministic proposer lookahead

5 participants