-
Notifications
You must be signed in to change notification settings - Fork 775
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: hive Cancun fixes #3099
Conversation
Codecov Report
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
A client test will fail, this expects us to set finalized/safe to the genesis block if it is not yet set. I am not sure if this is correct. Remainder of this is ready for review, other failing hive tests have to do with reorgs, will open a separate PR for that. |
@@ -384,7 +384,7 @@ export class Common { | |||
if (mergeIndex >= 0 && td !== undefined && td !== null) { | |||
if (hfIndex >= mergeIndex && BigInt(hfs[mergeIndex].ttd!) > td) { | |||
throw Error('Maximum HF determined by total difficulty is lower than the block number HF') | |||
} else if (hfIndex < mergeIndex && BigInt(hfs[mergeIndex].ttd!) <= td) { | |||
} else if (hfIndex < mergeIndex && BigInt(hfs[mergeIndex].ttd!) < td) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this change triggers a Common test. I am pretty sure this is ok, we should check for <
not <=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it should be fine to me. I guess theoretically our hardfork could have the same total difficulty as the merge TTD if the intent is for them to occur on the same exact block. @g11tech, would you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah and I forgot to note: this change was triggered by a hive test with thus this exact scenario of hitting the TTD exactly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I've previously verified that the specified hive tests do indeed pass.
@@ -384,7 +384,7 @@ export class Common { | |||
if (mergeIndex >= 0 && td !== undefined && td !== null) { | |||
if (hfIndex >= mergeIndex && BigInt(hfs[mergeIndex].ttd!) > td) { | |||
throw Error('Maximum HF determined by total difficulty is lower than the block number HF') | |||
} else if (hfIndex < mergeIndex && BigInt(hfs[mergeIndex].ttd!) <= td) { | |||
} else if (hfIndex < mergeIndex && BigInt(hfs[mergeIndex].ttd!) < td) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it should be fine to me. I guess theoretically our hardfork could have the same total difficulty as the merge TTD if the intent is for them to occur on the same exact block. @g11tech, would you agree?
Hmm, I have reran the client tests twice now since I thought this would be a random timeout, but maybe this is not the case (have just retriggered, if it does not pass then I should investigate) |
Ok, tests seems failing into a context which I thought was not relevant, will take a look! |
// finalized and safe are always blocks since they have to have valid execution | ||
// before they can be saved in chain | ||
headers.finalized = (await this.getCanonicalFinalizedBlock()).header | ||
headers.safe = (await this.getCanonicalSafeBlock()).header | ||
if (blocks.finalized !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (blocks.finalized !== null) { | |
headers.finalized = blocks.finalized?.header ?? null |
should be cleaner and simlarly for safe
headers.finalized = (await this.getCanonicalFinalizedBlock()).header | ||
headers.safe = (await this.getCanonicalSafeBlock()).header | ||
headers.finalized = blocks.finalized?.header ?? null | ||
headers.safe = blocks.safe?.header ?? null | ||
headers.vm = (await this.getCanonicalVmHead()).header | ||
|
||
blocks.latest = await this.getCanonicalHeadBlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so in this file if one first does gets all the blocks and then the headers, then a sync test fails. If one updates this to the original (see 586868b ) then it passes. Test in question is integration/lightclient.spec.ts
Reading from the thread it seems this can be merged and will therefore do. If I accidentally merged with some todo still left please eventually just do in a small follow-up PR, but seems convenient to have this in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(so: pretty cool work with so many Hive fixes! 🤩 🎉) |
Great, thanks 😄 🙏 |
The goal of this PR is to fix most (all?) of failing hive cancun tests. Before this PR: 55 failing tests. After this PR: 30 failing tests
To run:
./hive --client ethereumjs --sim ethereum/engine --sim.parallelism 8 --sim.limit="engine-cancun"
(change parallelism and ensure hive is at latest
master
)Fixes:
./hive --client ethereumjs --sim ethereum/engine --sim.parallelism 8 --sim.limit="engine-cancun/Bad Hash on NewPayload"
104e6e8, this fixes 3 tests.Inconsistent Head in ForkchoiceState
in b525804, this commit fixes 10 tests. IfrecursivelyFindParents
hits genesis block then we should stop finding more parents, we now have a full reorg back to genesis (?)Pre-Merge Fork Number > 0
: Off by one check in common f2aedcaUnique PayloadID - Withdrawals
: Ensure that different withdrawals result in a different payload ID 14b60a4Open failing tests (with notes):
Invalid PayloadAttributes: Missing BeaconRoot
-> This test seems wrong, it FCUs without aparentBlockBeaconRoot
but then expects us to report that blockhash as head hashInvalid Missing Ancestor ReOrg
-> have to do with reorgs, will open a separate PR for this.