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

release v1.4.0-beta.7 #3598

Merged
merged 36 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b4d418d
Remove some trailing whitespace
asn-d6 Jan 15, 2024
a4331e7
Public methods must accept raw bytes
asn-d6 Jan 15, 2024
96e41bc
Optimization: reduce `len()` call
hwwhww Jan 16, 2024
87f2ad2
Public methods: int -> uint64
asn-d6 Jan 16, 2024
6679860
Minor fixes based on review
asn-d6 Jan 17, 2024
2000a4f
Improve test_verify_cell_proof_batch()
asn-d6 Jan 17, 2024
f1dff5f
Merge pull request #3581 from ethereum/reduce-len-call
hwwhww Jan 20, 2024
0db4580
add py.typed file mypy
gurukamath Jan 23, 2024
ae3ef6f
Merge pull request #3579 from asn-d6/peerdas_public_method_bytes
asn-d6 Jan 26, 2024
8b3ac46
Add helper method: construct_vanishing_polynomial()
asn-d6 Jan 31, 2024
be5e5c5
Add helpers: recover_shifted_data() and recover_original_data()
asn-d6 Jan 23, 2024
4d01d50
Initial docs added to recover_shifted_data() and recover_original_data()
asn-d6 Jan 31, 2024
212c1fe
Small improvements on construct_vanishing_polynomial()
asn-d6 Jan 31, 2024
d60580b
Apply suggestions from code review
hwwhww Feb 1, 2024
e3b83d5
Add defensive asserts in recover_polynomial()
asn-d6 Feb 5, 2024
1e41a6b
New FIELD_ELEMENTS_PER_EXT_BLOB: number of cells in an extended blob
asn-d6 Feb 5, 2024
4b1106b
Update specs/_features/eip7594/polynomial-commitments-sampling.md
asn-d6 Feb 5, 2024
f1dd735
Update specs/_features/eip7594/polynomial-commitments-sampling.md
asn-d6 Feb 6, 2024
385b0f3
Update specs/_features/eip7594/polynomial-commitments-sampling.md
asn-d6 Feb 6, 2024
3b700d3
Merge pull request #3588 from gurukamath/mypy-types
hwwhww Feb 6, 2024
fe344b7
correct the location of py.typed
gurukamath Feb 6, 2024
fe8db03
Merge pull request #3594 from gurukamath/mypy-types
hwwhww Feb 7, 2024
4e2578d
Schedule Deneb for Mainnet
etan-status Feb 8, 2024
4878f1d
Set official mainnet `DENEB_FORK_EPOCH`
hwwhww Feb 8, 2024
3b45d92
Merge commit '4878f1da30393582d67e2736a2c058430d05784f' into df-schedule
etan-status Feb 8, 2024
07bba7a
Bump version to `1.4.0-beta.7`
hwwhww Feb 13, 2024
e043a12
Merge pull request #3597 from etan-status/df-schedule
hwwhww Feb 13, 2024
daf6a0a
Merge pull request #3599 from ethereum/bump-version
hwwhww Feb 13, 2024
7076fb2
Handle `integer_squareroot` bound case
hwwhww Feb 14, 2024
90afb23
Update specs/_features/eip7594/polynomial-commitments-sampling.md
hwwhww Feb 14, 2024
2faa44b
Merge pull request #3591 from asn-d6/peerdas_refactor_recovery_polyno…
hwwhww Feb 14, 2024
42bc600
Add overflow case
hwwhww Feb 14, 2024
f020649
add higher_churn_limit_to_lower tests
hwwhww Feb 14, 2024
e3d91d8
Rename `MAX_UINT_64` -> `UINT64_MAX`
hwwhww Feb 15, 2024
f82a3af
Merge pull request #3600 from ethereum/integer_squareroot
hwwhww Feb 15, 2024
b696174
Merge pull request #3602 from ethereum/deneb-fork-transition
hwwhww Feb 15, 2024
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
Prev Previous commit
Next Next commit
add higher_churn_limit_to_lower tests
  • Loading branch information
hwwhww committed Feb 15, 2024
commit f020649519eae4d3f2fa70a15c294cdf4cbfdd7d
112 changes: 112 additions & 0 deletions tests/core/pyspec/eth2spec/test/deneb/transition/test_transition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
from eth2spec.test.context import (
ForkMeta,
with_fork_metas,
with_presets,
)
from eth2spec.test.helpers.constants import (
AFTER_DENEB_PRE_POST_FORKS,
MINIMAL,
)
from eth2spec.test.helpers.keys import pubkeys
from eth2spec.test.helpers.fork_transition import (
do_fork,
transition_to_next_epoch_and_append_blocks,
transition_until_fork,
)


def mock_activated_validators(spec, state, mock_activations):
validator_count = len(state.validators)
for i in range(mock_activations):
index = validator_count + i
validator = spec.Validator(
pubkey=pubkeys[index],
withdrawal_credentials=spec.ETH1_ADDRESS_WITHDRAWAL_PREFIX + b'\x00' * 11 + b'\x56' * 20,
activation_eligibility_epoch=0,
activation_epoch=spec.FAR_FUTURE_EPOCH,
exit_epoch=spec.FAR_FUTURE_EPOCH,
withdrawable_epoch=spec.FAR_FUTURE_EPOCH,
effective_balance=spec.MAX_EFFECTIVE_BALANCE,
)
state.validators.append(validator)
state.balances.append(spec.MAX_EFFECTIVE_BALANCE)
state.previous_epoch_participation.append(spec.ParticipationFlags(0b0000_0000))
state.current_epoch_participation.append(spec.ParticipationFlags(0b0000_0000))
state.inactivity_scores.append(0)
state.validators[index].activation_epoch = spec.get_current_epoch(state)


@with_fork_metas([ForkMeta(pre_fork_name=pre, post_fork_name=post, fork_epoch=2)
for pre, post in AFTER_DENEB_PRE_POST_FORKS])
@with_presets([MINIMAL], reason="churn limit update needs enough validators")
def test_higher_churn_limit_to_lower(state, fork_epoch, spec, post_spec, pre_tag, post_tag):
"""
Test if churn limit goes from high to low due to EIP-7514.
"""
# Create high churn limit
mock_activations = post_spec.config.MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT * spec.config.CHURN_LIMIT_QUOTIENT
mock_activated_validators(spec, state, mock_activations)

transition_until_fork(spec, state, fork_epoch)

churn_limit_0 = spec.get_validator_churn_limit(state)
assert churn_limit_0 > post_spec.config.MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT

# check pre state
assert spec.get_current_epoch(state) < fork_epoch

yield "pre", state

# irregular state transition to handle fork
blocks = []
state, block = do_fork(state, spec, post_spec, fork_epoch)
blocks.append(post_tag(block))

# check post state
assert spec.get_current_epoch(state) == fork_epoch

# continue regular state transition with new spec into next epoch
transition_to_next_epoch_and_append_blocks(post_spec, state, post_tag, blocks, only_last_block=True)

yield "blocks", blocks
yield "post", state

churn_limit_1 = post_spec.get_validator_activation_churn_limit(state)
assert churn_limit_1 == post_spec.config.MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT
assert churn_limit_1 < churn_limit_0


@with_fork_metas([ForkMeta(pre_fork_name=pre, post_fork_name=post, fork_epoch=2)
for pre, post in AFTER_DENEB_PRE_POST_FORKS])
@with_presets([MINIMAL], reason="churn limit update needs enough validators")
def test_higher_churn_limit_to_lower__without_block(state, fork_epoch, spec, post_spec, pre_tag, post_tag):
"""
Test if churn limit goes from high to low due to EIP-7514.
"""
# Create high churn limit
mock_activations = post_spec.config.MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT * spec.config.CHURN_LIMIT_QUOTIENT
mock_activated_validators(spec, state, mock_activations)

transition_until_fork(spec, state, fork_epoch)

churn_limit_0 = spec.get_validator_churn_limit(state)
assert churn_limit_0 > post_spec.config.MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT

# check pre state
assert spec.get_current_epoch(state) < fork_epoch

yield "pre", state

# irregular state transition to handle fork
# set with_block=False here
state, _ = do_fork(state, spec, post_spec, fork_epoch, with_block=False)

# check post state
assert spec.get_current_epoch(state) == fork_epoch

yield "blocks", []
yield "post", state

churn_limit_1 = post_spec.get_validator_activation_churn_limit(state)
assert churn_limit_1 == post_spec.config.MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT
assert churn_limit_1 < churn_limit_0
2 changes: 2 additions & 0 deletions tests/generators/transition/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
)
from eth2spec.test.deneb.transition import (
test_operations as test_deneb_operations,
test_transition as test_deneb_transition,
)


Expand Down Expand Up @@ -47,6 +48,7 @@ def cases_fn() -> Iterable[gen_typing.TestCase]:
test_altair_slashing,
test_altair_operations,
test_deneb_operations,
test_deneb_transition,
)
for transition_test_module in all_tests:
for pre_fork, post_fork in ALL_PRE_POST_FORKS:
Expand Down
Loading