Skip to content

Conversation

@terencechain
Copy link
Collaborator

This PR introduces explicit slot component timing configs by adding SlotDurationMilliseconds plus new basis-point deadlines (*_BPS) to config/params and added validator-side helpers (wait_helpers.go) that translate configured basis points into concrete deadlines; attestation, aggregation, sync messages, and contribution submissions now go through these helpers and expose distinct tracing spans

Reference: ethereum/consensus-specs#4476

@terencechain terencechain force-pushed the new-timing-configs branch 5 times, most recently from 1879fec to a05f0c7 Compare November 8, 2025 04:49
Comment on lines +770 to +773
// SlotComponentDuration returns the duration representing the given portion (in basis points) of a slot.
func (b *BeaconChainConfig) SlotComponentDuration(bp primitives.BP) time.Duration {
ms := uint64(bp) * b.SlotDurationMillis() / uint64(BasisPoints)
return time.Duration(ms) * time.Millisecond
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 a duplicate of ComponentDuration in time/slots/slottime.go.
maybe we can remove that one.

"AGGREGATE_DUE_BPS",
"AGGREGATE_DUE_BPS_GLOAS",
"ATTESTATION_DEADLINE",
"ATTESTATION_DUE_BPS",
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be added to assertEqualConfigs()? (SyncMessageDueBPS is there)

same for CONTRIBUTION_DUE_BPS and PROPOSER_REORG_CUTOFF_BPS

Comment on lines 120 to 126
ProposerReorgCutoffBPS: primitives.BP(1667),
AttestationDueBPS: primitives.BP(3333),
AggregrateDueBPS: primitives.BP(6667),

SyncMessageDueBPS: primitives.BP(3333),
ContributionDueBPS: primitives.BP(6667),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ProposerReorgCutoffBPS: primitives.BP(1667),
AttestationDueBPS: primitives.BP(3333),
AggregrateDueBPS: primitives.BP(6667),
SyncMessageDueBPS: primitives.BP(3333),
ContributionDueBPS: primitives.BP(6667),
ProposerReorgCutoffBPS: primitives.BP(1667),
AttestationDueBPS: primitives.BP(3333),
AggregrateDueBPS: primitives.BP(6667),
SyncMessageDueBPS: primitives.BP(3333),
ContributionDueBPS: primitives.BP(6667),

if the last two don't belong here in Fork choice algorithm constants, we should move them to another group.
maybe it's also a good idea to move all of these to a new Time parameters group since there is more stuff coming in gloas.

func TestFilterSubnetPeers(t *testing.T) {
params.SetupTestConfigCleanup(t)
cfg := params.MainnetConfig()
cfg.SecondsPerSlot = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cfg.SecondsPerSlot = 1

Comment on lines 66 to 69
func TestWaitUntilSlotComponent_ContextCancelReturnsImmediately(t *testing.T) {
params.SetupTestConfigCleanup(t)
cfg := params.BeaconConfig().Copy()
cfg.SlotDurationMilliseconds = 10
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you meant 10000 ms here? because otherwise the waiting time for function return (2s) is much longer than the attestation deadline of the slot (3ms).
so the waitUntilSlotComponent() will always return under 2s, regardless of context cancellation.

@terencechain terencechain added this pull request to the merge queue Nov 13, 2025
Merged via the queue into develop with commit f77b789 Nov 13, 2025
17 checks passed
@terencechain terencechain deleted the new-timing-configs branch November 13, 2025 22:20
Muzry pushed a commit to Muzry/prysm that referenced this pull request Nov 14, 2025
* Use new timing configs (due BPS)

* Bastin's feedback
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.

3 participants