-
-
Notifications
You must be signed in to change notification settings - Fork 458
refactor: remove build() and async shuffling calculation #8688
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
Changes from 3 commits
fb26c17
4353bb0
27b506f
bbdf692
97a1372
ec2983f
03cb629
c3dbaaa
9ae55bc
f6a425b
58d82a2
382a664
a06d62f
57e6099
6a7d5fe
14a28e9
bc30b36
4828555
7f81ffc
2eb4ee0
f81861d
f3aff93
62bce64
3dc07b8
0681f48
eb05b91
f75cd15
e24b5f3
aa860b5
c2f3801
86b0359
9aad853
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,10 +32,6 @@ export type EpochTransitionCacheOpts = { | |
| * Assert progressive balances the same to EpochTransitionCache | ||
| */ | ||
| assertCorrectProgressiveBalances?: boolean; | ||
| /** | ||
| * Do not queue shuffling calculation async. Forces sync JIT calculation in afterProcessEpoch | ||
| */ | ||
| asyncShufflingCalculation?: boolean; | ||
| }; | ||
|
|
||
| /** | ||
|
|
@@ -179,12 +175,6 @@ export interface EpochTransitionCache { | |
| */ | ||
| nextEpochTotalActiveBalanceByIncrement: number; | ||
|
|
||
| /** | ||
| * Compute the shuffling sync or async. Defaults to synchronous. Need to pass `true` with the | ||
| * `EpochTransitionCacheOpts` | ||
| */ | ||
| asyncShufflingCalculation: boolean; | ||
|
|
||
| /** | ||
| * Track by validator index if it's active in the prev epoch. | ||
| * Used in metrics | ||
|
|
@@ -380,7 +370,6 @@ export function beforeProcessEpoch( | |
| }); | ||
|
|
||
| // Trigger async build of shuffling for epoch after next (nextShuffling post epoch transition) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| const epochAfterNext = state.epochCtx.nextEpoch + 1; | ||
| // cannot call calculateShufflingDecisionRoot here because spec prevent getting current slot | ||
| // as a decision block. we are part way through the transition though and this was added in | ||
| // process slot beforeProcessEpoch happens so it available and valid | ||
|
|
@@ -396,11 +385,6 @@ export function beforeProcessEpoch( | |
| nextShufflingActiveIndices[i] = nextEpochShufflingActiveValidatorIndices[i]; | ||
| } | ||
|
|
||
| const asyncShufflingCalculation = opts?.asyncShufflingCalculation ?? false; | ||
| if (asyncShufflingCalculation) { | ||
| state.epochCtx.shufflingCache?.build(epochAfterNext, nextShufflingDecisionRoot, state, nextShufflingActiveIndices); | ||
| } | ||
|
|
||
| if (totalActiveStakeByIncrement < 1) { | ||
| totalActiveStakeByIncrement = 1; | ||
| } else if (totalActiveStakeByIncrement >= Number.MAX_SAFE_INTEGER) { | ||
|
|
@@ -526,7 +510,6 @@ export function beforeProcessEpoch( | |
| indicesToEject, | ||
| nextShufflingDecisionRoot, | ||
|
guha-rahul marked this conversation as resolved.
Outdated
|
||
| nextShufflingActiveIndices, | ||
| asyncShufflingCalculation, | ||
| // to be updated in processEffectiveBalanceUpdates | ||
| nextEpochTotalActiveBalanceByIncrement: 0, | ||
| isActivePrevEpoch, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -52,9 +52,9 @@ export interface IShufflingCache { | |||||||||||||||||
| get(epoch: Epoch, decisionRoot: RootHex): Promise<EpochShuffling | null>; | ||||||||||||||||||
|
|
||||||||||||||||||
| /** | ||||||||||||||||||
| * Queue asynchronous build for an EpochShuffling | ||||||||||||||||||
| * Add an EpochShuffling to the ShufflingCache. | ||||||||||||||||||
| */ | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment for the
Suggested change
|
||||||||||||||||||
| build(epoch: Epoch, decisionRoot: RootHex, state: BeaconStateAllForks, activeIndices: Uint32Array): void; | ||||||||||||||||||
| set(shuffling: EpochShuffling, decisionRoot: RootHex): void; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| /** | ||||||||||||||||||
|
|
||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.