feat: add process_attestations_justification_and_finalization test to leanState #866
+94
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was wrong?
Fixes: #834
This is a test that was left out from earlier. I was debugging on why the exact implementation was failing. I think going foward we will not be duplicating logic and will use test vectors when released in leanSpec.
How was it fixed?
Ok so the 1:1 implementation from the spec of this test fails as we perform additional validations performed in 3SF mini but not in leanSpec. These validations prohibit us from processing attestations for a slot till a block for the next slot has been processed.
In the case of this test, we can not process attestations for slot 4 if block for slot 5 has not been processed.
https://github.com/leanEthereum/leanSpec/blob/main/src/lean_spec/subspecs/containers/state/state.py#L437-L439
The leanSpec does not validate the following:
ream/crates/common/consensus/lean/src/state.rs
Lines 354 to 384 in 2d4d8e1
I believe this deviation is justified as we're implementing validations from 3SF mini but I wonder if leanSpec should also implement all validations for process_attestation from 3SF mini.
To-Do