Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ensi321 committed Oct 11, 2024
1 parent 7e0957e commit 522e8c9
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {electra, ssz} from "@lodestar/types";
import {FAR_FUTURE_EPOCH, MIN_ACTIVATION_BALANCE, PENDING_CONSOLIDATIONS_LIMIT} from "@lodestar/params";

import {toHex} from "@lodestar/utils";
import {CachedBeaconStateElectra} from "../types.js";
import {getConsolidationChurnLimit, isActiveValidator} from "../util/validator.js";
import {hasExecutionWithdrawalCredential, switchToCompoundingValidator} from "../util/electra.js";
Expand Down Expand Up @@ -107,10 +106,9 @@ function isValidSwitchToCompoundRequest(
}

const sourceValidator = state.validators.getReadonly(sourceIndex);
const addressStr = toHex(sourceValidator.withdrawalCredentials.subarray(12));
const sourceAddressStr = toHex(sourceAddress);
const sourceWithdrawalAddress = sourceValidator.withdrawalCredentials.subarray(12);
// Verify request has been authorized
if (addressStr !== sourceAddressStr) {
if (Buffer.compare(sourceWithdrawalAddress, sourceAddress) !== 0) {
return false;
}

Expand Down

0 comments on commit 522e8c9

Please sign in to comment.