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: placeholder PR for electra #6352

Draft
wants to merge 48 commits into
base: unstable
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b9ef19d
feat: placeholder PR for electra
g11tech Jan 24, 2024
06d5344
feat: implement EIP-6110 (#6042)
ensi321 Feb 19, 2024
452cc19
chore: fix CI failure due to recent merge from `unstable` (#6646)
ensi321 Apr 12, 2024
851b7c9
feat: implement execution layer exits eip 7002 (#6651)
g11tech Apr 22, 2024
2c8a2e6
chore: update spec test version for electra fork (#6717)
ensi321 May 1, 2024
0e67967
feat: add presets and ssz types for EIP-7549 (#6715)
ensi321 May 4, 2024
95f954f
chore: fix the rebase build (#6735)
g11tech May 4, 2024
e54ea93
feat: upgrade 7002 exits to withdrawal request (#6736)
g11tech May 5, 2024
10a0c7f
feat: implement maxEB EIP-7251 (#6539)
ensi321 May 7, 2024
f177dc0
feat: beacon node process electra attestations EIP-7549 (#6738)
ensi321 May 7, 2024
fe8ebcf
feat: handle the EL payload sending data in deposit requests instead …
g11tech May 8, 2024
a71ded5
feat: implement EIP-7549 (#6689)
ensi321 May 8, 2024
d5214c0
fix: attestation pool for electra (#6744)
twoeths May 8, 2024
7e894c0
feat: update engineapi endpoints to v4 (#6747)
g11tech May 8, 2024
7f3ee33
feat: rename deposit receipt to deposit request for Pectra (#6748)
ensi321 May 8, 2024
03d39bb
test: enable spec tests related to eip-7549 (#6741)
nazarhussain May 8, 2024
8bb7fcb
fix: fix e2e test in electra-fork (#6751)
ensi321 May 8, 2024
1b66e59
feat: get the basic integration working with the ethereumjs electra b…
g11tech May 8, 2024
48e4df3
feat: apply some fixes and hacks to get the single node devnet workin…
g11tech May 9, 2024
cea9dca
fix: get aggregate and proofs signature sets (#6757)
twoeths May 10, 2024
9f042b6
test(spec): fix attestors slashing specs for electra fork (#6758)
nazarhussain May 10, 2024
ba5b3cf
fix: publish electra attestations / aggregates through api (#6759)
nflaig May 13, 2024
932571a
chore: fix types and lint (#6750)
g11tech May 13, 2024
9e9e3cf
fix: fix electra genesis spec test (#6764)
ensi321 May 14, 2024
cc7afd7
feat: support missing electra spec test (#6765)
ensi321 May 14, 2024
69e0a27
test: fix ssz types in fork_choice spec tests (#6767)
nflaig May 14, 2024
5b527c4
chore: update EffectiveBalanceIncrements type (#6763)
jeluard May 14, 2024
d5f3b8c
Fix ssz_static
ensi321 May 14, 2024
d7c9321
fix: inline sourcemaps to help with debugging (#6768)
matthewkeil May 14, 2024
95be2ba
fix: additional epoch calculation logic for consolidation churn (#6770)
nazarhussain May 14, 2024
70a59b0
fix: electra fork transition spec tests (#6769)
twoeths May 14, 2024
8bf5bf1
test: fix ssz_static spec tests for all forks (#6771)
nflaig May 14, 2024
d559d04
chore(spec): remove the skip specs for electra (#6772)
nazarhussain May 14, 2024
b747b75
fix: use mutable validator object (#6774)
ensi321 May 14, 2024
03658fd
test: fix balance spec tests (#6777)
matthewkeil May 14, 2024
a4c3447
fix: effective balance cache is not in sync with validator effective …
ensi321 May 14, 2024
796213c
fix: make electra-fork passes lint and check-types (#6785)
ensi321 May 16, 2024
563e77a
fix: update data format of WithdrawalRequestV1 (#6789)
nflaig May 16, 2024
f9d2bab
fix: publish attestations with non-zero committee index (#6790)
ensi321 May 16, 2024
6eecd2b
fix: validator monitor summaries should not render during epoch 0 (#6…
ensi321 May 16, 2024
a66b18e
fix: attestation duty validation (#6792)
ensi321 May 16, 2024
117568c
fix: align BeaconBlockBody and BlindedBeaconBlockBody (#6782)
wemeetagain May 16, 2024
ed0dbe9
test: improve ssz tests consistency (#6776)
jeluard May 16, 2024
4aba3b0
fix: batch validation for electra attestations (#6788)
twoeths May 16, 2024
83a0ac9
fix: update withdrawal request container to match consensus spec (#6797)
nflaig May 16, 2024
d029cf7
fix: get seen AttData key from SignedAggregateAndProof electra (#6802)
twoeths May 17, 2024
0aa0a4d
test: only skip ssz_static tests associated to missing type (#6798)
nflaig May 23, 2024
6471eea
chore: types and lint fixes (#6819)
g11tech May 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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.1",
"@lodestar/params": "^1.18.1",
"@lodestar/types": "^1.18.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/beacon/client/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {IHttpClient, generateGenericJsonClient} from "../../utils/client/index.j
/**
* REST HTTP client for validator routes
*/
export function getClient(_config: ChainForkConfig, httpClient: IHttpClient): Api {
const reqSerializers = getReqSerializers();
export function getClient(config: ChainForkConfig, httpClient: IHttpClient): Api {
const reqSerializers = getReqSerializers(config);
const returnTypes = getReturnTypes();
// All routes return JSON, use a client auto-generator
return generateGenericJsonClient<Api, ReqTypes>(routesData, reqSerializers, returnTypes, httpClient);
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/beacon/routes/beacon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function getReqSerializers(config: ChainForkConfig) {
return {
getGenesis: reqEmpty,
...block.getReqSerializers(config),
...pool.getReqSerializers(),
...pool.getReqSerializers(config),
...state.getReqSerializers(),
...rewards.getReqSerializers(),
};
Expand Down
24 changes: 19 additions & 5 deletions packages/api/src/beacon/routes/beacon/pool.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {phase0, altair, capella, CommitteeIndex, Slot, ssz} from "@lodestar/types";
import {ChainForkConfig} from "@lodestar/config";
import {ForkName} from "@lodestar/params";
import {phase0, altair, capella, CommitteeIndex, Slot, ssz, allForks} from "@lodestar/types";
import {ApiClientResponse} from "../../../interfaces.js";
import {HttpStatusCode} from "../../../utils/client/httpStatusCode.js";
import {
Expand Down Expand Up @@ -80,7 +82,7 @@ export type Api = {
* @throws ApiError
*/
submitPoolAttestations(
attestations: phase0.Attestation[]
attestations: allForks.Attestation[]
): Promise<ApiClientResponse<{[HttpStatusCode.OK]: void}, HttpStatusCode.BAD_REQUEST>>;

/**
Expand Down Expand Up @@ -159,15 +161,15 @@ export type ReqTypes = {
getPoolProposerSlashings: ReqEmpty;
getPoolVoluntaryExits: ReqEmpty;
getPoolBlsToExecutionChanges: ReqEmpty;
submitPoolAttestations: {body: unknown};
submitPoolAttestations: {body: unknown; headers: {"eth-consensus-version": ForkName}};
submitPoolAttesterSlashings: {body: unknown};
submitPoolProposerSlashings: {body: unknown};
submitPoolVoluntaryExit: {body: unknown};
submitPoolBlsToExecutionChange: {body: unknown};
submitPoolSyncCommitteeSignatures: {body: unknown};
};

export function getReqSerializers(): ReqSerializers<Api, ReqTypes> {
export function getReqSerializers(config: ChainForkConfig): ReqSerializers<Api, ReqTypes> {
return {
getPoolAttestations: {
writeReq: (filters) => ({query: {slot: filters?.slot, committee_index: filters?.committeeIndex}}),
Expand All @@ -178,7 +180,19 @@ export function getReqSerializers(): ReqSerializers<Api, ReqTypes> {
getPoolProposerSlashings: reqEmpty,
getPoolVoluntaryExits: reqEmpty,
getPoolBlsToExecutionChanges: reqEmpty,
submitPoolAttestations: reqOnlyBody(ArrayOf(ssz.phase0.Attestation), Schema.ObjectArray),
submitPoolAttestations: {
writeReq: (attestations) => {
const fork = config.getForkName(attestations[0].data.slot);
return {
body: ArrayOf(ssz.allForks[fork].Attestation).toJson(attestations),
headers: {"eth-consensus-version": fork},
};
},
parseReq: ({body, headers}) => [
ArrayOf(ssz.allForks[headers["eth-consensus-version"]].Attestation).fromJson(body),
],
schema: {body: Schema.ObjectArray},
},
submitPoolAttesterSlashings: reqOnlyBody(ssz.phase0.AttesterSlashing, Schema.Object),
submitPoolProposerSlashings: reqOnlyBody(ssz.phase0.ProposerSlashing, Schema.Object),
submitPoolVoluntaryExit: reqOnlyBody(ssz.phase0.SignedVoluntaryExit, Schema.Object),
Expand Down
8 changes: 4 additions & 4 deletions packages/api/src/beacon/routes/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ export type EventData = {
block: RootHex;
executionOptimistic: boolean;
};
[EventType.attestation]: phase0.Attestation;
[EventType.attestation]: {version: ForkName; data: allForks.Attestation};
[EventType.voluntaryExit]: phase0.SignedVoluntaryExit;
[EventType.proposerSlashing]: phase0.ProposerSlashing;
[EventType.attesterSlashing]: phase0.AttesterSlashing;
[EventType.attesterSlashing]: {version: ForkName; data: allForks.AttesterSlashing};
[EventType.blsToExecutionChange]: capella.SignedBLSToExecutionChange;
[EventType.finalizedCheckpoint]: {
block: RootHex;
Expand Down Expand Up @@ -180,10 +180,10 @@ export function getTypeByEvent(): {[K in EventType]: TypeJson<EventData[K]>} {
{jsonCase: "eth2"}
),

[EventType.attestation]: ssz.phase0.Attestation,
[EventType.attestation]: WithVersion((fork) => ssz.allForks[fork].Attestation),
[EventType.voluntaryExit]: ssz.phase0.SignedVoluntaryExit,
[EventType.proposerSlashing]: ssz.phase0.ProposerSlashing,
[EventType.attesterSlashing]: ssz.phase0.AttesterSlashing,
[EventType.attesterSlashing]: WithVersion((fork) => ssz.allForks[fork].AttesterSlashing),
[EventType.blsToExecutionChange]: ssz.capella.SignedBLSToExecutionChange,

[EventType.finalizedCheckpoint]: new ContainerType(
Expand Down
36 changes: 25 additions & 11 deletions packages/api/src/beacon/routes/validator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {ContainerType, fromHexString, toHexString, Type} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {ForkName, ForkBlobs, isForkBlobs, isForkExecution, ForkPreBlobs, ForkExecution} from "@lodestar/params";
import {
allForks,
Expand Down Expand Up @@ -338,10 +339,11 @@ export type Api = {
*/
getAggregatedAttestation(
attestationDataRoot: Root,
slot: Slot
slot: Slot,
index: CommitteeIndex
): Promise<
ApiClientResponse<
{[HttpStatusCode.OK]: {data: phase0.Attestation}},
{[HttpStatusCode.OK]: {data: allForks.Attestation; version: ForkName}},
HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND
>
>;
Expand All @@ -354,7 +356,7 @@ export type Api = {
* @throws ApiError
*/
publishAggregateAndProofs(
signedAggregateAndProofs: phase0.SignedAggregateAndProof[]
signedAggregateAndProofs: allForks.SignedAggregateAndProof[] // TODO Electra: Add version
): Promise<ApiClientResponse<{[HttpStatusCode.OK]: void}, HttpStatusCode.BAD_REQUEST>>;

publishContributionAndProofs(
Expand Down Expand Up @@ -498,8 +500,8 @@ export type ReqTypes = {
produceBlindedBlock: {params: {slot: number}; query: {randao_reveal: string; graffiti: string}};
produceAttestationData: {query: {slot: number; committee_index: number}};
produceSyncCommitteeContribution: {query: {slot: number; subcommittee_index: number; beacon_block_root: string}};
getAggregatedAttestation: {query: {attestation_data_root: string; slot: number}};
publishAggregateAndProofs: {body: unknown};
getAggregatedAttestation: {query: {attestation_data_root: string; slot: number; index: number}};
publishAggregateAndProofs: {body: unknown; headers: {"eth-consensus-version": ForkName}};
publishContributionAndProofs: {body: unknown};
prepareBeaconCommitteeSubnet: {body: unknown};
prepareSyncCommitteeSubnets: {body: unknown};
Expand Down Expand Up @@ -529,7 +531,7 @@ const SyncCommitteeSelection = new ContainerType(
{jsonCase: "eth2"}
);

export function getReqSerializers(): ReqSerializers<Api, ReqTypes> {
export function getReqSerializers(config: ChainForkConfig): ReqSerializers<Api, ReqTypes> {
const BeaconCommitteeSubscription = new ContainerType(
{
validatorIndex: ssz.ValidatorIndex,
Expand Down Expand Up @@ -647,14 +649,26 @@ export function getReqSerializers(): ReqSerializers<Api, ReqTypes> {
},

getAggregatedAttestation: {
writeReq: (root, slot) => ({query: {attestation_data_root: toHexString(root), slot}}),
parseReq: ({query}) => [fromHexString(query.attestation_data_root), query.slot],
writeReq: (root, slot, index) => ({query: {attestation_data_root: toHexString(root), slot, index}}),
parseReq: ({query}) => [fromHexString(query.attestation_data_root), query.slot, query.index],
schema: {
query: {attestation_data_root: Schema.StringRequired, slot: Schema.UintRequired},
query: {attestation_data_root: Schema.StringRequired, slot: Schema.UintRequired, index: Schema.UintRequired},
},
},

publishAggregateAndProofs: reqOnlyBody(ArrayOf(ssz.phase0.SignedAggregateAndProof), Schema.ObjectArray),
publishAggregateAndProofs: {
writeReq: (signedAggregateAndProofs) => {
const fork = config.getForkName(signedAggregateAndProofs[0].message.aggregate.data.slot);
return {
body: ArrayOf(ssz.allForks[fork].SignedAggregateAndProof).toJson(signedAggregateAndProofs),
headers: {"eth-consensus-version": fork},
};
},
parseReq: ({body, headers}) => [
ArrayOf(ssz.allForks[headers["eth-consensus-version"]].SignedAggregateAndProof).fromJson(body),
],
schema: {body: Schema.ObjectArray},
},
publishContributionAndProofs: reqOnlyBody(ArrayOf(ssz.altair.SignedContributionAndProof), Schema.ObjectArray),
prepareBeaconCommitteeSubnet: reqOnlyBody(ArrayOf(BeaconCommitteeSubscription), Schema.ObjectArray),
prepareSyncCommitteeSubnets: reqOnlyBody(ArrayOf(SyncCommitteeSubscription), Schema.ObjectArray),
Expand Down Expand Up @@ -786,7 +800,7 @@ export function getReturnTypes(): ReturnTypes<Api> {

produceAttestationData: ContainerData(ssz.phase0.AttestationData),
produceSyncCommitteeContribution: ContainerData(ssz.altair.SyncCommitteeContribution),
getAggregatedAttestation: ContainerData(ssz.phase0.Attestation),
getAggregatedAttestation: WithVersion((fork) => ssz.allForks[fork].Attestation),
submitBeaconCommitteeSelections: ContainerData(ArrayOf(BeaconCommitteeSelection)),
submitSyncCommitteeSelections: ContainerData(ArrayOf(SyncCommitteeSelection)),
getLiveness: jsonType("snake"),
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/beacon/server/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ServerRoutes, getGenericJsonServer} from "../../utils/server/index.js";
import {ServerApi} from "../../interfaces.js";

export function getRoutes(config: ChainForkConfig, api: ServerApi<Api>): ServerRoutes<Api, ReqTypes> {
const reqSerializers = getReqSerializers();
const reqSerializers = getReqSerializers(config);
const returnTypes = getReturnTypes();

// Most of routes return JSON, use a server auto-generator
Expand Down
2 changes: 1 addition & 1 deletion packages/api/test/unit/beacon/oapiSpec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const reqSerializers = {
...routes.lightclient.getReqSerializers(),
...routes.node.getReqSerializers(),
...routes.proof.getReqSerializers(),
...routes.validator.getReqSerializers(),
...routes.validator.getReqSerializers(config),
};

const returnTypes = {
Expand Down
98 changes: 52 additions & 46 deletions packages/api/test/unit/beacon/testData/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,21 @@ export const eventTestData: EventData = {
block: "0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf",
executionOptimistic: false,
},
[EventType.attestation]: ssz.phase0.Attestation.fromJson({
aggregation_bits: "0x01",
signature:
"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
data: {
slot: "1",
index: "1",
beacon_block_root: "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
source: {epoch: "1", root: "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"},
target: {epoch: "1", root: "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"},
},
}),
[EventType.attestation]: {
version: ForkName.altair,
data: ssz.phase0.Attestation.fromJson({
aggregation_bits: "0x01",
signature:
"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
data: {
slot: "1",
index: "1",
beacon_block_root: "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
source: {epoch: "1", root: "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"},
target: {epoch: "1", root: "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"},
},
}),
},
[EventType.voluntaryExit]: ssz.phase0.SignedVoluntaryExit.fromJson({
message: {epoch: "1", validator_index: "1"},
signature:
Expand Down Expand Up @@ -72,44 +75,47 @@ export const eventTestData: EventData = {
"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
},
}),
[EventType.attesterSlashing]: ssz.phase0.AttesterSlashing.fromJson({
attestation_1: {
attesting_indices: ["0", "1"],
data: {
slot: "0",
index: "0",
beacon_block_root: "0x0000000000000000000000000000000000000000000000000000000000000000",
source: {
epoch: "0",
root: "0x0000000000000000000000000000000000000000000000000000000000000000",
},
target: {
epoch: "0",
root: "0x0000000000000000000000000000000000000000000000000000000000000000",
[EventType.attesterSlashing]: {
version: ForkName.altair,
data: ssz.phase0.AttesterSlashing.fromJson({
attestation_1: {
attesting_indices: ["0", "1"],
data: {
slot: "0",
index: "0",
beacon_block_root: "0x0000000000000000000000000000000000000000000000000000000000000000",
source: {
epoch: "0",
root: "0x0000000000000000000000000000000000000000000000000000000000000000",
},
target: {
epoch: "0",
root: "0x0000000000000000000000000000000000000000000000000000000000000000",
},
},
signature:
"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
},
signature:
"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
},
attestation_2: {
attesting_indices: ["0", "1"],
data: {
slot: "0",
index: "0",
beacon_block_root: "0x0000000000000000000000000000000000000000000000000000000000000000",
source: {
epoch: "0",
root: "0x0000000000000000000000000000000000000000000000000000000000000000",
},
target: {
epoch: "0",
root: "0x0000000000000000000000000000000000000000000000000000000000000000",
attestation_2: {
attesting_indices: ["0", "1"],
data: {
slot: "0",
index: "0",
beacon_block_root: "0x0000000000000000000000000000000000000000000000000000000000000000",
source: {
epoch: "0",
root: "0x0000000000000000000000000000000000000000000000000000000000000000",
},
target: {
epoch: "0",
root: "0x0000000000000000000000000000000000000000000000000000000000000000",
},
},
signature:
"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
},
signature:
"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
},
}),
}),
},
[EventType.blsToExecutionChange]: ssz.capella.SignedBLSToExecutionChange.fromJson({
message: {
validator_index: "1",
Expand Down
7 changes: 5 additions & 2 deletions packages/api/test/unit/beacon/testData/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@ export const testData: GenericServerTestCases<Api> = {
res: {data: ssz.altair.SyncCommitteeContribution.defaultValue()},
},
getAggregatedAttestation: {
args: [ZERO_HASH, 32000],
res: {data: ssz.phase0.Attestation.defaultValue()},
args: [ZERO_HASH, 32000, 2],
res: {
data: ssz.phase0.Attestation.defaultValue(),
version: ForkName.altair,
},
},
publishAggregateAndProofs: {
args: [[ssz.phase0.SignedAggregateAndProof.defaultValue()]],
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
8 changes: 4 additions & 4 deletions packages/beacon-node/src/api/impl/beacon/pool/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {routes, ServerApi} from "@lodestar/api";
import {Epoch, ssz} from "@lodestar/types";
import {SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
import {ForkName, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
import {validateApiAttestation} from "../../../../chain/validation/index.js";
import {validateApiAttesterSlashing} from "../../../../chain/validation/attesterSlashing.js";
import {validateApiProposerSlashing} from "../../../../chain/validation/proposerSlashing.js";
Expand Down Expand Up @@ -64,7 +64,7 @@ export function getBeaconPoolApi({
// when a validator is configured with multiple beacon node urls, this attestation data may come from another beacon node
// and the block hasn't been in our forkchoice since we haven't seen / processing that block
// see https://github.com/ChainSafe/lodestar/issues/5098
const {indexedAttestation, subnet, attDataRootHex} = await validateGossipFnRetryUnknownRoot(
const {indexedAttestation, subnet, attDataRootHex, committeeIndex} = await validateGossipFnRetryUnknownRoot(
validateFn,
network,
chain,
Expand All @@ -73,11 +73,11 @@ export function getBeaconPoolApi({
);

if (network.shouldAggregate(subnet, slot)) {
const insertOutcome = chain.attestationPool.add(attestation, attDataRootHex);
const insertOutcome = chain.attestationPool.add(committeeIndex, attestation, attDataRootHex);
metrics?.opPool.attestationPoolInsertOutcome.inc({insertOutcome});
}

chain.emitter.emit(routes.events.EventType.attestation, attestation);
chain.emitter.emit(routes.events.EventType.attestation, {data: attestation, version: ForkName.phase0});

const sentPeers = await network.publishBeaconAttestation(attestation, subnet);
metrics?.onPoolSubmitUnaggregatedAttestation(seenTimestampSec, indexedAttestation, subnet, sentPeers);
Expand Down