-
Notifications
You must be signed in to change notification settings - Fork 982
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
Update by reference for two state objects affect each other #3925
Comments
The cause of the bug is in the following remerkleable behaviour:
Potential solution would be to cache a child view inside of a parent view instance if a child view is a With this approach the above case would have: |
Another case with similar cause: @with_electra_and_later
@spec_state_test
def test_state_changes_overwritten_2(spec, state):
validator_0 = state.validators[0]
state.validators[0].exit_epoch = spec.Epoch(0)
assert validator_0.exit_epoch == spec.Epoch(0) The assert above fails because the update is not applied to the |
I wonder if @protolambda has anything to add here |
Consider the following test:
The second assert fails, as
validator_1.exit_epoch = spec.Epoch(1)
reverts the change made tovalidator_0
in the line above. If we change the order to 1) updatevalidator_1
2) updatevalidator_0
then the first assert would fail.The text was updated successfully, but these errors were encountered: