diff --git a/packages/beacon-node/src/chain/errors/inclusionList.ts b/packages/beacon-node/src/chain/errors/inclusionList.ts index 13433306d02..b36d6a158f1 100644 --- a/packages/beacon-node/src/chain/errors/inclusionList.ts +++ b/packages/beacon-node/src/chain/errors/inclusionList.ts @@ -7,7 +7,6 @@ export enum InclusionListErrorCode { NOT_TIMELY = "INCLUSION_LIST_ERROR_NOT_TIMELY", INVALID_COMMITTEE_ROOT = "INCLUSION_LIST_ERROR_INVALID_COMMITTEE_ROOT", VALIDATOR_NOT_IN_COMMITTEE = "INCLUSION_LIST_ERROR_VALIDATOR_NOT_IN_COMMITTEE", - TOO_MANY_TRANSACTIONS = "INCLUSION_LIST_ERROR_TOO_MANY_TRANSACTIONS", SPAM = "INCLUSION_LIST_ERROR_SPAM", INVALID_SIGNATURE = "INCLUSION_LIST_ERROR_INVALID_SIGNATURE", MORE_THAN_TWO = "INCLUSION_LIST_ERROR_MORE_THAN_TWO", @@ -18,7 +17,6 @@ export type InclusionListErrorType = | {code: InclusionListErrorCode.NOT_TIMELY} | {code: InclusionListErrorCode.INVALID_COMMITTEE_ROOT} | {code: InclusionListErrorCode.VALIDATOR_NOT_IN_COMMITTEE} - | {code: InclusionListErrorCode.TOO_MANY_TRANSACTIONS; numTransactions: number; transactionLimit: number} | {code: InclusionListErrorCode.SPAM} | {code: InclusionListErrorCode.INVALID_SIGNATURE} | {code: InclusionListErrorCode.MORE_THAN_TWO; validatorIndex: ValidatorIndex}; diff --git a/packages/beacon-node/src/chain/opPools/inclusionListPool.ts b/packages/beacon-node/src/chain/opPools/inclusionListPool.ts index 7275d9b3bef..7fc39590ff3 100644 --- a/packages/beacon-node/src/chain/opPools/inclusionListPool.ts +++ b/packages/beacon-node/src/chain/opPools/inclusionListPool.ts @@ -1,6 +1,6 @@ import {ChainForkConfig} from "@lodestar/config"; import {INCLUSION_LIST_COMMITTEE_SIZE} from "@lodestar/params"; -import {Slot, ValidatorIndex, focil} from "@lodestar/types"; +import {Slot, ValidatorIndex, bellatrix, focil} from "@lodestar/types"; import {MapDef} from "@lodestar/utils"; import {byteArrayEquals} from "../../util/bytes.js"; import {IClock} from "../../util/clock.js"; @@ -20,7 +20,7 @@ const SLOTS_RETAINED = 2; // TODO FOCIL: do we even need to retain previous slot const MAX_INCLUSION_LISTS_PER_SLOT = INCLUSION_LIST_COMMITTEE_SIZE * 2; type CachedInclusionList = { - transactions: focil.InclusionListTransactions; + transactions: bellatrix.Transactions; seenTwice: boolean; }; @@ -95,8 +95,8 @@ export class InclusionListPool { /** * Return a list of unique inclusion list transactions for the given slot */ - getTransactions(slot: Slot): focil.InclusionListTransactions { - const uniqueTransactions: focil.InclusionListTransactions = []; + getTransactions(slot: Slot): bellatrix.Transactions { + const uniqueTransactions: bellatrix.Transactions = []; const inclusionListsByValidator = this.inclusionListByValidatorBySlot.get(slot); if (!inclusionListsByValidator) { diff --git a/packages/beacon-node/src/chain/validation/inclusionList.ts b/packages/beacon-node/src/chain/validation/inclusionList.ts index d2e7b7cf4d7..12d5c12a233 100644 --- a/packages/beacon-node/src/chain/validation/inclusionList.ts +++ b/packages/beacon-node/src/chain/validation/inclusionList.ts @@ -1,4 +1,3 @@ -import {MAX_TRANSACTIONS_PER_INCLUSION_LIST} from "@lodestar/params"; import {getInclusionListSignatureSet} from "@lodestar/state-transition"; import {focil} from "@lodestar/types"; import {InclusionListError, InclusionListErrorCode} from "../errors/inclusionList.js"; @@ -48,15 +47,6 @@ async function validateInclusionList(chain: IBeaconChain, inclusionList: focil.S // [REJECT] The validator index message.validator_index is within the inclusion_list_committee corresponding to message.inclusion_list_committee_root. - // [REJECT] The transactions message.transactions length is within upperbound MAX_TRANSACTIONS_PER_INCLUSION_LIST - if (transactions.length > MAX_TRANSACTIONS_PER_INCLUSION_LIST) { - throw new InclusionListError(GossipAction.REJECT, { - code: InclusionListErrorCode.TOO_MANY_TRANSACTIONS, - numTransactions: transactions.length, - transactionLimit: MAX_TRANSACTIONS_PER_INCLUSION_LIST, - }); - } - // TODO FOCIL: use a different cache similar to `seenAttesters` here? // [IGNORE] The message is either the first or second valid message received from the validator with index message.validator_index. if (chain.inclusionListPool.seenTwice(slot, validatorIndex)) { diff --git a/packages/params/src/index.ts b/packages/params/src/index.ts index 094cc645e1b..5a98f27b152 100644 --- a/packages/params/src/index.ts +++ b/packages/params/src/index.ts @@ -277,6 +277,3 @@ export const CONSOLIDATION_REQUEST_TYPE = 0x02; // focil export const INCLUSION_LIST_COMMITTEE_SIZE = 16; -// TODO FOCIL: same as `MAX_TRANSACTIONS_PER_PAYLOAD` for now but will likely -// be removed as we limit inclusion lists by bytes and not transaction count -export const MAX_TRANSACTIONS_PER_INCLUSION_LIST = 1048576; diff --git a/packages/types/src/focil/sszTypes.ts b/packages/types/src/focil/sszTypes.ts index 4d3bc62112c..f97c738414d 100644 --- a/packages/types/src/focil/sszTypes.ts +++ b/packages/types/src/focil/sszTypes.ts @@ -1,22 +1,17 @@ -import {BitVectorType, ContainerType, ListCompositeType} from "@chainsafe/ssz"; -import {INCLUSION_LIST_COMMITTEE_SIZE, MAX_TRANSACTIONS_PER_INCLUSION_LIST} from "@lodestar/params"; +import {BitVectorType, ContainerType} from "@chainsafe/ssz"; +import {INCLUSION_LIST_COMMITTEE_SIZE} from "@lodestar/params"; import {ssz as bellatrixSsz} from "../bellatrix/index.js"; import {ssz as electraSsz} from "../electra/index.js"; import {ssz as primitiveSsz} from "../primitive/index.js"; const {Slot, Root, BLSSignature, ValidatorIndex} = primitiveSsz; -export const InclusionListTransactions = new ListCompositeType( - bellatrixSsz.Transaction, - MAX_TRANSACTIONS_PER_INCLUSION_LIST -); - export const InclusionList = new ContainerType( { slot: Slot, validatorIndex: ValidatorIndex, inclusionListCommitteeRoot: Root, - transactions: InclusionListTransactions, + transactions: bellatrixSsz.Transactions, }, {typeName: "InclusionList", jsonCase: "eth2"} ); diff --git a/packages/types/src/focil/types.ts b/packages/types/src/focil/types.ts index e3e82990292..2b5fb96aa05 100644 --- a/packages/types/src/focil/types.ts +++ b/packages/types/src/focil/types.ts @@ -4,7 +4,6 @@ import * as ssz from "./sszTypes.js"; export type InclusionList = ValueOf; export type SignedInclusionList = ValueOf; export type InclusionListByCommitteeIndicesRequest = ValueOf; -export type InclusionListTransactions = ValueOf; export type BeaconState = ValueOf; export type BeaconBlockBody = ValueOf;