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

chore: release v1.24.0 #7325

Merged
merged 51 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift click to select a range
99c0dcb
feat: add keymanager endpoint to retrieve proposer config (#7210)
nflaig Oct 30, 2024
794e5ef
feat: add mekong network option (#7212)
nflaig Nov 1, 2024
06b4c2d
chore: fix import order with biome syntax (#7211)
nazarhussain Nov 1, 2024
07d1145
fix: consistently validate pubkey and throw 404 if not found (#7214)
nflaig Nov 3, 2024
abe6751
fix: only return local keys from /eth/v1/keystores (#7215)
nflaig Nov 3, 2024
2e5265b
feat: add and use getBlobsV1 to expedite gossip import (#7134)
g11tech Nov 3, 2024
e2c45b9
chore: revert async aggregate with randomness (#7218)
matthewkeil Nov 7, 2024
2e8b8bb
fix: update config for relaunched mekong network (#7220)
nflaig Nov 8, 2024
10d15dc
fix: light client generating `LightClientUpdate` with wrong length of…
ensi321 Nov 8, 2024
0d404f8
fix: archive finalized state when shutting down beacon node (#7221)
nflaig Nov 8, 2024
6039f58
Merge branch 'stable' into unstable
nflaig Nov 11, 2024
1fae968
Fix typo
ensi321 Nov 17, 2024
25c2ee5
chore: several typos from bots (#7228)
nflaig Nov 17, 2024
b78cb92
feat: remove unfinalized pubkey cache (#7230)
ensi321 Nov 25, 2024
18f4218
chore: skip web3_provider unit tests (#7252)
nflaig Nov 27, 2024
e86e816
fix: prune checkpoint states at syncing time (#7241)
twoeths Nov 27, 2024
443e3a8
fix: sync cached isCompoundingValidatorArr at epoch transition (#7247)
twoeths Nov 27, 2024
0c1ad93
fix: handle outOfRangeData when range sync Deneb (#7249)
twoeths Nov 27, 2024
48dea55
fix: sync cached balance when adding new validator to registry (#7255)
twoeths Nov 28, 2024
aaac34a
fix: do not throw error when trying to prune missing directory (#7257)
nflaig Nov 29, 2024
c9af6c3
docs: update documentation Oct 2024 (#7178)
philknows Nov 29, 2024
dc4f36d
Merge branch 'stable' into unstable
nflaig Nov 29, 2024
8922d55
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /docs (#7268)
dependabot[bot] Nov 29, 2024
64eb015
feat: add error log to notifier if execution client auth failed (#7239)
nflaig Dec 2, 2024
84e0699
docs: display rcConfig flag on CLI reference page (#7270)
nflaig Dec 3, 2024
376fe2a
chore: remove prettier as default formatter for all file types (#7275)
nflaig Dec 3, 2024
37c4287
chore: unhide flags relevant for devnets / testing (#7271)
nflaig Dec 3, 2024
dbe2188
feat: debug too many shuffling promises (#7251)
matthewkeil Dec 4, 2024
69ae688
chore: unpin nodejs version from 22.4 (#6982)
nazarhussain Dec 4, 2024
b5fb76c
chore: update bootnodes file url for holesky and sepolia (#7276)
nflaig Dec 5, 2024
d55bb2d
feat: add `debug_getHistoricalSummaries` endpoint (#7245)
acolytec3 Dec 5, 2024
86ed6f4
chore: log sync committee signature errors as `error` (#7283)
nflaig Dec 6, 2024
cd1211f
fix: update engine_getClientVersionV1 commit encoding (#7282)
nflaig Dec 6, 2024
e353f67
fix: check pubkey or validator index known to a state (#7284)
twoeths Dec 6, 2024
f87eb0b
feat: lodestar script setup (#7254)
varunguleriaCodes Dec 6, 2024
dad9037
feat: add terminal-sized Electra giraffe banner (#7286)
ClockworkYuzu Dec 6, 2024
99794d3
chore: pin nodejs version to 22.4 (#7291)
wemeetagain Dec 12, 2024
879f99b
feat: expose `DOMAIN_APPLICATION_MASK` in config/spec api (#7296)
nflaig Dec 13, 2024
30c669b
feat: make `MAX_REQUEST_BLOB_SIDECARS` and `MAX_BLOBS_PER_BLOCK` conf…
ensi321 Dec 13, 2024
a00c796
feat: use `BLOB_SIDECAR_SUBNET_COUNT` to configure blob subnets (#7297)
nflaig Dec 14, 2024
ba1d41b
chore: log sync aggregate participants when producing beacon block bo…
nflaig Dec 15, 2024
3f3c7fc
chore: print graffiti when producing beacon block body (#7303)
nflaig Dec 16, 2024
c290469
fix: warn if engine / builder failed to produce block within cutoff t…
nflaig Dec 17, 2024
7cd296b
feat: add kzg commitment length check when validating gossip blocks (…
ensi321 Dec 17, 2024
bfe54d2
feat: add blob sidecar index check (#7313)
ensi321 Dec 19, 2024
1f38c8b
fix: fix blob sidecar index check (#7315)
ensi321 Dec 19, 2024
8c7eaf8
chore: fix format of printed graffiti from hex to utf-8 (#7306)
nflaig Dec 19, 2024
ffdfb2e
docs: batch commit typos and update contributor readme (#7312)
philknows Dec 19, 2024
6d20fe8
chore: remove trailing null bytes from printed graffiti (#7320)
nflaig Dec 20, 2024
d25018a
chore: unpin nodejs version from 22.4 (#7324)
nflaig Dec 20, 2024
ca315d4
chore: bump package versions to 1.24.0
wemeetagain Dec 20, 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
Prev Previous commit
Next Next commit
feat: add kzg commitment length check when validating gossip blocks (#…
  • Loading branch information
ensi321 authored Dec 17, 2024
commit 7cd296b0466f75136cbf544aaec5ce000c89a8ed
5 changes: 4 additions & 1 deletion packages/beacon-node/src/chain/errors/blockError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 64,8 @@ export enum BlockErrorCode {
TOO_MANY_SKIPPED_SLOTS = "TOO_MANY_SKIPPED_SLOTS",
/** The blobs are unavailable */
DATA_UNAVAILABLE = "BLOCK_ERROR_DATA_UNAVAILABLE",
/** Block contains too many kzg commitments */
TOO_MANY_KZG_COMMITMENTS = "BLOCK_ERROR_TOO_MANY_KZG_COMMITMENTS",
}

type ExecutionErrorStatus = Exclude<
Expand Down Expand Up @@ -105,7 107,8 @@ export type BlockErrorType =
| {code: BlockErrorCode.SAME_PARENT_HASH; blockHash: RootHex}
| {code: BlockErrorCode.TRANSACTIONS_TOO_BIG; size: number; max: number}
| {code: BlockErrorCode.EXECUTION_ENGINE_ERROR; execStatus: ExecutionErrorStatus; errorMessage: string}
| {code: BlockErrorCode.DATA_UNAVAILABLE};
| {code: BlockErrorCode.DATA_UNAVAILABLE}
| {code: BlockErrorCode.TOO_MANY_KZG_COMMITMENTS; blobKzgCommitmentsLen: number; commitmentLimit: number};

export class BlockGossipError extends GossipActionError<BlockErrorType> {}

Expand Down
16 changes: 14 additions & 2 deletions packages/beacon-node/src/chain/validation/block.ts
Original file line number Diff line number Diff line change
@@ -1,5 1,5 @@
import {ChainForkConfig} from "@lodestar/config";
import {ForkName} from "@lodestar/params";
import {ForkName, isForkBlobs} from "@lodestar/params";
import {
computeStartSlotAtEpoch,
computeTimeAtSlot,
Expand All @@ -8,7 8,7 @@ import {
isExecutionEnabled,
isExecutionStateType,
} from "@lodestar/state-transition";
import {SignedBeaconBlock} from "@lodestar/types";
import {SignedBeaconBlock, deneb} from "@lodestar/types";
import {sleep, toRootHex} from "@lodestar/utils";
import {MAXIMUM_GOSSIP_CLOCK_DISPARITY} from "../../constants/index.js";
import {BlockErrorCode, BlockGossipError, GossipAction} from "../errors/index.js";
Expand Down Expand Up @@ -110,6 110,18 @@ export async function validateGossipBlock(
});
}

// [REJECT] The length of KZG commitments is less than or equal to the limitation defined in Consensus Layer -- i.e. validate that len(body.signed_beacon_block.message.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK
if (isForkBlobs(fork)) {
const blobKzgCommitmentsLen = (block as deneb.BeaconBlock).body.blobKzgCommitments.length;
if (blobKzgCommitmentsLen > chain.config.MAX_BLOBS_PER_BLOCK) {
throw new BlockGossipError(GossipAction.REJECT, {
code: BlockErrorCode.TOO_MANY_KZG_COMMITMENTS,
blobKzgCommitmentsLen,
commitmentLimit: chain.config.MAX_BLOBS_PER_BLOCK,
});
}
}

// use getPreState to reload state if needed. It also checks for whether the current finalized checkpoint is an ancestor of the block.
// As a result, we throw an IGNORE (whereas the spec says we should REJECT for this scenario).
// this is something we should change this in the future to make the code airtight to the spec.
Expand Down
47 changes: 44 additions & 3 deletions packages/beacon-node/test/unit/chain/validation/block.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
import {config} from "@lodestar/config/default";
import {ProtoBlock} from "@lodestar/fork-choice";
import {ForkName} from "@lodestar/params";
import {ForkBlobs, ForkName} from "@lodestar/params";
import {SignedBeaconBlock, ssz} from "@lodestar/types";
import {Mock, Mocked, beforeEach, describe, it, vi} from "vitest";
import {BlockErrorCode} from "../../../../src/chain/errors/index.js";
Expand All @@ -20,12 20,15 @@ describe("gossip block validation", () => {
let job: SignedBeaconBlock;
const proposerIndex = 0;
const clockSlot = 32;
const block = ssz.phase0.BeaconBlock.defaultValue();
const block = ssz.deneb.BeaconBlock.defaultValue();
block.slot = clockSlot;
const signature = EMPTY_SIGNATURE;
const maxSkipSlots = 10;

beforeEach(() => {
// Fill up with kzg commitments
block.body.blobKzgCommitments = Array.from({length: config.MAX_BLOBS_PER_BLOCK}, () => new Uint8Array([0]));

chain = getMockedBeaconChain();
vi.spyOn(chain.clock, "currentSlotWithGossipDisparity", "get").mockReturnValue(clockSlot);
forkChoice = chain.forkChoice;
Expand Down Expand Up @@ -184,9 187,47 @@ describe("gossip block validation", () => {
regen.getPreState.mockResolvedValue(state);
// BLS signature verifier returns valid
verifySignature.mockResolvedValue(true);
// Force proposer shuffling cache to return wrong value
// Force proposer shuffling cache to return correct value
vi.spyOn(state.epochCtx, "getBeaconProposer").mockReturnValue(proposerIndex);

await validateGossipBlock(config, chain, job, ForkName.phase0);
});

it("deneb - TOO_MANY_KZG_COMMITMENTS", async () => {
// Return not known for proposed block
forkChoice.getBlockHex.mockReturnValueOnce(null);
// Returned parent block is latter than proposed block
forkChoice.getBlockHex.mockReturnValueOnce({slot: clockSlot - 1} as ProtoBlock);
// Regen returns some state
const state = generateCachedState();
regen.getPreState.mockResolvedValue(state);
// BLS signature verifier returns valid
verifySignature.mockResolvedValue(true);
// Force proposer shuffling cache to return correct value
vi.spyOn(state.epochCtx, "getBeaconProposer").mockReturnValue(proposerIndex 1);
// Add one extra kzg commitment in the block so it goes over the limit
(job as SignedBeaconBlock<ForkBlobs>).message.body.blobKzgCommitments.push(new Uint8Array([0]));

await expectRejectedWithLodestarError(
validateGossipBlock(config, chain, job, ForkName.deneb),
BlockErrorCode.TOO_MANY_KZG_COMMITMENTS
);
});

it("deneb - valid", async () => {
// Return not known for proposed block
forkChoice.getBlockHex.mockReturnValueOnce(null);
// Returned parent block is latter than proposed block
forkChoice.getBlockHex.mockReturnValueOnce({slot: clockSlot - 1} as ProtoBlock);
// Regen returns some state
const state = generateCachedState();
regen.getPreState.mockResolvedValue(state);
// BLS signature verifier returns valid
verifySignature.mockResolvedValue(true);
// Force proposer shuffling cache to return correct value
vi.spyOn(state.epochCtx, "getBeaconProposer").mockReturnValue(proposerIndex);
// Keep number of kzg commitments as is so it stays within the limit

await validateGossipBlock(config, chain, job, ForkName.deneb);
});
});
Loading