Skip to content

Commit

Permalink
Add note on why validator pubkey used as key instead of index
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Jan 14, 2025
1 parent b6ae0bd commit d00450b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/beacon-node/src/execution/builder/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export type ValidatorRegistration = {
};

export class ValidatorRegistrationCache {
/**
* Map to track registrations by validator pubkey which is used here instead of
* validator index as `bellatrix.ValidatorRegistrationV1` does not contain the index
* and builder flow in general prefers to use pubkey over index.
*/
private readonly registrationByValidatorPubkey: Map<string, ValidatorRegistration>;
constructor() {
this.registrationByValidatorPubkey = new Map();
Expand Down

0 comments on commit d00450b

Please sign in to comment.