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

Fix engine-cancun hive tests #3308

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions packages/client/src/rpc/error-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const INTERNAL_ERROR = -32603
export const TOO_LARGE_REQUEST = -38004
export const UNSUPPORTED_FORK = -38005
export const UNKNOWN_PAYLOAD = -32001
export const INVALID_FORKCHOICE_STATE = -38002

export const validEngineCodes = [
PARSE_ERROR,
Expand Down
9 changes: 5 additions & 4 deletions packages/client/src/service/skeleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
zeros,
} from '@ethereumjs/util'

import { INVALID_FORKCHOICE_STATE } from '../rpc/error-code'
import { short, timeDuration } from '../util'
import { DBKey, MetaDBManager } from '../util/metaDBManager'

Expand Down Expand Up @@ -750,7 +751,7 @@ export class Skeleton extends MetaDBManager {
if (this.status.linked || shouldBeSafeNumber >= subchain0.tail) {
if (safeBlock === undefined) {
throw {
code: INVALID_PARAMS,
code: INVALID_FORKCHOICE_STATE,
message: `safe block not available in canonical chain`,
}
} else {
Expand All @@ -760,7 +761,7 @@ export class Skeleton extends MetaDBManager {
!equalsBytes(safeBlock.hash(), canonicalBlock.hash())
) {
throw {
code: INVALID_PARAMS,
code: INVALID_FORKCHOICE_STATE,
message: `safe block not canonical in chain`,
}
}
Expand All @@ -770,7 +771,7 @@ export class Skeleton extends MetaDBManager {
if (this.status.linked || shouldBeFinalizedNumber >= subchain0.tail) {
if (finalizedBlock === undefined) {
throw {
code: INVALID_PARAMS,
code: INVALID_FORKCHOICE_STATE,
message: `finalized block not available in canonical chain`,
}
} else {
Expand All @@ -780,7 +781,7 @@ export class Skeleton extends MetaDBManager {
!equalsBytes(finalizedBlock.hash(), canonicalBlock.hash())
) {
throw {
code: INVALID_PARAMS,
code: INVALID_FORKCHOICE_STATE,
message: `finalized block not canonical in chain`,
}
}
Expand Down