test(spec): fix attestors slashing specs for electra fork - #6758
Conversation
| if (exitBalance > exitBalanceToConsume) { | ||
| const balanceToProcess = Number(exitBalance) - exitBalanceToConsume; | ||
| const additionalEpochs = Math.floor((balanceToProcess - 1) / (perEpochChurn + 1)); | ||
| const additionalEpochs = Math.ceil((balanceToProcess - 1) / (perEpochChurn + 1)); |
There was a problem hiding this comment.
Could you detail this? Also, is it worth having some test for this, as apparently this change didn't require any associated test change.
There was a problem hiding this comment.
Ideally my preferences is to have unit tests for every function, but unfortunatley we don't have it yet.
I updated with a code comment.
There was a problem hiding this comment.
Oh! I misread the spec here.
We should do
const additionalEpochs = Math.floor((balanceToProcess - 1) / perEpochChurn) + 1
Let me know if the spec test's still passing after making this change
| if (exitBalance > exitBalanceToConsume) { | ||
| const balanceToProcess = Number(exitBalance) - exitBalanceToConsume; | ||
| const additionalEpochs = Math.floor((balanceToProcess - 1) / (perEpochChurn + 1)); | ||
| const additionalEpochs = Math.ceil((balanceToProcess - 1) / (perEpochChurn + 1)); |
There was a problem hiding this comment.
Oh! I misread the spec here.
We should do
const additionalEpochs = Math.floor((balanceToProcess - 1) / perEpochChurn) + 1
Let me know if the spec test's still passing after making this change
Yes both expressions have same impact. Either to use |
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
…6758) * Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
* Fix attester slashing specs for electra * Remove unused import * Add code comment * Update the expression * Update the fork check
|
🎉 This PR is included in v1.22.0 🎉 |
Motivation
Improve the spec coverage for electra fork
Description
Fix attestor slashing for the elctra-fork.
Steps to test or reproduce