Skip to content

Conversation

dankrad
Copy link
Contributor

@dankrad dankrad commented Aug 4, 2025

Spec for 6s slot times. Based on #4476 .

TODOs:

  • Store time in milliseconds
  • Rewards adjustment
  • Blobs/gas adjustment (gas probably only on EL, to verify)
  • Entry/exit queue logic
  • Fix sync period (should not change due to shorter slot times)
  • Update get_forkchoice_store
  • Update on_tick
  • Fix get_slots_since_genesis logic
  • Slot subdivisions (wait for @jtraglia to confirm how to do this)
  • Fix failing tests
  • Adjust slot components based on Add helper functions for slot time deadlines #4589
Failing tests
FAILED tests/core/pyspec/eth2spec/test/electra/block_processing/test_process_consolidation_request.py::test_incorrect_not_enough_consolidation_churn_available - AssertionError: assert 63000000000 <= 32000000000
FAILED tests/core/pyspec/eth2spec/test/electra/block_processing/test_process_withdrawal_request.py::test_partial_withdrawal_request_with_high_balance - assert 100 == 101
FAILED tests/core/pyspec/eth2spec/test/bellatrix/fork_choice/test_should_override_forkchoice_update.py::test_should_override_forkchoice_update__true - AssertionError: assert 8 == 4
FAILED tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py::test_simple_blob_data - ValueError: blob_data.sidecars must be provided when post FULU fork
FAILED tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py::test_invalid_incorrect_proof - ValueError: blob_data.sidecars must be provided when post FULU fork
FAILED tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py::test_invalid_data_unavailable - ValueError: blob_data.sidecars must be provided when post FULU fork
FAILED tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py::test_invalid_wrong_proofs_length - ValueError: blob_data.sidecars must be provided when post FULU fork
FAILED tests/core/pyspec/eth2spec/test/deneb/fork_choice/test_on_block.py::test_invalid_wrong_blobs_length - ValueError: blob_data.sidecars must be provided when post FULU fork
FAILED tests/core/pyspec/eth2spec/test/deneb/epoch_processing/test_process_registry_updates.py::test_activation_churn_limit__greater_than_activation_limit - AssertionError: assert 2 == 4
FAILED tests/core/pyspec/eth2spec/test/deneb/epoch_processing/test_process_registry_updates.py::test_activation_churn_limit__equal_to_activation_limit - AssertionError: assert 2 == 4
FAILED tests/core/pyspec/eth2spec/test/electra/sanity/blocks/test_blocks.py::test_switch_to_compounding_requests_when_too_little_consolidation_churn_limit - AssertionError: assert False
FAILED tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_voluntary_exit.py::test_success_exit_queue__scaled_churn - assert 71 == (69 + 1)
FAILED tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_ex_ante.py::test_ex_ante_sandwich_without_attestations - AssertionError
FAILED tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_ex_ante.py::test_ex_ante_sandwich_with_honest_attestation - AssertionError
FAILED tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_get_head.py::test_filtered_block_tree - AssertionError
FAILED tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_get_head.py::test_proposer_boost_correct_head - AssertionError: assert 0x00000000000...00000000000000 == 0xa50391eaca0...1dcbb88f3b7c32
...

@dankrad dankrad changed the base branch from dev to master August 4, 2025 00:54
@jtraglia jtraglia added the eip7782 Reduce Block Latency label Aug 4, 2025
@rolfyone
Copy link
Contributor

rolfyone commented Aug 7, 2025

are we putting the change to rewards in another PR or are we looking at that in this PR too?

@dankrad
Copy link
Contributor Author

dankrad commented Aug 7, 2025

are we putting the change to rewards in another PR or are we looking at that in this PR too?

I think it's already covered by adjusting BASE_REWARDS_FACTOR?

Comment on lines +66 to +69
# Calculate the time when EIP-7782 fork occurs
if EIP7782_FORK_EPOCH == FAR_FUTURE_EPOCH:
# If EIP-7782 is not scheduled, use standard slot duration
return (store_time_ms - genesis_time_ms) // SLOT_DURATION_MS
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe this will actually work here. In our test framework, genesis starts with EIP-7782 even if EIP7782_FORK_EPOCH is still FAR_FUTURE_EPOCH. So this wouldn't work properly until we schedule the fork (ie assign a real epoch) which won't happen until a couple months before. The way the testing framework was designed doesn't handle this situation well.

@rolfyone
Copy link
Contributor

rolfyone commented Aug 7, 2025

I think it's already covered by adjusting BASE_REWARDS_FACTOR?

Ok great - had missed that but yes.

"""
churn = max(
MIN_PER_EPOCH_CHURN_LIMIT_EIP7782,
get_total_active_balance(state) // CHURN_LIMIT_QUOTIENT,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to double CHURN_LIMIT_QUOTIENT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Weak subjectivity is epoch based so this is possibly ok, but may ask @mkalinin

@jihoonsong
Copy link
Contributor

I think compute_time_at_slot also needs to be modified.

MIN_PER_EPOCH_CHURN_LIMIT_EIP7782: 64000000000
# 2**7 * 10**9 (= 128,000,000,000) Gwei
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT_EIP7782: 128000000000

Copy link
Member

Choose a reason for hiding this comment

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

might also need to double MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS, otherwise the data availability window goes down from ~18 days to just ~9 days

Copy link
Contributor

Choose a reason for hiding this comment

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

i was just thinking about this one :)

@rolfyone
Copy link
Contributor

where do we stand on sync committee period? there was a desire originally to have it fairly stable, so it only rotated once a day... Is that still desirable? if so we should probably double that too.. EPOCHS_PER_SYNC_COMMITTEE_PERIOD
I'm not sure if there's other reasons it may be limited as a flow on if we double that...

@dankrad
Copy link
Contributor Author

dankrad commented Aug 26, 2025

where do we stand on sync committee period? there was a desire originally to have it fairly stable, so it only rotated once a day... Is that still desirable? if so we should probably double that too.. EPOCHS_PER_SYNC_COMMITTEE_PERIOD I'm not sure if there's other reasons it may be limited as a flow on if we double that...

Yes, agreed, I think sync periods should stay the same, missed that one. Thanks!

@rolfyone
Copy link
Contributor

rolfyone commented Sep 1, 2025

MIN_EPOCHS_FOR_BLOCK_REQUESTS is another one... otherwise we'll halve our retention for blocks...

probably also worth considering halving the MAXIMUM_GOSSIP_CLOCK_DISPARITY as 500ms is becoming a fairly significant portion of the slot

@jihoonsong
Copy link
Contributor

On top of EPOCHS_PER_SYNC_COMMITTEE_PERIOD, we should probably double EPOCHS_PER_SUBNET_SUBSCRIPTION, too.

PAYLOAD_ATTESTATION_DUE_BPS: 7500

# EIP-7782
# [customized] 3000 milliseconds, 3 seconds
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
# [customized] 3000 milliseconds, 3 seconds
# [customized] 6000 milliseconds, 6 seconds

@ethereum ethereum deleted a comment from BahramKaramiany Sep 11, 2025
@ethereum ethereum deleted a comment from BahramKaramiany Sep 11, 2025
Comment on lines +167 to +176
```python
def get_attestation_due_ms(epoch: Epoch) -> uint64:
"""
Return the attestation due time in milliseconds for the given epoch.
"""
if epoch >= EIP7782_FORK_EPOCH:
return ATTESTATION_DUE_BPS_EIP7782 * SLOT_DURATION_MS_EIP7782 // BASIS_POINTS
else:
return ATTESTATION_DUE_BPS * SLOT_DURATION_MS // BASIS_POINTS
```
Copy link
Member

Choose a reason for hiding this comment

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

Hey @dankrad these modifications don't match the way we do this elsewhere. Like:

def get_attestation_due_ms(epoch: Epoch) -> uint64:
# [New in Gloas]
if epoch >= GLOAS_FORK_EPOCH:
return get_slot_component_duration_ms(ATTESTATION_DUE_BPS_GLOAS)
return get_slot_component_duration_ms(ATTESTATION_DUE_BPS)

For this function, it should be:

def get_attestation_due_ms(epoch: Epoch) -> uint64:
    # [New in EIP7782]
    if epoch >= EIP7782_FORK_EPOCH:
        get_slot_component_duration_ms(ATTESTATION_DUE_BPS_EIP7782)
    return get_slot_component_duration_ms(ATTESTATION_DUE_BPS)

And we need to update get_slot_component_duration_ms to be:

def get_slot_component_duration_ms(basis_points: uint64) -> uint64:
    """
    Calculate the duration of a slot component in milliseconds.
    """
    return basis_points * SLOT_DURATION_MS_EIP7782 // BASIS_POINTS

At the fork, the updated get_slot_component_duration_ms will be used. It doesn't need to know the epoch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eip7782 Reduce Block Latency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants