Skip to content

Commit

Permalink
Upgrade to spec 1.1.6 sans proposer boost (#3608)
Browse files Browse the repository at this point in the history
* Upgrade to spec 1.1.6 sans proposer boost

* placeholder for merge/transition tests
  • Loading branch information
g11tech authored Jan 12, 2022
1 parent 87639f8 commit e6ccab3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 17 deletions.
15 changes: 2 additions & 13 deletions packages/fork-choice/src/forkChoice/forkChoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {ProtoArray} from "../protoArray/protoArray";
import {IForkChoiceMetrics} from "../metrics";
import {ForkChoiceError, ForkChoiceErrorCode, InvalidBlockCode, InvalidAttestationCode} from "./errors";
import {IForkChoice, ILatestMessage, IQueuedAttestation, OnBlockPrecachedData} from "./interface";
import {IForkChoiceStore, CheckpointWithHex, toCheckpointWithHex, equalCheckpointWithHex} from "./store";
import {IForkChoiceStore, CheckpointWithHex, toCheckpointWithHex} from "./store";

/* eslint-disable max-len */

Expand Down Expand Up @@ -329,19 +329,8 @@ export class ForkChoice implements IForkChoice {
// Update finalized checkpoint.
if (finalizedCheckpoint.epoch > this.fcStore.finalizedCheckpoint.epoch) {
this.fcStore.finalizedCheckpoint = toCheckpointWithHex(finalizedCheckpoint);
shouldUpdateJustified = true;
this.synced = false;

if (
// If checkpoints are not equal
(!equalCheckpointWithHex(this.fcStore.justifiedCheckpoint, currentJustifiedCheckpoint) &&
stateJustifiedEpoch > this.fcStore.justifiedCheckpoint.epoch) ||
this.getAncestor(
this.fcStore.justifiedCheckpoint.rootHex,
computeStartSlotAtEpoch(this.fcStore.finalizedCheckpoint.epoch)
) !== this.fcStore.finalizedCheckpoint.rootHex
) {
shouldUpdateJustified = true;
}
}

// This needs to be performed after finalized checkpoint has been updated
Expand Down
5 changes: 5 additions & 0 deletions packages/lodestar/test/spec/allForks/forkChoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ export function forkChoiceTest(fork: ForkName): void {
timeout: 10000,
// eslint-disable-next-line @typescript-eslint/no-empty-function
expectFunc: () => {},
shouldSkip: (_testCase, name, _index) => {
const ignoreTestsWithKeywords = ["proposer_boost"];
const ignoreTest = ignoreTestsWithKeywords.reduce((acc, kword) => acc || name.includes(kword), false);
return ignoreTest;
},
}
);
}
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion packages/lodestar/test/spec/specTestVersioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import path from "path";
// The contents of this file MUST include the URL, version and target path, and nothing else.

export const SPEC_TEST_REPO_URL = "https://github.com/ethereum/consensus-spec-tests";
export const SPEC_TEST_VERSION = "v1.1.5";
export const SPEC_TEST_VERSION = "v1.1.6";
// Target directory is the host package root: 'packages/*/spec-tests'
export const SPEC_TEST_LOCATION = path.join(__dirname, "../../spec-tests");
2 changes: 0 additions & 2 deletions packages/types/src/merge/sszTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,11 @@ export const PowBlock = new ContainerType<merge.PowBlock>({
blockHash: Root,
parentHash: Root,
totalDifficulty: Uint256,
difficulty: Uint256,
},
casingMap: {
blockHash: "block_hash",
parentHash: "parent_hash",
totalDifficulty: "total_difficulty",
difficulty: "difficulty",
},
});

Expand Down
1 change: 0 additions & 1 deletion packages/types/src/merge/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ export type PowBlock = {
blockHash: Root;
parentHash: Root;
totalDifficulty: bigint;
difficulty: bigint;
};

0 comments on commit e6ccab3

Please sign in to comment.