Skip to content
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

feat: implement maxEB EIP-7251 #6539

Merged
merged 41 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f5a9d9c
feat: implement EIP-6110 (#6042)
ensi321 Feb 19, 2024
6aad4cd
feat: implement EIP-6110 (#6042)
ensi321 Feb 19, 2024
62c76df
Add presets
ensi321 Mar 13, 2024
9f1efb2
Update config
ensi321 Mar 13, 2024
2e0ba78
Add necessary containers
ensi321 Mar 13, 2024
4879368
Update presets
ensi321 Mar 13, 2024
e931b18
Update config
ensi321 Mar 13, 2024
9ff94c5
Add todo comments
ensi321 Mar 13, 2024
6ea4e2d
Update constants and params
ensi321 Mar 25, 2024
7e20b15
Impl new process withdrawal
ensi321 Mar 25, 2024
d8abeef
Add withdrawaRequests to payload
ensi321 Mar 26, 2024
1e98f41
Add processConsolidation
ensi321 Mar 26, 2024
df3f376
Add process withdraw request
ensi321 Mar 26, 2024
be5fd01
Update deposit and withdrawal flow
ensi321 Mar 26, 2024
5e8be92
epoch processing
ensi321 Mar 26, 2024
3d06e16
Implement churn limits
ensi321 Mar 26, 2024
c0fa539
Lint
ensi321 Mar 26, 2024
1f473fc
lint
ensi321 Apr 1, 2024
ff30b74
Update state-transition utils
ensi321 Apr 1, 2024
16e18e1
processExecutionLayerWithdrawRequest
ensi321 Apr 1, 2024
cf27a34
processConsolidation
ensi321 Apr 1, 2024
284b925
queueExcessActiveBalance
ensi321 Apr 6, 2024
f15a42c
isValidDepositSignature
ensi321 Apr 7, 2024
ca157c6
Add jsdoc and timer for new processEpoch functions
ensi321 Apr 7, 2024
16914f3
Lint
ensi321 Apr 7, 2024
ef15bc2
Update maxEB
ensi321 Apr 12, 2024
5c16ff3
update voluntary exit
ensi321 Apr 12, 2024
2a967fe
Fix config
ensi321 Apr 12, 2024
2349afa
Update initiateValidatorExit
ensi321 Apr 17, 2024
5646fd5
Remove churn limit in processRegistryUpdates
ensi321 Apr 17, 2024
ffb5ad1
Fix conflict
ensi321 May 1, 2024
bb29c54
Add MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD
ensi321 May 1, 2024
5aba7f4
Reflect latest spec changes
ensi321 May 1, 2024
271b7c5
rebase fixes, fixes, improvements and cleanup
g11tech May 6, 2024
2f6df3d
Upgrade ssz version
ensi321 May 7, 2024
a5b5fe0
Use sliceFrom()
ensi321 May 7, 2024
fa066f4
cleanup as per specs feedback
g11tech May 7, 2024
51eaa3e
simplify
g11tech May 7, 2024
4a7d167
fix withdrawals
g11tech May 7, 2024
5ca66e2
remove slice
g11tech May 7, 2024
d5c4c92
fix the slashing quotient determination in slashvalidator
g11tech May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
},
"dependencies": {
"@chainsafe/persistent-merkle-tree": "^0.7.1",
"@chainsafe/ssz": "^0.15.1",
"@chainsafe/ssz": "^0.16.0",
"@lodestar/config": "^1.18.0",
"@lodestar/params": "^1.18.0",
"@lodestar/types": "^1.18.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"@chainsafe/libp2p-noise": "^15.0.0",
"@chainsafe/persistent-merkle-tree": "^0.7.1",
"@chainsafe/prometheus-gc-stats": "^1.0.0",
"@chainsafe/ssz": "^0.15.1",
"@chainsafe/ssz": "^0.16.0",
"@chainsafe/threads": "^1.11.1",
"@ethersproject/abi": "^5.7.0",
"@fastify/bearer-auth": "^9.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,9 @@ function preparePayloadAttributes(
};

if (ForkSeq[fork] >= ForkSeq.capella) {
// withdrawals logic is now fork aware as it changes on electra fork post capella
(payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals = getExpectedWithdrawals(
ForkSeq[fork],
prepareState as CachedBeaconStateCapella
).withdrawals;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/test/sim/electra-interop.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ describe("executionEngine / ExecutionEngineHttp", function () {
blockHash: dataToBytes(newPayloadBlockHash, 32),
receiptsRoot: dataToBytes("0x79ee3424eb720a3ad4b1c5a372bb8160580cbe4d893778660f34213c685627a9", 32),
blobGasUsed: 0n,
exits: [],
withdrawalRequests: [],
};
const parentBeaconBlockRoot = dataToBytes("0x0000000000000000000000000000000000000000000000000000000000000000", 32);
const payloadResult = await executionEngine.notifyNewPayload(
Expand Down
4 changes: 2 additions & 2 deletions packages/beacon-node/test/spec/presets/operations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import * as blockFns from "@lodestar/state-transition/block";
import {ssz, phase0, altair, bellatrix, capella, electra} from "@lodestar/types";
import {InputType} from "@lodestar/spec-test-util";
import {ACTIVE_PRESET, ForkName} from "@lodestar/params";
import {ACTIVE_PRESET, ForkName, ForkSeq} from "@lodestar/params";

import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js";
import {expectEqualBeaconState, inputTypeSszTreeViewDU} from "../utils/expectEqualBeaconState.js";
Expand Down Expand Up @@ -88,7 +88,7 @@ const operationFns: Record<string, BlockProcessFn<CachedBeaconStateAllForks>> =
},

withdrawals: (state, testCase: {execution_payload: capella.ExecutionPayload}) => {
blockFns.processWithdrawals(state as CachedBeaconStateCapella, testCase.execution_payload);
blockFns.processWithdrawals(ForkSeq.capella, state as CachedBeaconStateCapella, testCase.execution_payload);
},
};

Expand Down
8 changes: 4 additions & 4 deletions packages/beacon-node/test/unit/executionEngine/http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ describe("ExecutionEngine / http", () => {
},
],
depositReceipts: null, // depositReceipts is null pre-electra
exits: null,
withdrawalRequests: null,
},
null, // null returned for missing blocks
{
Expand All @@ -199,7 +199,7 @@ describe("ExecutionEngine / http", () => {
],
withdrawals: null, // withdrawals is null pre-capella
depositReceipts: null, // depositReceipts is null pre-electra
exits: null,
withdrawalRequests: null,
},
],
};
Expand Down Expand Up @@ -248,7 +248,7 @@ describe("ExecutionEngine / http", () => {
},
],
depositReceipts: null, // depositReceipts is null pre-electra
exits: null,
withdrawalRequests: null,
},
null, // null returned for missing blocks
{
Expand All @@ -258,7 +258,7 @@ describe("ExecutionEngine / http", () => {
],
withdrawals: null, // withdrawals is null pre-capella
depositReceipts: null, // depositReceipts is null pre-electra
exits: null,
withdrawalRequests: null,
},
],
};
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@chainsafe/discv5": "^9.0.0",
"@chainsafe/enr": "^3.0.0",
"@chainsafe/persistent-merkle-tree": "^0.7.1",
"@chainsafe/ssz": "^0.15.1",
"@chainsafe/ssz": "^0.16.0",
"@chainsafe/threads": "^1.11.1",
"@libp2p/crypto": "^4.1.0",
"@libp2p/peer-id": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"blockchain"
],
"dependencies": {
"@chainsafe/ssz": "^0.15.1",
"@chainsafe/ssz": "^0.16.0",
"@lodestar/params": "^1.18.0",
"@lodestar/types": "^1.18.0"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/config/src/chainConfig/configs/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,10 @@ export const chainConfig: ChainConfig = {
// Deneb
// `2**12` (= 4096 epochs, ~18 days)
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096,

// Electra
// 2**8 * 10**9 (= 256,000,000,000)
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000,
// 2*7 * 10**9 (= 128,000,000,000)
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000,
};
6 changes: 6 additions & 0 deletions packages/config/src/chainConfig/configs/minimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,10 @@ export const chainConfig: ChainConfig = {
// Deneb
// `2**12` (= 4096 epochs, ~18 days)
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096,

// Electra
// 2**7 * 10**9 (= 128,000,000,000)
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000,
// 2**6 * 10**9 (= 64,000,000,000)
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000,
};
4 changes: 4 additions & 0 deletions packages/config/src/chainConfig/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export type ChainConfig = {
MIN_PER_EPOCH_CHURN_LIMIT: number;
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: number;
CHURN_LIMIT_QUOTIENT: number;
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: number;
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: number;

// Fork choice
PROPOSER_SCORE_BOOST: number;
Expand Down Expand Up @@ -120,6 +122,8 @@ export const chainConfigTypes: SpecTypes<ChainConfig> = {
MIN_PER_EPOCH_CHURN_LIMIT: "number",
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: "number",
CHURN_LIMIT_QUOTIENT: "number",
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: "number",
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: "number",

// Fork choice
PROPOSER_SCORE_BOOST: "number",
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
"@chainsafe/ssz": "^0.15.1",
"@chainsafe/ssz": "^0.16.0",
"@lodestar/config": "^1.18.0",
"@lodestar/utils": "^1.18.0",
"it-all": "^3.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/fork-choice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
"@chainsafe/ssz": "^0.15.1",
"@chainsafe/ssz": "^0.16.0",
"@lodestar/config": "^1.18.0",
"@lodestar/params": "^1.18.0",
"@lodestar/state-transition": "^1.18.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/light-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"dependencies": {
"@chainsafe/bls": "^8.1.0",
"@chainsafe/persistent-merkle-tree": "^0.7.1",
"@chainsafe/ssz": "^0.15.1",
"@chainsafe/ssz": "^0.16.0",
"@lodestar/api": "^1.18.0",
"@lodestar/config": "^1.18.0",
"@lodestar/params": "^1.18.0",
Expand Down
14 changes: 13 additions & 1 deletion packages/params/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,20 @@ export const {
MAX_BLOBS_PER_BLOCK,
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH,

MAX_EFFECTIVE_BALANCE_ELECTRA,
MIN_ACTIVATION_BALANCE,
PENDING_BALANCE_DEPOSITS_LIMIT,
PENDING_PARTIAL_WITHDRAWALS_LIMIT,
PENDING_CONSOLIDATIONS_LIMIT,
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA,
MAX_CONSOLIDATIONS,

MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD,
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD,
MAX_ATTESTER_SLASHINGS_ELECTRA,
MAX_ATTESTATIONS_ELECTRA,
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP,
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA,
} = activePreset;

////////////
Expand All @@ -119,6 +129,7 @@ export const JUSTIFICATION_BITS_LENGTH = 4;
// Since the prefixes are just 1 byte, we define and use them as number
export const BLS_WITHDRAWAL_PREFIX = 0;
export const ETH1_ADDRESS_WITHDRAWAL_PREFIX = 1;
export const COMPOUNDING_WITHDRAWAL_PREFIX = 2;

// Domain types

Expand All @@ -133,7 +144,7 @@ export const DOMAIN_SYNC_COMMITTEE = Uint8Array.from([7, 0, 0, 0]);
export const DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF = Uint8Array.from([8, 0, 0, 0]);
export const DOMAIN_CONTRIBUTION_AND_PROOF = Uint8Array.from([9, 0, 0, 0]);
export const DOMAIN_BLS_TO_EXECUTION_CHANGE = Uint8Array.from([10, 0, 0, 0]);
export const DOMAIN_BLOB_SIDECAR = Uint8Array.from([11, 0, 0, 0]);
export const DOMAIN_CONSOLIDATION = Uint8Array.from([11, 0, 0, 0]);

// Application specific domains

Expand Down Expand Up @@ -252,3 +263,4 @@ export const BLOBSIDECAR_FIXED_SIZE = ACTIVE_PRESET === PresetName.minimal ? 131

// Electra Misc
export const UNSET_DEPOSIT_RECEIPTS_START_INDEX = 2n ** 64n - 1n;
export const FULL_EXIT_REQUEST_AMOUNT = 0;
11 changes: 11 additions & 0 deletions packages/params/src/presets/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,15 @@ export const mainnetPreset: BeaconPreset = {
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16,
MAX_ATTESTER_SLASHINGS_ELECTRA: 1,
MAX_ATTESTATIONS_ELECTRA: 8,
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8,
// 2**11 * 10**9 (= 2,048,000,000,000) Gwei
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000,
// 2**16 (= 65536)
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096,
MIN_ACTIVATION_BALANCE: 32000000000,
PENDING_BALANCE_DEPOSITS_LIMIT: 134217728,
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728,
PENDING_CONSOLIDATIONS_LIMIT: 262144,
MAX_CONSOLIDATIONS: 1,
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096,
};
13 changes: 12 additions & 1 deletion packages/params/src/presets/minimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,18 @@ export const minimalPreset: BeaconPreset = {

// ELECTRA
MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD: 4,
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16,
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 2,
MAX_ATTESTER_SLASHINGS_ELECTRA: 1,
MAX_ATTESTATIONS_ELECTRA: 8,
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 1,
// 2**11 * 10**9 (= 2,048,000,000,000) Gwei
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000,
// 2**16 (= 65536)
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096,
MIN_ACTIVATION_BALANCE: 32000000000,
PENDING_BALANCE_DEPOSITS_LIMIT: 134217728,
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 64,
PENDING_CONSOLIDATIONS_LIMIT: 64,
MAX_CONSOLIDATIONS: 1,
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096,
};
18 changes: 18 additions & 0 deletions packages/params/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ export type BeaconPreset = {
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: number;
MAX_ATTESTER_SLASHINGS_ELECTRA: number;
MAX_ATTESTATIONS_ELECTRA: number;
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: number;
MAX_EFFECTIVE_BALANCE_ELECTRA: number;
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: number;
MIN_ACTIVATION_BALANCE: number;
PENDING_BALANCE_DEPOSITS_LIMIT: number;
PENDING_PARTIAL_WITHDRAWALS_LIMIT: number;
PENDING_CONSOLIDATIONS_LIMIT: number;
MAX_CONSOLIDATIONS: number;
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: number;
};

/**
Expand Down Expand Up @@ -179,6 +188,15 @@ export const beaconPresetTypes: BeaconPresetTypes = {
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: "number",
MAX_ATTESTER_SLASHINGS_ELECTRA: "number",
MAX_ATTESTATIONS_ELECTRA: "number",
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: "number",
MAX_EFFECTIVE_BALANCE_ELECTRA: "number",
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: "number",
MIN_ACTIVATION_BALANCE: "number",
PENDING_BALANCE_DEPOSITS_LIMIT: "number",
PENDING_PARTIAL_WITHDRAWALS_LIMIT: "number",
PENDING_CONSOLIDATIONS_LIMIT: "number",
MAX_CONSOLIDATIONS: "number",
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: "number",
};

type BeaconPresetTypes = {
Expand Down
2 changes: 1 addition & 1 deletion packages/state-transition/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@chainsafe/blst": "^1.0.0",
"@chainsafe/persistent-merkle-tree": "^0.7.1",
"@chainsafe/persistent-ts": "^0.19.1",
"@chainsafe/ssz": "^0.15.1",
"@chainsafe/ssz": "^0.16.0",
"@lodestar/config": "^1.18.0",
"@lodestar/params": "^1.18.0",
"@lodestar/types": "^1.18.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/state-transition/src/block/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ export function processBlock(
// https://github.com/ethereum/consensus-specs/blob/b62c9e877990242d63aa17a2a59a49bc649a2f2e/specs/eip4844/beacon-chain.md#disabling-withdrawals
if (fork >= ForkSeq.capella) {
processWithdrawals(
fork,
state as CachedBeaconStateCapella,
fullOrBlindedPayload as capella.FullOrBlindedExecutionPayload
);
}

processExecutionPayload(fork, state as CachedBeaconStateBellatrix, block.body, externalData);
}

Expand Down
39 changes: 25 additions & 14 deletions packages/state-transition/src/block/initiateValidatorExit.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {CompositeViewDU} from "@chainsafe/ssz";
import {FAR_FUTURE_EPOCH} from "@lodestar/params";
import {FAR_FUTURE_EPOCH, ForkSeq} from "@lodestar/params";
import {ssz} from "@lodestar/types";
import {CachedBeaconStateAllForks} from "../types.js";
import {CachedBeaconStateAllForks, CachedBeaconStateElectra} from "../types.js";
import {computeExitEpochAndUpdateChurn} from "../util/epoch.js";

/**
* Initiate the exit of the validator with index ``index``.
Expand All @@ -24,6 +25,7 @@ import {CachedBeaconStateAllForks} from "../types.js";
* Forcing consumers to pass the SubTree of `validator` directly mitigates this issue.
*/
export function initiateValidatorExit(
fork: ForkSeq,
state: CachedBeaconStateAllForks,
validator: CompositeViewDU<typeof ssz.phase0.Validator>
): void {
Expand All @@ -34,18 +36,27 @@ export function initiateValidatorExit(
return;
}

// Limits the number of validators that can exit on each epoch.
// Expects all state.validators to follow this rule, i.e. no validator.exitEpoch is greater than exitQueueEpoch.
// If there the churnLimit is reached at this current exitQueueEpoch, advance epoch and reset churn.
if (epochCtx.exitQueueChurn >= epochCtx.churnLimit) {
epochCtx.exitQueueEpoch += 1;
epochCtx.exitQueueChurn = 1; // = 1 to account for this validator with exitQueueEpoch
if (fork < ForkSeq.electra) {
// Limits the number of validators that can exit on each epoch.
// Expects all state.validators to follow this rule, i.e. no validator.exitEpoch is greater than exitQueueEpoch.
// If there the churnLimit is reached at this current exitQueueEpoch, advance epoch and reset churn.
if (epochCtx.exitQueueChurn >= epochCtx.churnLimit) {
epochCtx.exitQueueEpoch += 1;
epochCtx.exitQueueChurn = 1; // = 1 to account for this validator with exitQueueEpoch
} else {
// Add this validator to the current exitQueueEpoch churn
epochCtx.exitQueueChurn += 1;
}

// set validator exit epoch
validator.exitEpoch = epochCtx.exitQueueEpoch;
} else {
// Add this validator to the current exitQueueEpoch churn
epochCtx.exitQueueChurn += 1;
// set validator exit epoch
// Note we don't use epochCtx.exitQueueChurn and exitQueueEpoch anymore
validator.exitEpoch = computeExitEpochAndUpdateChurn(
state as CachedBeaconStateElectra,
BigInt(validator.effectiveBalance)
);
}

// set validator exit epoch and withdrawable epoch
validator.exitEpoch = epochCtx.exitQueueEpoch;
validator.withdrawableEpoch = epochCtx.exitQueueEpoch + config.MIN_VALIDATOR_WITHDRAWABILITY_DELAY;
validator.withdrawableEpoch = validator.exitEpoch + config.MIN_VALIDATOR_WITHDRAWABILITY_DELAY;
}
Loading
Loading