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

client: fixes for new engine api method validations for hive pr-834 #2973

Merged
merged 9 commits into from
Aug 22, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Aug 19, 2023

addresses the new validations added in

passes all engine-cancun tests:

image

@codecov
Copy link

codecov bot commented Aug 19, 2023

Codecov Report

Merging #2973 (bb93642) into master (6f8ad22) will increase coverage by 0.58%.
The diff coverage is 99.29%.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 88.66% <ø> (?)
blockchain 92.58% <ø> (?)
client 87.42% <99.29%> (+0.12%) ⬆️
common 98.56% <ø> (?)
ethash ∅ <ø> (∅)
statemanager 84.43% <ø> (?)
trie 90.39% <ø> (?)
tx 95.88% <ø> (ø)
util 86.78% <ø> (?)
vm 79.20% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

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

3 comments in total but they have a question about current engine-API spec.

}
validateHardforkRange(
this.chain.config.chainCommon,
1,
Copy link
Member

Choose a reason for hiding this comment

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

I think it is somewhat implicit, but this check for forkchoiceUpdatedV1 does not seem to be in the engine api specs. It states that it must be updated for engine_forkchoiceUpdatedV2 (so if you call it >= Cancun it throws Unsupported fork) but by spec currently it does not list engine_forkchiceUpdatedV1, see https://github.com/ethereum/execution-apis/blob/main/src/engine/cancun.md#update-the-methods-of-previous-forks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm yes, should we PR to update specs because obviously lower version can't be used in higher version fork because of missing fields

Copy link
Member

Choose a reason for hiding this comment

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

I think there are some small-ish problems wiht the current spec and those changes:

  1. We have 3 files, Paris / Shanghai / Cancun. In Cancun we introduce new rules which override the rules of the other files (this becomes clear once you read all files). The rule which it overrides if for example this Shanghai rule: Client software MUST return -32602: Invalid params error if the wrong version of the structure is used in the method call. (of engine_newPayloadV2)
  2. And building upon the previous: in Cancun we should use INVALID_PARAMS if we call engine_newPayloadV1 (if we are on Shanghai), but this thus implies we are aware (and ready) for Cancun. If we don't know about Cancun and we want to change the spec, then now the behavior changes: if we are on Shanghai, and we call engine_newPayloadV1, then we should return UNSUPPORTED_FORK.

So if we change the spec this starts to get somewhat confusing. I do think we should change the spec though because it is more logical. I am also not aware what happens if we change the behavior, are there CLs relying on exact error codes to change behavior, or do they treat each error as an error in general?

Copy link
Contributor Author

@g11tech g11tech Aug 21, 2023

Choose a reason for hiding this comment

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

may be we can address those issues separately, for now we can may be merge this as it passes cancun fully (and V1 checks also makes sense)

}

validateHardforkRange(
Copy link
Member

Choose a reason for hiding this comment

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

Same here with engine_getPayloadV1

@@ -1202,12 +1301,12 @@ export class Engine {
}

async getPayloadV1(params: [Bytes8]) {
const { executionPayload } = await this.getPayload(params)
const { executionPayload } = await this.getPayload(params, 1)
Copy link
Member

Choose a reason for hiding this comment

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

Same comment here

@holgerd77
Copy link
Member

Updated this via UI

@holgerd77
Copy link
Member

Updated this via UI

@holgerd77
Copy link
Member

Yes, would agree that spec questions can addressed separately, will merge for now.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

LGTM

@holgerd77 holgerd77 merged commit 26c5179 into master Aug 22, 2023
42 checks passed
@holgerd77 holgerd77 deleted the hive-pr834-fixes branch August 22, 2023 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants