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

Upgrade to spec 1.1.6 sans proposer boost #3608

Merged
merged 2 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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"];
Copy link
Contributor Author

@g11tech g11tech Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This skip will be removed with the PR:#3540, has been added as part of strategy to update the spec version in easier manageable PRs

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;
};