-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
test: add capella support to sim multi-fork tests #5489
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a8b0025
Add capella support to sim multi-fork tests
nazarhussain f0374dd
Update the geth opts for newer version
nazarhussain c33556d
Add shanghai timestamp to el genesis block
nazarhussain dcdff80
Fix nethermind generator
nazarhussain fbaf8d0
Fix the shanghai time option
nazarhussain 86cf610
Update shangai time to be relative
nazarhussain 310d322
Update the order of stopping services
nazarhussain 65e461b
Update the few naming conventions
nazarhussain a246077
Update the sim tests variable names
nazarhussain 709b317
Update the multi_fork tests
nazarhussain 0b08b5a
Update the fork version comparision
nazarhussain 5ab1a65
Update the version check
nazarhussain 7b01d62
Add the wait log
nazarhussain 6b0e344
Update the last fork check
nazarhussain 9b8697f
Fix lint error
nazarhussain 47945a7
Move the fork assertion to seperate file
nazarhussain 7ef9c28
Correct spelling
nazarhussain a78c493
Update the code comment
nazarhussain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/cli/test/utils/simulation/assertions/forkAssertion.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {ApiError} from "@lodestar/api"; | ||
import {ForkName} from "@lodestar/params"; | ||
import {Epoch} from "@lodestar/types"; | ||
import {toHexString} from "@lodestar/utils"; | ||
import {SimulationAssertion} from "../interfaces.js"; | ||
|
||
export function createForkAssertion(fork: ForkName, epoch: Epoch): SimulationAssertion<string, string> { | ||
return { | ||
id: `fork-${fork}`, | ||
match: ({slot, clock}) => { | ||
return slot === clock.getFirstSlotOfEpoch(epoch) ? {match: true, remove: true} : false; | ||
}, | ||
assert: async ({nodes, slot, forkConfig}) => { | ||
const errors: string[] = []; | ||
for (const node of nodes) { | ||
const res = await node.cl.api.debug.getStateV2("head"); | ||
ApiError.assert(res); | ||
const expectedForkVersion = toHexString(forkConfig.getForkInfo(slot).version); | ||
const currentForkVersion = toHexString(res.response.data.fork.currentVersion); | ||
|
||
if (expectedForkVersion !== currentForkVersion) { | ||
errors.push( | ||
`Node is not on correct fork. ${JSON.stringify({ | ||
id: node.cl.id, | ||
slot, | ||
fork, | ||
expectedForkVersion, | ||
currentForkVersion, | ||
})}` | ||
); | ||
} | ||
} | ||
|
||
return errors; | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please add a nice comment above this code explaining the purpose of this and motivation
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.
Done