Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions beacon-chain/core/peerdas/reconstruction_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (

// testBlobSetup holds common test data for blob reconstruction tests.
type testBlobSetup struct {
blobCount int
blobs []kzg.Blob
roBlock blocks.ROBlock
roDataColumnSidecars []blocks.RODataColumn
verifiedRoDataColumnSidecars []blocks.VerifiedRODataColumn
blobCount int
blobs []kzg.Blob
roBlock blocks.ROBlock
roDataColumnSidecars []blocks.RODataColumn
verifiedRoDataColumnSidecars []blocks.VerifiedRODataColumn
}

// setupTestBlobs creates a complete test setup with blobs, cells, proofs, and data column sidecars.
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/db/kv/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func TestEnsureEmbeddedGenesis(t *testing.T) {
params.SetupTestConfigCleanup(t)
// Embedded Genesis works with Mainnet config
cfg := params.MainnetConfig()
cfg.SecondsPerSlot = 1
cfg.SlotDurationMilliseconds = 1000
undo, err := params.SetActiveWithUndo(cfg)
require.NoError(t, err)
defer func() {
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/forkchoice/doubly-linked-tree/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (n *Node) setNodeAndParentValidated(ctx context.Context) error {
// slot will have secs = 3 below.
func (n *Node) arrivedEarly(genesis time.Time) (bool, error) {
sss, err := slots.SinceSlotStart(n.slot, genesis, n.timestamp.Truncate(time.Second)) // Truncate such that 3.9999 seconds will have a value of 3.
votingWindow := time.Duration(params.BeaconConfig().SecondsPerSlot/params.BeaconConfig().IntervalsPerSlot) * time.Second
votingWindow := params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().AttestationDueBPS)
return sss < votingWindow, err
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ func TestForkChoice_GetProposerHead(t *testing.T) {
headRoot, err := f.Head(ctx)
require.NoError(t, err)
require.Equal(t, blk.Root(), headRoot)
orphanLateBlockFirstThreshold := params.BeaconConfig().SecondsPerSlot / params.BeaconConfig().IntervalsPerSlot
f.store.headNode.timestamp.Add(-1 * time.Duration(params.BeaconConfig().SecondsPerSlot-orphanLateBlockFirstThreshold) * time.Second)
orphanLateBlockFirstThreshold := params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().AttestationDueBPS)
f.store.headNode.timestamp.Add(-1 * (params.BeaconConfig().SlotDuration() - orphanLateBlockFirstThreshold))
t.Run("head is weak", func(t *testing.T) {
require.Equal(t, parentRoot, f.GetProposerHead())
})
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/forkchoice/doubly-linked-tree/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (s *Store) insert(ctx context.Context,
if err != nil {
return nil, fmt.Errorf("could not determine time since current slot started: %w", err)
}
boostThreshold := time.Duration(params.BeaconConfig().SecondsPerSlot/params.BeaconConfig().IntervalsPerSlot) * time.Second
boostThreshold := params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().AttestationDueBPS)
isFirstBlock := s.proposerBoostRoot == [32]byte{}
if currentSlot == slot && sss < boostThreshold && isFirstBlock {
s.proposerBoostRoot = root
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/p2p/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (s *Service) BroadcastLightClientOptimisticUpdate(ctx context.Context, upda
return err
}
timeSinceSlotStart := time.Since(slotStart)
expectedDelay := slots.ComponentDuration(primitives.BP(params.BeaconConfig().SyncMessageDueBPS))
expectedDelay := params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().SyncMessageDueBPS)
if timeSinceSlotStart < expectedDelay {
waitDuration := expectedDelay - timeSinceSlotStart
<-time.After(waitDuration)
Expand Down Expand Up @@ -320,7 +320,7 @@ func (s *Service) BroadcastLightClientFinalityUpdate(ctx context.Context, update
return err
}
timeSinceSlotStart := time.Since(slotStart)
expectedDelay := slots.ComponentDuration(primitives.BP(params.BeaconConfig().SyncMessageDueBPS))
expectedDelay := params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().SyncMessageDueBPS)
if timeSinceSlotStart < expectedDelay {
waitDuration := expectedDelay - timeSinceSlotStart
<-time.After(waitDuration)
Expand Down
5 changes: 2 additions & 3 deletions beacon-chain/p2p/broadcaster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/OffchainLabs/prysm/v7/config/params"
"github.com/OffchainLabs/prysm/v7/consensus-types/blocks"
"github.com/OffchainLabs/prysm/v7/consensus-types/interfaces"
"github.com/OffchainLabs/prysm/v7/consensus-types/primitives"
"github.com/OffchainLabs/prysm/v7/consensus-types/wrapper"
"github.com/OffchainLabs/prysm/v7/encoding/bytesutil"
ethpb "github.com/OffchainLabs/prysm/v7/proto/prysm/v1alpha1"
Expand Down Expand Up @@ -598,7 +597,7 @@ func TestService_BroadcastLightClientOptimisticUpdate(t *testing.T) {

slotStartTime, err := slots.StartTime(p.genesisTime, msg.SignatureSlot())
require.NoError(t, err)
expectedDelay := slots.ComponentDuration(primitives.BP(params.BeaconConfig().SyncMessageDueBPS))
expectedDelay := params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().SyncMessageDueBPS)
if time.Now().Before(slotStartTime.Add(expectedDelay)) {
tt.Errorf("Message received too early, now %v, expected at least %v", time.Now(), slotStartTime.Add(expectedDelay))
}
Expand Down Expand Up @@ -674,7 +673,7 @@ func TestService_BroadcastLightClientFinalityUpdate(t *testing.T) {

slotStartTime, err := slots.StartTime(p.genesisTime, msg.SignatureSlot())
require.NoError(t, err)
expectedDelay := slots.ComponentDuration(primitives.BP(params.BeaconConfig().SyncMessageDueBPS))
expectedDelay := params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().SyncMessageDueBPS)
if time.Now().Before(slotStartTime.Add(expectedDelay)) {
tt.Errorf("Message received too early, now %v, expected at least %v", time.Now(), slotStartTime.Add(expectedDelay))
}
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/p2p/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func TestService_Start_NoDiscoverFlag(t *testing.T) {
beaconCfg.AltairForkEpoch = 0
beaconCfg.BellatrixForkEpoch = 0
beaconCfg.CapellaForkEpoch = 0
beaconCfg.SecondsPerSlot = 1
beaconCfg.SlotDurationMilliseconds = 1000
params.OverrideBeaconConfig(beaconCfg)

exitRoutine := make(chan bool)
Expand Down
17 changes: 16 additions & 1 deletion beacon-chain/rpc/eth/config/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func TestGetSpec(t *testing.T) {
config.ETH1AddressWithdrawalPrefixByte = byte('c')
config.GenesisDelay = 24
config.SecondsPerSlot = 25
config.SlotDurationMilliseconds = 120
config.MinAttestationInclusionDelay = 26
config.SlotsPerEpoch = 27
config.MinSeedLookahead = 28
Expand Down Expand Up @@ -129,6 +130,10 @@ func TestGetSpec(t *testing.T) {
config.ProportionalSlashingMultiplierAltair = 69
config.InactivityScoreRecoveryRate = 70
config.MinSyncCommitteeParticipants = 71
config.ProposerReorgCutoffBPS = primitives.BP(121)
config.AttestationDueBPS = primitives.BP(122)
config.AggregrateDueBPS = primitives.BP(123)
config.ContributionDueBPS = primitives.BP(124)
config.TerminalBlockHash = common.HexToHash("TerminalBlockHash")
config.TerminalBlockHashActivationEpoch = 72
config.TerminalTotalDifficulty = "73"
Expand Down Expand Up @@ -201,7 +206,7 @@ func TestGetSpec(t *testing.T) {
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), &resp))
data, ok := resp.Data.(map[string]interface{})
require.Equal(t, true, ok)
assert.Equal(t, 171, len(data))
assert.Equal(t, 176, len(data))
for k, v := range data {
t.Run(k, func(t *testing.T) {
switch k {
Expand Down Expand Up @@ -291,6 +296,8 @@ func TestGetSpec(t *testing.T) {
assert.Equal(t, "24", v)
case "SECONDS_PER_SLOT":
assert.Equal(t, "25", v)
case "SLOT_DURATION_MS":
assert.Equal(t, "120", v)
case "MIN_ATTESTATION_INCLUSION_DELAY":
assert.Equal(t, "26", v)
case "SLOTS_PER_EPOCH":
Expand Down Expand Up @@ -447,6 +454,14 @@ func TestGetSpec(t *testing.T) {
assert.Equal(t, "20", v)
case "REORG_PARENT_WEIGHT_THRESHOLD":
assert.Equal(t, "160", v)
case "PROPOSER_REORG_CUTOFF_BPS":
assert.Equal(t, "121", v)
case "ATTESTATION_DUE_BPS":
assert.Equal(t, "122", v)
case "AGGREGRATE_DUE_BPS":
assert.Equal(t, "123", v)
case "CONTRIBUTION_DUE_BPS":
assert.Equal(t, "124", v)
case "MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT":
assert.Equal(t, "8", v)
case "MAX_REQUEST_LIGHT_CLIENT_UPDATES":
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/sync/rpc_goodbye_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
func TestGoodByeRPCHandler_Disconnects_With_Peer(t *testing.T) {
params.SetupTestConfigCleanup(t)
cfg := params.MainnetConfig()
cfg.SecondsPerSlot = 1
cfg.SlotDurationMilliseconds = 1000
params.OverrideBeaconConfig(cfg)

p1 := p2ptest.NewTestP2P(t)
Expand Down
9 changes: 5 additions & 4 deletions beacon-chain/sync/subscriber_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func TestSubscribe_UnsubscribeTopic(t *testing.T) {
func TestSubscribe_ReceivesAttesterSlashing(t *testing.T) {
params.SetupTestConfigCleanup(t)
cfg := params.MainnetConfig()
cfg.SecondsPerSlot = 1
cfg.SlotDurationMilliseconds = 1000
params.OverrideBeaconConfig(cfg)

p2pService := p2ptest.NewTestP2P(t)
Expand Down Expand Up @@ -443,7 +443,7 @@ func Test_wrapAndReportValidation(t *testing.T) {
func TestFilterSubnetPeers(t *testing.T) {
params.SetupTestConfigCleanup(t)
cfg := params.MainnetConfig()
cfg.SecondsPerSlot = 1
cfg.SlotDurationMilliseconds = 1000
params.OverrideBeaconConfig(cfg)

gFlags := new(flags.GlobalFlags)
Expand All @@ -457,8 +457,9 @@ func TestFilterSubnetPeers(t *testing.T) {
currSlot := primitives.Slot(100)

gt := time.Now()
slotDuration := params.BeaconConfig().SlotDuration()
genPlus100 := func() time.Time {
return gt.Add(time.Second * time.Duration(uint64(currSlot)*params.BeaconConfig().SecondsPerSlot))
return gt.Add(time.Duration(uint64(currSlot)) * slotDuration)
}
chain := &mockChain.ChainService{
Genesis: gt,
Expand Down Expand Up @@ -525,7 +526,7 @@ func TestFilterSubnetPeers(t *testing.T) {
func TestSubscribeWithSyncSubnets_DynamicOK(t *testing.T) {
params.SetupTestConfigCleanup(t)
cfg := params.MainnetConfig()
cfg.SecondsPerSlot = 1
cfg.SlotDurationMilliseconds = 1000
params.OverrideBeaconConfig(cfg)

p := p2ptest.NewTestP2P(t)
Expand Down
5 changes: 2 additions & 3 deletions beacon-chain/sync/validate_light_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/OffchainLabs/prysm/v7/config/params"
"github.com/OffchainLabs/prysm/v7/consensus-types/interfaces"
"github.com/OffchainLabs/prysm/v7/consensus-types/primitives"
"github.com/OffchainLabs/prysm/v7/monitoring/tracing"
"github.com/OffchainLabs/prysm/v7/monitoring/tracing/trace"
"github.com/OffchainLabs/prysm/v7/time/slots"
Expand Down Expand Up @@ -60,7 +59,7 @@ func (s *Service) validateLightClientOptimisticUpdate(ctx context.Context, pid p
return pubsub.ValidationReject, nil
}
earliestValidTime := slotStart.
Add(slots.ComponentDuration(primitives.BP(params.BeaconConfig().SyncMessageDueBPS))).
Add(params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().SyncMessageDueBPS)).
Add(-params.BeaconConfig().MaximumGossipClockDisparityDuration())
if s.cfg.clock.Now().Before(earliestValidTime) {
log.Debug("Newly received light client optimistic update ignored. not enough time passed for block to propagate")
Expand Down Expand Up @@ -130,7 +129,7 @@ func (s *Service) validateLightClientFinalityUpdate(ctx context.Context, pid pee
return pubsub.ValidationReject, nil
}
earliestValidTime := slotStart.
Add(slots.ComponentDuration(primitives.BP(params.BeaconConfig().SyncMessageDueBPS))).
Add(params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().SyncMessageDueBPS)).
Add(-params.BeaconConfig().MaximumGossipClockDisparityDuration())
if s.cfg.clock.Now().Before(earliestValidTime) {
log.Debug("Newly received light client finality update ignored. not enough time passed for block to propagate")
Expand Down
6 changes: 2 additions & 4 deletions beacon-chain/sync/validate_light_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ import (
mockSync "github.com/OffchainLabs/prysm/v7/beacon-chain/sync/initial-sync/testing"
"github.com/OffchainLabs/prysm/v7/config/params"
"github.com/OffchainLabs/prysm/v7/consensus-types/interfaces"
"github.com/OffchainLabs/prysm/v7/consensus-types/primitives"
"github.com/OffchainLabs/prysm/v7/runtime/version"
"github.com/OffchainLabs/prysm/v7/testing/require"
"github.com/OffchainLabs/prysm/v7/testing/util"
"github.com/OffchainLabs/prysm/v7/time/slots"
pubsub "github.com/libp2p/go-libp2p-pubsub"
pb "github.com/libp2p/go-libp2p-pubsub/pb"
)
Expand Down Expand Up @@ -83,7 +81,7 @@ func TestValidateLightClientOptimisticUpdate(t *testing.T) {
},
{
name: "not enough time passed",
genesisDrift: -int(math.Ceil(float64(slots.ComponentDuration(primitives.BP(params.BeaconConfig().SyncMessageDueBPS))) / float64(time.Second))),
genesisDrift: -int(math.Ceil(float64(params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().SyncMessageDueBPS)) / float64(time.Second))),
oldUpdateOptions: []util.LightClientOption{},
newUpdateOptions: []util.LightClientOption{},
expectedResult: pubsub.ValidationIgnore,
Expand Down Expand Up @@ -209,7 +207,7 @@ func TestValidateLightClientFinalityUpdate(t *testing.T) {
},
{
name: "not enough time passed",
genesisDrift: -int(math.Ceil(float64(slots.ComponentDuration(primitives.BP(params.BeaconConfig().SyncMessageDueBPS))) / float64(time.Second))),
genesisDrift: -int(math.Ceil(float64(params.BeaconConfig().SlotComponentDuration(params.BeaconConfig().SyncMessageDueBPS)) / float64(time.Second))),
oldUpdateOptions: []util.LightClientOption{},
newUpdateOptions: []util.LightClientOption{},
expectedResult: pubsub.ValidationIgnore,
Expand Down
3 changes: 3 additions & 0 deletions changelog/ttsao_use-timing-configs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Changed

- Use explicit slot component timing configs
4 changes: 2 additions & 2 deletions config/params/basis_points.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "github.com/OffchainLabs/prysm/v7/consensus-types/primitives"

const BasisPoints = primitives.BP(10000)

// SlotBP returns the basis points for a given slot.
// SlotBP returns the duration of a slot expressed in milliseconds, represented as basis points of a slot.
func SlotBP() primitives.BP {
return primitives.BP(12000)
return primitives.BP(BeaconConfig().SlotDurationMillis())
}
30 changes: 27 additions & 3 deletions config/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type BeaconChainConfig struct {
GenesisDelay uint64 `yaml:"GENESIS_DELAY" spec:"true"` // GenesisDelay is the minimum number of seconds to delay starting the Ethereum Beacon Chain genesis. Must be at least 1 second.
MinAttestationInclusionDelay primitives.Slot `yaml:"MIN_ATTESTATION_INCLUSION_DELAY" spec:"true"` // MinAttestationInclusionDelay defines how many slots validator has to wait to include attestation for beacon block.
SecondsPerSlot uint64 `yaml:"SECONDS_PER_SLOT" spec:"true"` // SecondsPerSlot is how many seconds are in a single slot.
SlotDurationMilliseconds uint64 `yaml:"SLOT_DURATION_MS" spec:"true"` // SlotDurationMilliseconds is the slot time expressed in milliseconds.
SlotsPerEpoch primitives.Slot `yaml:"SLOTS_PER_EPOCH" spec:"true"` // SlotsPerEpoch is the number of slots in an epoch.
SqrRootSlotsPerEpoch primitives.Slot // SqrRootSlotsPerEpoch is a hard coded value where we take the square root of `SlotsPerEpoch` and round down.
MinSeedLookahead primitives.Epoch `yaml:"MIN_SEED_LOOKAHEAD" spec:"true"` // MinSeedLookahead is the duration of randao look ahead seed.
Expand All @@ -84,6 +85,11 @@ type BeaconChainConfig struct {
ReorgParentWeightThreshold uint64 `yaml:"REORG_PARENT_WEIGHT_THRESHOLD" spec:"true"` // ReorgParentWeightThreshold defines a value that is a % of the committee weight to consider a parent block strong and subject its child to being orphaned.
ReorgMaxEpochsSinceFinalization primitives.Epoch `yaml:"REORG_MAX_EPOCHS_SINCE_FINALIZATION" spec:"true"` // This defines a limit to consider safe to orphan a block if the network is finalizing
IntervalsPerSlot uint64 `yaml:"INTERVALS_PER_SLOT"` // IntervalsPerSlot defines the number of fork choice intervals in a slot defined in the fork choice spec.
ProposerReorgCutoffBPS primitives.BP `yaml:"PROPOSER_REORG_CUTOFF_BPS" spec:"true"` // ProposerReorgCutoffBPS defines the proposer reorg deadline in basis points of the slot.
AttestationDueBPS primitives.BP `yaml:"ATTESTATION_DUE_BPS" spec:"true"` // AttestationDueBPS defines the attestation due time in basis points of the slot.
AggregrateDueBPS primitives.BP `yaml:"AGGREGRATE_DUE_BPS" spec:"true"` // AggregrateDueBPS defines the aggregate due time in basis points of the slot.
SyncMessageDueBPS primitives.BP `yaml:"SYNC_MESSAGE_DUE_BPS" spec:"true"` // SyncMessageDueBPS defines the sync message due time in basis points of the slot.
ContributionDueBPS primitives.BP `yaml:"CONTRIBUTION_DUE_BPS" spec:"true"` // ContributionDueBPS defines the contribution due time in basis points of the slot.

// Ethereum PoW parameters.
DepositChainID uint64 `yaml:"DEPOSIT_CHAIN_ID" spec:"true"` // DepositChainID of the eth1 network. This used for replay protection.
Expand Down Expand Up @@ -221,7 +227,6 @@ type BeaconChainConfig struct {
// Light client
MinSyncCommitteeParticipants uint64 `yaml:"MIN_SYNC_COMMITTEE_PARTICIPANTS" spec:"true"` // MinSyncCommitteeParticipants defines the minimum amount of sync committee participants for which the light client acknowledges the signature.
MaxRequestLightClientUpdates uint64 `yaml:"MAX_REQUEST_LIGHT_CLIENT_UPDATES" spec:"true"` // MaxRequestLightClientUpdates defines the maximum amount of light client updates that can be requested in a single request.
SyncMessageDueBPS uint64 `yaml:"SYNC_MESSAGE_DUE_BPS" spec:"true"` // SyncMessageDueBPS defines the due time for a sync message.

// Bellatrix
TerminalBlockHash common.Hash `yaml:"TERMINAL_BLOCK_HASH" spec:"true"` // TerminalBlockHash of beacon chain.
Expand Down Expand Up @@ -741,10 +746,29 @@ func SlotsForEpochs(count primitives.Epoch, b *BeaconChainConfig) primitives.Slo

// SlotsDuration returns the time duration of the given number of slots.
func SlotsDuration(count primitives.Slot, b *BeaconChainConfig) time.Duration {
return time.Duration(count) * SecondsPerSlot(b)
return time.Duration(count) * b.SlotDuration()
}

// SecondsPerSlot returns the time duration of a single slot.
func SecondsPerSlot(b *BeaconChainConfig) time.Duration {
return time.Duration(b.SecondsPerSlot) * time.Second
return b.SlotDuration()
}

// SlotDuration returns the configured slot duration as a time.Duration.
func (b *BeaconChainConfig) SlotDuration() time.Duration {
return time.Duration(b.SlotDurationMillis()) * time.Millisecond
}

// SlotDurationMillis returns the configured slot duration in milliseconds.
func (b *BeaconChainConfig) SlotDurationMillis() uint64 {
if b.SlotDurationMilliseconds > 0 {
return b.SlotDurationMilliseconds
}
return b.SecondsPerSlot * 1000
}

// 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
Comment on lines +770 to +773
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.

}
Loading
Loading