feat: switch to compounding from consolidation requests#7122
feat: switch to compounding from consolidation requests#7122ensi321 merged 8 commits intonc/devnet-4from
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## nc/devnet-4 #7122 +/- ##
==============================================
Coverage ? 48.97%
==============================================
Files ? 596
Lines ? 39825
Branches ? 2059
==============================================
Hits ? 19504
Misses ? 20280
Partials ? 41 |
Performance Report✔️ no performance regression detected Full benchmark results
|
68aad76 to
37b1b7b
Compare
|
Switching target branch to |
packages/state-transition/src/block/processConsolidationRequest.ts
Outdated
Show resolved
Hide resolved
| consolidationRequest: electra.ConsolidationRequest | ||
| ): boolean { | ||
| const {sourcePubkey, targetPubkey, sourceAddress} = consolidationRequest; | ||
| const sourceIndex = state.epochCtx.getValidatorIndex(sourcePubkey); |
There was a problem hiding this comment.
we could save the index lookup if we compare the pubkeys first, not sure if it's worth though but would match more closely to the spec
There was a problem hiding this comment.
we could save the index lookup if we compare the pubkeys first, not sure if it's worth though but would match more closely to the spec
Let's do the optimization later. This part of spec is sub-optimized and will very likely to be cleaned up in alpha 9 or 10. We can optimize when the spec gets refactored.
packages/state-transition/src/block/processConsolidationRequest.ts
Outdated
Show resolved
Hide resolved
|
🎉 This PR is included in v1.23.0 🎉 |
Spec changes
processConsolidationRequestprocessConsolidationRequestwill also switch the request's target validator to compounding instead of waiting untilprocessPendingConsolidationsin epoch processing.applyDeposit.Engineering changes
EpochTransitionCache.newCompoundingValidatorsadded in fix: improve processEffectiveBalanceUpdates #7043 as compound switching now happens in block processing instead of epoch processing. cc @twoeths