Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ensi321 committed Sep 21, 2024
1 parent a26e140 commit 9389539
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ export async function verifyBlockExecutionPayload(
? (block.message.body as deneb.BeaconBlockBody).blobKzgCommitments.map(kzgCommitmentToVersionedHash)
: undefined;
const parentBlockRoot = ForkSeq[fork] >= ForkSeq.deneb ? block.message.parentRoot : undefined;
const executionRequests = ForkSeq[fork] >= ForkSeq.electra ? (block.message.body as electra.BeaconBlockBody).executionRequests : undefined;
const executionRequests =
ForkSeq[fork] >= ForkSeq.electra ? (block.message.body as electra.BeaconBlockBody).executionRequests : undefined;

const logCtx = {slot: block.message.slot, executionBlock: executionPayloadEnabled.blockNumber};
chain.logger.debug("Call engine api newPayload", logCtx);
Expand All @@ -311,7 +312,7 @@ export async function verifyBlockExecutionPayload(
executionPayloadEnabled,
versionedHashes,
parentBlockRoot,
executionRequests,
executionRequests
);
chain.logger.debug("Receive engine api newPayload result", {...logCtx, status: execResult.status});

Expand Down
4 changes: 2 additions & 2 deletions packages/beacon-node/src/execution/engine/http.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ExecutionPayload, ExecutionRequests, Root, RootHex, Wei} from "@lodestar/types";
import {SLOTS_PER_EPOCH, ForkName, ForkSeq, isForkPostElectra} from "@lodestar/params";
import {SLOTS_PER_EPOCH, ForkName, ForkSeq} from "@lodestar/params";
import {Logger} from "@lodestar/logger";
import {
ErrorJsonRpcResponse,
Expand Down Expand Up @@ -409,7 +409,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
executionPayload: ExecutionPayload;
executionPayloadValue: Wei;
blobsBundle?: BlobsBundle;
executionRequests?: ExecutionRequests,
executionRequests?: ExecutionRequests;
shouldOverrideBuilder?: boolean;
}> {
const method =
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/execution/engine/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export interface IExecutionEngine {
executionPayload: ExecutionPayload;
executionPayloadValue: Wei;
blobsBundle?: BlobsBundle;
executionRequests?: ExecutionRequests,
executionRequests?: ExecutionRequests;
shouldOverrideBuilder?: boolean;
}>;

Expand Down
4 changes: 0 additions & 4 deletions packages/beacon-node/src/execution/engine/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ export function serializeExecutionPayload(fork: ForkName, data: ExecutionPayload
}

// No changes in Electra
if (ForkSeq[fork] >= ForkSeq.electra) {
}

return payload;
}
Expand Down Expand Up @@ -344,8 +342,6 @@ export function parseExecutionPayload(
}

// No changes in Electra
if (ForkSeq[fork] >= ForkSeq.electra) {
}

return {executionPayload, executionPayloadValue, blobsBundle, executionRequests, shouldOverrideBuilder};
}
Expand Down
7 changes: 4 additions & 3 deletions packages/beacon-node/test/sim/electra-interop.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ describe("executionEngine / ExecutionEngineHttp", function () {
await sleep(1000);
const payloadAndBlockValue = await executionEngine.getPayload(ForkName.electra, payloadId2);
const payload = payloadAndBlockValue.executionPayload as electra.ExecutionPayload;
const depositRequests = payloadAndBlockValue.executionRequests?.deposits;

if (payload.transactions.length !== 1) {
throw Error(`Number of transactions mismatched. Expected: 1, actual: ${payload.transactions.length}`);
Expand All @@ -219,11 +220,11 @@ describe("executionEngine / ExecutionEngineHttp", function () {
}
}

if (payload.depositRequests.length !== 1) {
throw Error(`Number of depositRequests mismatched. Expected: 1, actual: ${payload.depositRequests.length}`);
if (depositRequests === undefined || depositRequests.length !== 1) {
throw Error(`Number of depositRequests mismatched. Expected: 1, actual: ${depositRequests?.length}`);
}

const actualDepositRequest = payload.depositRequests[0];
const actualDepositRequest = depositRequests[0];
assert.deepStrictEqual(
actualDepositRequest,
depositRequestB,
Expand Down

0 comments on commit 9389539

Please sign in to comment.